QT Designer - using .ui file tutorial bug?
section - The Direct Approach
Ui::CalculatorForm ui; // this not works (calculatorform not memember of UI namespace)
QWidget *w = new QWidget;
Ui::Form ui; // intelisense give me Form and this works fine
Some wrong setting in creator settings or obsolete docu?
for Qt newbie (like me ) its little bit frustrating.
thanks for answers
are you referring to this "example":http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html#the-direct-approach ?
if so, did you add
at the top?
even with that though, i was not able to make it work properly.
providing a QWidget only allows a root widget element to be there so that the rest of the widgets can use it as parent and draw themselves.
there is no way to provide functionality with user provided slots.
what i did was to have my main.cpp as
int main(int argc, char *argv)
QApplication app(argc, argv);
CalculatorForm *widget = new CalculatorForm; widget->show(); return app.exec();
and in calculatorform.cpp
thanks for answer.
yes i refered that example.
i found what was wrong. In Qt Designer the widgets property objectName has default value "Form". After change to "CalculatorForm" is all ok.
exactly like in the example.