PDA

View Full Version : declaring objects inside Designer



mickey
11th March 2006, 15:19
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



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.

mickey
13th March 2006, 16:51
nothing hint for this? Thanks

jacek
13th March 2006, 17:45
You have to add that include in declaration.

mickey
13th March 2006, 20:23
sorry but Itried it already but don't works. The compiler error is the same...

jacek
13th March 2006, 20:30
How did you declare that variable?

mickey
13th March 2006, 23:55
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

jacek
14th March 2006, 00:25
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.

mickey
14th March 2006, 10:07
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

jacek
14th March 2006, 18:25
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.