M.
15th November 2009, 12:54
Hi,
I am developing an application which doesn't have top level window. Only a system tray icon. When I choose the about action in the system tray menu, it displays the About dialog and after I click Ok, the application quits. If the top level window is displayed, the About dialog doesn't terminate the application. I am using Qt 4.5.3 and Ubuntu 9.10
main.cpp
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
//w.show();
return a.exec();
}
Method, displaying the About dialog
void MainWindow::aboutDialog()
{
QMessageBox::about(this, trUtf8("Title"), trUtf8("Some text"));
}
EDIT:
Solved the problem by setting QuitOnLastWindowClosed property to false. Sorry for bothering you :o
I am developing an application which doesn't have top level window. Only a system tray icon. When I choose the about action in the system tray menu, it displays the About dialog and after I click Ok, the application quits. If the top level window is displayed, the About dialog doesn't terminate the application. I am using Qt 4.5.3 and Ubuntu 9.10
main.cpp
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
//w.show();
return a.exec();
}
Method, displaying the About dialog
void MainWindow::aboutDialog()
{
QMessageBox::about(this, trUtf8("Title"), trUtf8("Some text"));
}
EDIT:
Solved the problem by setting QuitOnLastWindowClosed property to false. Sorry for bothering you :o