Does this happen on all platforms?
BTW, using labels and goto's is considered bad practice/coding/design. You can easily do that with a boolean function and a while loop.
Does this happen on all platforms?
BTW, using labels and goto's is considered bad practice/coding/design. You can easily do that with a boolean function and a while loop.
Oh right, I forgot.
I am using Ubuntu 7.10 with Qt 4.3.3. I based this off the trayicon example in the Qt Docs. The Qt example, when compiled, works perfectly as it should. On the Windows platform, the context menu also works as it should.
I'll replace the goto stuff with a while() loop, but why is goto bad?
A label is where a "goto" goes. In your example, retryTrayIcon is a label.
They are bad because they make the code unreadable, are very likely to cause errors and also make the code harder to maintain.
The only difference between your app and the Qt Systray example is that you start up with your application hidden. Try, just for testing, to show it, in main.cpp. See if you're experiencing the same behavior.
codeslicer (10th February 2008)
Hmm, weird. In my original source code, adding or subtracting the win.show() didn't make a difference. But I made a seperate project removing extra commands and it worked. I'll look around, and if I can't find it, I'll upload a zipped copy of my source code. Thanks though![]()
I got it! It was QDevelop's fault. Apparently, when I ran the executable by using the debug button, the menu wouldn't lose focus. However, when I opened that binary, everything worked!!!
This is truly strangeIs it because QDevelop or the debugger is changing the ownership of the menu?
Bookmarks