I make an application that run permanently that why I use a systray icon, but it's not displayed under windows seven. It's works fine on XP. I am using the .ico file that have a 32x32 resolution.
Printable View
I make an application that run permanently that why I use a systray icon, but it's not displayed under windows seven. It's works fine on XP. I am using the .ico file that have a 32x32 resolution.
Hi!
I'm using the QSystemTrayIcon with a QIcon, that loads its data from a resource. Works like a charm in Win7 and XP.
Try to help yourself and build a minimal application, that just loads a systemtray icon.
Good luck,
Johannes
I have made some tests. It works on only one PC that is really really strange, I have remove project and checkout it completely again to be sure there is no more files than on other PCs.
I also have made a minimal application that just works fine, but there is no difference with my project.
I am using visual studio 2010 with Qt Addins plugin 1.1.7 and Qt 4.7.1.
Not my qrc file is correctly loaded. I have put a break point in the generated file to check it.
Code:
int main(int argc, char* argv[]) { TeSingleInstance instance("Service"); if (instance.isAnotherInstanceRunning()) return 0; Q_INIT_RESOURCE(Service); if (argc > 0) { QFileInfo info; info.setFile(argv[0]); } MainWindow window; return application.exec(); } { mMainWindow.setupUi(this); createActions(); createTrayIcon(); mSystemTray.icon->show(); // Do some connect to Ui events } void MainWindow::createActions() { connect(mSystemTray.minimizeAction, SIGNAL(triggered()), this, SLOT(hide())); connect(mSystemTray.maximizeAction, SIGNAL(triggered()), this, SLOT(showMaximized())); connect(mSystemTray.restoreAction, SIGNAL(triggered()), this, SLOT(showNormal())); connect(mSystemTray.settingsAction, SIGNAL(triggered()), this, SLOT(onSettingsActionTriggered())); connect(mSystemTray.quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); } void MainWindow::createTrayIcon() { mSystemTray.menu->addAction(mSystemTray.minimizeAction); mSystemTray.menu->addAction(mSystemTray.maximizeAction); mSystemTray.menu->addAction(mSystemTray.restoreAction); mSystemTray.menu->addSeparator(); mSystemTray.menu->addAction(mSystemTray.settingsAction); mSystemTray.menu->addSeparator(); mSystemTray.menu->addAction(mSystemTray.quitAction); mIcon.addFile(":/myIcon.ico"); mSystemTray.icon->show(); mSystemTray.icon->setIcon(mIcon); setWindowIcon(mIcon); mSystemTray.icon->setContextMenu(mSystemTray.menu); }