Set icon theme before showing windows.
--HG-- branch : develop
This commit is contained in:
parent
76816a7bcd
commit
4093f139fa
10
src/main.cpp
10
src/main.cpp
|
@ -105,6 +105,16 @@ int main(int argc, char *argv[])
|
|||
#endif
|
||||
app.installTranslator(&appTranslator);
|
||||
|
||||
static const char * GENERIC_ICON_TO_CHECK = "document-open";
|
||||
if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false)
|
||||
{
|
||||
//If there is no default working icon theme then we should
|
||||
//use an icon theme that we provide via a .qrc file
|
||||
//This case happens under Windows and Mac OS X
|
||||
//This does not happen under GNOME or KDE
|
||||
QIcon::setThemeName("win.icon.theme");
|
||||
}
|
||||
|
||||
MainWindow w;
|
||||
w.setWindowState(w.windowState() ^ Qt::WindowMaximized);
|
||||
app.setWindowIcon(QIcon(":/icon/64x64/icon64x64.png"));
|
||||
|
|
|
@ -1382,19 +1382,6 @@ void MainWindow::CreateMenus()
|
|||
void MainWindow::CreateActions()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
static const char * GENERIC_ICON_TO_CHECK = "document-open";
|
||||
if (QIcon::hasThemeIcon(GENERIC_ICON_TO_CHECK) == false)
|
||||
{
|
||||
//If there is no default working icon theme then we should
|
||||
//use an icon theme that we provide via a .qrc file
|
||||
//This case happens under Windows and Mac OS X
|
||||
//This does not happen under GNOME or KDE
|
||||
QIcon::setThemeName("win.icon.theme");
|
||||
ui->actionNew->setIcon(QIcon::fromTheme("document-new"));
|
||||
ui->actionOpen->setIcon(QIcon::fromTheme("document-open"));
|
||||
ui->actionSave->setIcon(QIcon::fromTheme("document-save"));
|
||||
ui->actionSaveAs->setIcon(QIcon::fromTheme("document-save-as"));
|
||||
}
|
||||
|
||||
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
|
||||
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
|
||||
|
|
Loading…
Reference in New Issue
Block a user