Results 1 to 2 of 2

Thread: MainWindow closes while going through a particular slot.

  1. #1
    Join Date
    Dec 2012
    Posts
    17
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Question MainWindow closes while going through a particular slot.

    I am creating a GUI where i have this particular slot.

    Qt Code:
    1. void MainWindow2::on_pushButton_clicked()
    2. {
    3. QMessageBox::information(this, "Data Forwarded", ui->comboBox_2->currentText() +","+ ui->comboBox_5->currentText());
    4. }
    To copy to clipboard, switch view to plain text mode 

    Ideally it is supposed to just display the information message box,which it does, but somehow my mainwindow2 also closes. please suggest.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: MainWindow closes while going through a particular slot.

    make sure ui->comboBox_2, and ui->comboBox_5 are valid pointer
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. signal slot to mainwindow
    By giugio in forum Newbie
    Replies: 3
    Last Post: 9th November 2012, 21:05
  2. Replies: 0
    Last Post: 6th November 2011, 10:22
  3. Last dialog closes app
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 12th April 2010, 16:17
  4. Replies: 1
    Last Post: 15th November 2009, 23:14
  5. Updating MainWindow from slot
    By Barry79 in forum Qt Programming
    Replies: 2
    Last Post: 11th May 2009, 16:44

Tags for this Thread

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.