Results 1 to 9 of 9

Thread: No menubar in release executable

  1. #1
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default No menubar in release executable

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: No menubar in release executable

    Initialise your member variables before using them please.

    Qt Code:
    1. bool flagToolBarVisible;
    2. bool flagFileMenuVisible;
    3. bool flagToolsMenuVisible;
    To copy to clipboard, switch view to plain text mode 

    You use these without setting a default initial value!

  3. #3
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: No menubar in release executable

    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"?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: No menubar in release executable

    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
    Last edited by tbscope; 19th September 2010 at 19:58.

  5. #5
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: No menubar in release executable

    ok, thanks!
    but, have you tried it? and does it go the same way with you (without setting the flags)?

  6. #6
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: No menubar in release executable

    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.

  7. #7
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: No menubar in release executable

    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

  8. #8
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: No menubar in release executable

    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.

  9. #9
    Join Date
    Aug 2010
    Posts
    62
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: No menubar in release executable

    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

Similar Threads

  1. [QT] MenuBar
    By iVo1d in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2010, 13:14
  2. Replies: 5
    Last Post: 30th January 2010, 19:26
  3. Bar on menubar?
    By zgulser in forum Qt Tools
    Replies: 6
    Last Post: 14th January 2009, 08:07
  4. Replies: 3
    Last Post: 5th January 2009, 21:55
  5. Using the menubar
    By Steve in forum Newbie
    Replies: 10
    Last Post: 27th February 2006, 15:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.