Results 1 to 20 of 21

Thread: alternative to QMessageBox

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: alternative to QMessageBox

    Qt Code:
    1. waitDialog_dlg = new WaitDialog(200, this);
    To copy to clipboard, switch view to plain text mode 
    a life without programming is like an empty bottle

  2. The following user says thank you to zlatko for this useful post:

    incapacitant (23rd May 2006)

  3. #2
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default alternative to QMessageBox

    zlatko:
    Thanks I have done that bit to instantiate the dialog.
    The trouble remains how to call, display and start the dialog and its timer

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: alternative to QMessageBox

    Please learn it yourself.

  5. #4
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default alternative to QMessageBox

    I knew zlatko was going to get trouble. Yes, master. I have downloaded the books.

  6. #5
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default alternative to QMessageBox

    wysota: It is true that I have to learn, and I thank you for your attitude.

    For info, your class had a bug, the correct code is :
    Qt Code:
    1. class WaitDialog : public QDialog {
    2. public:
    3. WaitDialog(uint interval, QWidget *p=0) : QDialog(p)
    4. {
    5. QVBoxLayout *l = new QVBoxLayout(this);
    6. QLabel *lab = new QLabel("Please wait");
    7. l->addWidget(lab);
    8. setLayout(l);
    9. timer.setSingleShot(true);
    10. timer.setInterval(interval);
    11. connect(&timer, SIGNAL(timeout()), this, SLOT(accept()));
    12. }
    13.  
    14. int exec() // rather than void
    15. {
    16. timer.start();
    17. return QDialog::exec(); // needed return
    18. }
    19.  
    20. private:
    21. QTimer timer;
    22. };
    To copy to clipboard, switch view to plain text mode 

    Then to call it :
    Qt Code:
    1. WaitDialog waitDialog_dlg( 2000, this );
    2. if ( waitDialog_dlg.exec() )
    3. {
    4. }
    To copy to clipboard, switch view to plain text mode 

    I learn slowly, but I am stubborn and I will get there.

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: alternative to QMessageBox

    A little bug. void should be ok too. It just didn't return a value, which is (by the way) not important here.

  8. The following user says thank you to wysota for this useful post:

    incapacitant (24th May 2006)

Similar Threads

  1. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  2. QMessageBox buttons appearance
    By yartov in forum Qt Programming
    Replies: 6
    Last Post: 26th June 2008, 01:36
  3. Display row Number in QMessageBox
    By arunvv in forum Newbie
    Replies: 6
    Last Post: 1st May 2008, 23:24
  4. Re: Help on QMessageBox
    By arunvv in forum Newbie
    Replies: 2
    Last Post: 25th March 2008, 23:45
  5. QMessageBox problem in Qtopia
    By jogeshwarakundi in forum Qt for Embedded and Mobile
    Replies: 5
    Last Post: 8th February 2008, 09:22

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.