PDA

View Full Version : Minimize application on launch ..?



hakermania
1st September 2010, 20:46
Is this possible? I mean, to minimize the app in launch?
I have added an tray icon from which you can access the app from there, but, the worj of my app is "background work", so, some users may want to be minimized right away and send it to tray (this will be done automatically with the change event, don't worry about this, I've fixed it). So, is there any way to minimize an application on launch, just editing its constructor?:confused:

otternase
1st September 2010, 22:32
QMainWindow is derived from QWidget, therefore this should work:

void QWidget::showMinimized () [slot]

Shows the widget minimized, as an icon.
Calling this function only affects windows.

See also showNormal(), showMaximized(), show(), hide(), isVisible(), and isMinimized().

hakermania
2nd September 2010, 07:30
Thank you. The solution is:
Qt::QueuedConnection; MainWindow::showMinimized(); MainWindow::hide(); :):):)