Results 1 to 4 of 4

Thread: get button on QMessageBox

  1. #1
    Join Date
    Jan 2006
    Location
    ha noi - viet nam
    Posts
    24
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default get button on QMessageBox

    I would like get Button on QMessageBox because I would like Resize them.
    Can You help me?
    //---------------------------------------

    Full name: Đậu Sỹ Mạnh
    Email: manhds@fsoft.com.vn
    Nationality: Vietname
    Languge: Vietnamese, Janpanese.

    //---------------------------------------

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: get button on QMessageBox

    I'd suggest that you create a message box of your own using Designer instead of using QMessageBox if you want to alter the layout. The purpose of the QMessageBox class is to quickly be able to provide a standard dialog - not a modified one.

  3. #3
    Join Date
    Jun 2006
    Posts
    32
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: get button on QMessageBox

    Quote Originally Posted by manhds
    I would like get Button on QMessageBox because I would like Resize them.
    Can You help me?
    1. better of creating your own messageBox.
    2. If you rather use the QMessageBox you can do the folowings:
    Qt Code:
    1. box = new QMessageBox();
    2. const QObjectList * list =box->children();
    3. if(!list)
    4. return NULL;
    5. QObjectListIt it( *list ); // iterate over the buttons
    6. QObject *obj;
    7.  
    8. while ( (obj = it.current()) != 0 )
    9. {
    10. if(obj->isA("QPushbutton"))
    11. {
    12. // Do what you need to do.
    13. }
    14. ++it;
    15. }
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to Equilibrium for this useful post:

    manhds (27th June 2006)

  5. #4
    Join Date
    Jan 2006
    Location
    ha noi - viet nam
    Posts
    24
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: get button on QMessageBox

    Thank you very much !
    Quote Originally Posted by Equilibrium
    1. better of creating your own messageBox.
    2. If you rather use the QMessageBox you can do the folowings:
    Qt Code:
    1. box = new QMessageBox();
    2. const QObjectList * list =box->children();
    3. if(!list)
    4. return NULL;
    5. QObjectListIt it( *list ); // iterate over the buttons
    6. QObject *obj;
    7.  
    8. while ( (obj = it.current()) != 0 )
    9. {
    10. if(obj->isA("QPushbutton"))
    11. {
    12. // Do what you need to do.
    13. }
    14. ++it;
    15. }
    To copy to clipboard, switch view to plain text mode 
    //---------------------------------------

    Full name: Đậu Sỹ Mạnh
    Email: manhds@fsoft.com.vn
    Nationality: Vietname
    Languge: Vietnamese, Janpanese.

    //---------------------------------------

Similar Threads

  1. Paint XP radio button to pixmap
    By Ben.Hines in forum Qt Programming
    Replies: 2
    Last Post: 26th April 2006, 21:15
  2. Push Button problem!!
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2006, 16:31
  3. use button from another Window
    By raphaelf in forum Qt Programming
    Replies: 11
    Last Post: 2nd March 2006, 20:31
  4. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40
  5. QLabel on a Button
    By cwalsh in forum Newbie
    Replies: 4
    Last Post: 12th January 2006, 16:06

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.