PDA

View Full Version : Extending MessageBox



thru
17th December 2010, 11:13
I need to add some additional widgets to a standard messagebox, for example a warning that would have an additional checkbox "Don't show this message more" below the row of the standard pushbuttons.

What would be the best strategy?, implementing a new window is relatively easy if you don't enter into the styles of each platform. Adding the widgets directly to a regular qmessagebox would require accessing the internal layout of the qmessagebox.... any suggestion to what approach take?

Thanks!

high_flyer
17th December 2010, 11:59
Why not just subclass?

BalaQT
17th December 2010, 12:24
hi,
as high_flyer said, subclass is the best way to go.
Bala

wysota
17th December 2010, 12:51
I need to add some additional widgets to a standard messagebox, for example a warning that would have an additional checkbox "Don't show this message more" below the row of the standard pushbuttons.

What would be the best strategy?
The best strategy would be to use QErrorMessage.

high_flyer
17th December 2010, 13:00
The best strategy would be to use QErrorMessage.
Man... there are so many new specialized classes, it really is hard to keep up with the trolls... :)
Since which version is this?

wysota
17th December 2010, 13:02
Man... there are so many new specialized classes, it really is hard to keep up with the trolls... :)
Since which version is this?

Hmm.... since Qt 3.0 :)

http://doc.qt.nokia.com/3.0/qerrormessage.html

high_flyer
17th December 2010, 13:23
LOL.
Well, till today I never used it...
Learned something new today :)

thru
17th December 2010, 16:31
Well I learned two (at least) things, one that I could sublclass the QMessagebox (when I asked I was not aware that I could access its QLayout, but after some tests I think I got it) and second the QErrorMessage that probably I read about it but with so many classes and at an age one can not cope with all :-)

Thank you!