[Qt-interest] object derived from qgraphicsItem and QMessageBox?
Colin S. Miller
no-spam-thank-you at csmiller.demon.co.uk
Tue Oct 27 12:37:38 CET 2009
Riccardo Roasio wrote:
> So i can create a modal dialog also using QGraphicsItem?
> I would use a QMessageBoxLike item as it is, so create it, retrieve user
> input and destroy it...
>
> Riccardo
Riccardo,
a modal dialog box is just a QWidget with the modal flag set
(Qt::WType_Dialog || Qt::WType_Modal), pre-written code to handle the buttons,
and an instance of the event loop. See http://doc.trolltech.com/4.1/qeventloop.html
or the source code for QDialog.
It would be better to write your own dialog class, inserting into it a
QGridLayout object that contains the buttons, labels and the QGraphicsItem.
HTH,
Colin S. Miller
More information about the Qt-interest-old
mailing list