Results 1 to 9 of 9

Thread: declaring objects inside Designer

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

    Question declaring objects inside Designer

    HI,
    I have declare in class variables (inside qtdesigner in MainForm.ui.h) Scene scene; (Scene i s a class). After I add (in implementation) include "../M/scene.h" but don't compile; the instance 'scene' is not recognized inside member of MainForm class.
    is it possible declare an instance of object inside Designer?
    Thanks

    Qt Code:
    1. ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
    2. mywidget.cpp
    3. ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
    4. mymainform.cpp
    5. ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
    6. Generating Code...
    7. NMAKE : fatal error U1077: 'cl' : return code '0x2'
    8. Stop.
    To copy to clipboard, switch view to plain text mode 
    Last edited by mickey; 11th March 2006 at 15:22.
    Regards

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

    Default Re: declaring objects inside Designer

    nothing hint for this? Thanks
    Regards

  3. #3
    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: declaring objects inside Designer

    You have to add that include in declaration.

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

    Default Re: declaring objects inside Designer

    sorry but Itried it already but don't works. The compiler error is the same...
    Regards

  5. #5
    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: declaring objects inside Designer

    How did you declare that variable?

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

    Default Re: declaring objects inside Designer

    I have declare in class variables (inside qtdesigner in MainForm.ui.h) Scene scene;
    I do this because I need scene member of MainForm class (that is a class created from QT); thanks
    Regards

  7. #7
    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: declaring objects inside Designer

    Could you post your .ui file? Anyway your life would be easier, if you were using the subclassing approach, since you would have full control over the class definition.

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

    Default Re: declaring objects inside Designer SOLVED

    Hi, I see now that I had a tabWidget with name 'Scene'. I change it and now compile. Yes I have subclass MainForm with myMainForm but in MainForm I have many function; Do you advice me to make MinForm.ui.h empty and put every function in myMainForm? Thanks
    Regards

  9. #9
    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: declaring objects inside Designer SOLVED

    Quote Originally Posted by mickey
    I have subclass MainForm with myMainForm but in MainForm I have many function; Do you advice me to make MinForm.ui.h empty and put every function in myMainForm?
    You can start using the subclassing approach with your next form.

Similar Threads

  1. Delete objects in Designer
    By Krish_ng in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2007, 10:42
  2. Replies: 4
    Last Post: 11th July 2007, 04:21

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.