Results 1 to 6 of 6

Thread: setLabel in QprogressDialog

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default 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?
    Qt Code:
    1. myProgressDialog* progress = new myProgressDialog (steps, this, "progress", TRUE );
    2. QLabel* l = new QLabel ("progress", 0);
    3. progress->setLabel(l);
    4. error C2039: 'setLabel' : is not a member of 'myProgressDialog'
    To copy to clipboard, switch view to plain text mode 

    ...also other members get same error.....
    Last edited by mickey; 11th July 2006 at 22:00.
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setLabel in QprogressDialog

    How did you define that subclass? Maybe you forgot to add "public" before the superclass name?

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: setLabel in QprogressDialog

    Qt Code:
    1. class myProgressDialog : public progressDialog {
    2. Q_OBJECT
    3. public:
    4. myProgressDialog(int steps, QWidget* creator=0, const char* name=0, bool modal=FALSE, WFlags f =0);
    5. ~myProgressDialog();
    6. };
    To copy to clipboard, switch view to plain text mode 
    Regards

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

  5. #5
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default 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
    Regards

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.