PDA

View Full Version : No menubar in release executable



harmodrew
19th September 2010, 19:33
Hello!
In my project if I build in debug mode then it goes good.
while if I build with the release executable then the executable doesn't show me the menubar...should you take a look wheater the problem is the code or my compiler?
you can find the projct at this link http://www.mediafire.com/?kvr385isx5cecwm
thanks

tbscope
19th September 2010, 19:46
Initialise your member variables before using them please.


bool flagToolBarVisible;
bool flagFileMenuVisible;
bool flagToolsMenuVisible;

You use these without setting a default initial value!

harmodrew
19th September 2010, 19:50
thanks for the reply!
but, the program works fine in debug mode, even not setting the flags..why in release mode it changes the "flag policy"?

tbscope
19th September 2010, 19:52
Because it is RANDOM. The debug code is larger than the release code, making the position of the variable different and the contents (which are random) also different

Please, pretty please, initialise them anyway. There is absolutely no sane reason not to do so.

Edit: not really random, but certainly not what is expected

harmodrew
19th September 2010, 19:54
ok, thanks! :)
but, have you tried it? and does it go the same way with you (without setting the flags)?

tbscope
19th September 2010, 19:55
No, I haven't tried it yet.

Can you test it first please. If it still doesn't work, I'll see if I can test it here.

harmodrew
19th September 2010, 19:57
yes. but I've to install the Qt SDK again :S
I thought the error should come from the SDK so I uninstalled it and now I'm downloading it...as soon as possible I'll try it for sure :)

tbscope
19th September 2010, 19:59
When you think the error is in Qt SDK, then you can be pretty sure the error is in your code and not in Qt

I don't say there are bugs in Qt, but when I look at your code, the uninitialised variable to create the menu is a hug bulls eye for me.

harmodrew
19th September 2010, 22:35
ok, the error was the flag's value :)
however I wasn't complaining about Qt! I thought it could came out for a Qt's path error or configuration! :)
I love Qt and I could never complain about it for this dumb error!
thanks again