Sets the cancel button to the push button, cancelButton. The progress dialog takes ownership of this button which will be deleted when necessary, so do not pass the address of an object that is on the stack, i.e. use new() to create the button. If 0 is passed then no cancel button will be shown.
But if I use :setCancelButton( 0 ) I receive "argument error".
I'm working with Qt 4.8.4
Cheers
Luigi Ferraris
I need to disable cancelButton on a QProgressDialog, so I follow this from Qt 4 docs:void QProgressDialog::setCancelButton ( QPushButton * cancelButton )
Sets the cancel button to the push button, cancelButton. The progress dialog takes ownership of this button which will be deleted when necessary, so do not pass the address of an object that is on the stack, i.e. use new() to create the button. If 0 is passed then no cancel button will be shown.
But if I use :setCancelButton( 0 ) I receive "argument error".
You probably need to study Qt documentation and grasp what "0" means in C++ level.
void QProgressDialog::setCancelButton ( QPushButton * cancelButton )
<cancelButton> should be a NULL pointer, which is denoted by "0", in documentation,and because Qt is explained at C++ level, NULL == 0 is taken care by the compiler.So from PRG layer you cannot pass 0 to QPushButton.
Try like,oDlg:setCancelButton ( QPushButton() )
Not sure it will work as expected, but then we have only this mechanism for a NULL object.
Many thanks for infos.Pritpal Bedi
Probably, before I need to know C++ :)). This is the most important problem for me.
I just have done a test, but cancelbutton always stay on without "text". Is not a valid solution.....
Try like,oDlg:setCancelButton ( QPushButton() )
Not sure it will work as expected, but then we have only this mechanism for a NULL object.
So this way it is not accepted as valid NULL object.No other way though, sorry.