Results 1 to 4 of 4

Thread: Simple questions

  1. #1
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Simple questions

    I create a QDialog and insert a QPushButton, which when clicked calls a QMainWindows, but QMainWindows only flashes on the screen, and will not appear.

    here is the simple code:
    Qt Code:
    1. login.h
    2. private slots:
    3. void Pushbutton_ok_click();
    4.  
    5. login.cpp
    6. connect(ui->pushButton_OK,SIGNAL(clicked()),this,SLOT(Pushbutton_ok_click()));
    7.  
    8. void Login::Pushbutton_ok_click()
    9. {
    10. MainWindow W;
    11. W.show();
    12. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Simple questions

    Simple question in return (and a big hint): what is the life of a widget created on the stack?

  3. #3
    Join Date
    Jun 2008
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Simple questions

    ok. Where a have to create it?

  4. #4
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Simple questions

    Here at the bottom of the page is a Qt related explanation.

Similar Threads

  1. New to QT and have a few questions.
    By vbman213 in forum Newbie
    Replies: 3
    Last Post: 1st February 2010, 06:50
  2. Two probably simple Qt4 Questions
    By frenk_castle in forum Newbie
    Replies: 3
    Last Post: 16th September 2009, 15:37
  3. Simple DB app, some questions.
    By juannm in forum Qt Programming
    Replies: 1
    Last Post: 19th February 2008, 11:46
  4. simple questions. qt3 to qt4
    By impeteperry in forum Newbie
    Replies: 16
    Last Post: 3rd April 2006, 17:41
  5. A few questions about Qt/Win
    By Bojan in forum Installation and Deployment
    Replies: 3
    Last Post: 16th January 2006, 09:54

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.