PDA

View Full Version : get button on QMessageBox



manhds
22nd June 2006, 06:37
I would like get Button on QMessageBox because I would like Resize them.
Can You help me?

e8johan
22nd June 2006, 07:36
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.

Equilibrium
22nd June 2006, 15:37
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:


QMessageBox * box;
box = new QMessageBox();
const QObjectList * list =box->children();
if(!list)
return NULL;
QObjectListIt it( *list ); // iterate over the buttons
QObject *obj;

while ( (obj = it.current()) != 0 )
{
if(obj->isA("QPushbutton"))
{
// Do what you need to do.
}
++it;
}

manhds
27th June 2006, 05:38
Thank you very much !

1. better of creating your own messageBox.
2. If you rather use the QMessageBox you can do the folowings:


QMessageBox * box;
box = new QMessageBox();
const QObjectList * list =box->children();
if(!list)
return NULL;
QObjectListIt it( *list ); // iterate over the buttons
QObject *obj;

while ( (obj = it.current()) != 0 )
{
if(obj->isA("QPushbutton"))
{
// Do what you need to do.
}
++it;
}