setLabel in QprogressDialog
hi, I create a progress dialog from disigner and subclassedit; then I need set its label but the error below occur...why this?
Code:
myProgressDialog* progress = new myProgressDialog (steps, this, "progress", TRUE );
progress->setLabel(l);
error C2039: 'setLabel' : is not a member of 'myProgressDialog'
...also other members get same error.....
Re: setLabel in QprogressDialog
How did you define that subclass? Maybe you forgot to add "public" before the superclass name?
Re: setLabel in QprogressDialog
Code:
class myProgressDialog : public progressDialog {
Q_OBJECT
public:
myProgressDialog
(int steps,
QWidget* creator
=0,
const char* name
=0,
bool modal
=FALSE, WFlags f
=0);
~myProgressDialog();
};
Re: setLabel in QprogressDialog
What is that progressDialog class? If it was generated by uic from .ui file, then it only contains member variables (public, AFAIR) named in the same way as in Qt Designer --- just see the header generated by uic.
Re: setLabel in QprogressDialog
progressDialog.h in ui directory is a class that inherit from QDialog and not from QProgressDialog..is this problem? I designed a dialog called progressDialog from designer;but I'd ike design it and make it inherit from QProgressDialog. What do I have to do? How do I change it? Do you understand what I'd like do? thanks
Re: setLabel in QprogressDialog
Quote:
Originally Posted by mickey
progressDialog.h in ui directory is a class that inherit from QDialog and not from QProgressDialog..is this problem?
Yes, your class is a QDialog not a QProgressDialog, so you can't use QProgressDialog's methods.
Quote:
Originally Posted by mickey
but I'd ike design it and make it inherit from QProgressDialog. What do I have to do? How do I change it?
Unfortunately you can't design custom dialog that inherits from QProgressDialog, because QProgressDialog creates its own layout. Either create your own dialog that behaves like QProgressDialog or customize QProgressDialog using setBar(), setCancelButton() and setLabel() methods.