Results 1 to 3 of 3

Thread: How to open a new form

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How to open a new form

    Hi there,

    I am really new in Qt programming and this forum also.

    So I would like to salute all of you.


    I am wotking on my first project and I am trying to show an existing form.

    My command has like this

    void MainWindow:n_actionAbout_triggered()
    {
    about a;
    a.show();
    }

    When thin function is executed the a window is shown for some miliseconds and then it disapears. It seem like it is not activated anymore.

    Why this happen ?


    Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to open a new form

    Use exec() to show it as a modal dialog.. And why it is currently deleted (basic C++): you create "about" on the stack and thus it gets deleted after the scope "}" ends.

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to open a new form

    Thank you.

Similar Threads

  1. How to open another form in Qt4?
    By sapslaj in forum Newbie
    Replies: 12
    Last Post: 4th September 2011, 15:16
  2. Replies: 7
    Last Post: 8th October 2010, 13:07
  3. Open one Form (widget)
    By vinny gracindo in forum Newbie
    Replies: 1
    Last Post: 7th October 2009, 13:13
  4. Replies: 10
    Last Post: 6th July 2008, 09:46
  5. Replies: 3
    Last Post: 13th May 2007, 20:55

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.