Results 1 to 6 of 6

Thread: Dialog executes in debug build but not release

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jun 2008
    Location
    Glenwood, NJ USA
    Posts
    32
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Dialog executes in debug build but not release

    I found the problem. When I call the slot:

    Qt Code:
    1. void MainWindow::newNetwork() {
    2. if(!newnet)
    3. newnet = new NewNetworkDialog(this);
    4. newnet->exec();
    5. }
    To copy to clipboard, switch view to plain text mode 

    I declared it in newnetworkdialog.h as:

    Qt Code:
    1. QDialog* newnet;
    To copy to clipboard, switch view to plain text mode 

    I wrongly assumed it would initialize to zero. By adding to the MainWindow constructor:

    Qt Code:
    1. newnet = 0;
    To copy to clipboard, switch view to plain text mode 

    It works now. My apologies as this is a basic C++ issue. But my question is why did it work in debug mode and would there be a better way to initialize the newnet to point to null?
    Last edited by jpn; 24th June 2008 at 15:22. Reason: missing [code] tags

Similar Threads

  1. build debug with shared and release with static?
    By Thor28 in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2008, 22:32
  2. Need debug and release versions of Qwt?
    By Tiansen in forum Qwt
    Replies: 1
    Last Post: 28th March 2008, 07:55
  3. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  4. Replies: 2
    Last Post: 8th November 2007, 20:15
  5. Adding custom defines when on debug build
    By chus in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2007, 11:38

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
  •  
Qt is a trademark of The Qt Company.