Set icon theme before showing windows.

--HG--
branch : develop
This commit is contained in:
dismine 2014-02-19 23:34:57 +02:00
parent 76816a7bcd
commit 4093f139fa
2 changed files with 10 additions and 13 deletions

View File

@ -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"));

View File

@ -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);