-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
32 lines (25 loc) · 1.01 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <DApplication>
#include <QDesktopWidget>
#include <DWidgetUtil> //Dtk::Widget::moveToCenter(&w); 要调用它,就得引用DWidgetUtil
#include <widget.h>
DWIDGET_USE_NAMESPACE
int main(int argc, char *argv[])
{
DApplication::loadDXcbPlugin(); //让bar处在标题栏中
DApplication a(argc, argv);
a.setAttribute(Qt::AA_UseHighDpiPixmaps);
a.loadTranslator();
a.setOrganizationName("deepin");
a.setApplicationVersion(DApplication::buildVersion("1.0.3"));
a.setApplicationAcknowledgementPage("https://blog.yzzi.top");
a.setProductIcon(QIcon(":/icon/icon/top.yzzi.tomato.svg")); //设置Logo
a.setProductName("一只番茄");
a.setApplicationName("一只番茄"); //只有在这儿修改窗口标题才有效
a.setApplicationDescription("感谢deepin社区 @gbwater 提供的帮助");
Widget w;
QDesktopWidget *s=DApplication::desktop();
w.show();
//让打开时界面显示在正中
Dtk::Widget::moveToCenter(&w);
return a.exec();
}