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
Code:
ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
mywidget.cpp
ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
mymainform.cpp
ui\mainform.h(140) : error C2327: 'MainForm::Scene' : is not a type name, static, or enumerator
Generating Code...
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
Re: declaring objects inside Designer
nothing hint for this? Thanks
Re: declaring objects inside Designer
You have to add that include in declaration.
Re: declaring objects inside Designer
sorry but Itried it already but don't works. The compiler error is the same...
Re: declaring objects inside Designer
How did you declare that variable?
Re: declaring objects inside Designer
Quote:
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
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.
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
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.