PDA

View Full Version : QMainWindow or QWidget start hidden?



marf
3rd December 2008, 16:19
I have been playing around with these two classes, and I can't get them to start as hidden.

I try using the showEvent() and then calling hide(), or setVisible( false );. But neither works. However if I have a button within the window/widget, and when I press the button I then call hide(), it works. So how can I make a MainWindow or Widget Invisible upon it's creation? You probably ask why I want to make i invisible. Well I am using QSystemTrayIcon, and when the program is executed I only want a system tray icon to be visible, no window.

Thanks,

Marf

^NyAw^
3rd December 2008, 17:06
Hi,

Take a look at "main" function. You have "yourMainWindow.show()". Just remove or comment this code line.

marf
3rd December 2008, 17:23
Hahahaha, how did I miss that? Thanks for pointing out the obvious. I'm still chuckling to myself.. :)