Ai
1 Star 0 Fork 9

馬迪/zViewer

forked from sunya/zViewer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.cpp 988 Bytes
一键复制 编辑 原始数据 按行查看 历史
sunya 提交于 2017-02-11 13:57 +08:00 . first commit, vs2013 project
#include "ui/zViewer.h"
#include <QtWidgets/QApplication>
#include <QtWidgets/QDesktopWidget>
#include <QSurfaceFormat>
#include <QRect>
#include <QFile>
#include <QTextCodec>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//obtain desktop available size
QDesktopWidget* desktop = QApplication::desktop();
QRect windowRect = QApplication::desktop()->availableGeometry();
QRect clientRect(windowRect.left(), windowRect.top(), windowRect.width() - 8, windowRect.height() - 8);
//main window
zViewer w(clientRect.width(),clientRect.height(),clientRect.left(),clientRect.top());
w.setWindowFlags(Qt::CustomizeWindowHint);
w.move( - 2, clientRect.top() - 2);
w.resize(clientRect.size());
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
//load custome style sheet file
QFile styleFile("style.qss");
styleFile.open(QIODevice::ReadOnly);
QString setStyleSheet(styleFile.readAll());
a.setStyleSheet(setStyleSheet);
return a.exec();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/linuxaged/zViewer.git
git@gitee.com:linuxaged/zViewer.git
linuxaged
zViewer
zViewer
master

搜索帮助