diff --git a/src/main.cpp b/src/main.cpp index d1a890352..f64c4174b 100644 --- a/src/main.cpp +++ b/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")); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ebfa78881..4bdadaddb 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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);