[Qt-interest] code from uic
Eirik Ulvik
eiriku at simsurgery.com
Thu Jan 28 13:28:20 CET 2010
Have a look at this on different approaches to use the uic generated files.
http://doc.trolltech.com/qq/qq14-designer.html
Regards,
Eirik
Den 28.01.2010 13:04, skrev Zygmunt Ptak:
> Hi!
> Why uic generate code in header file like this:
>
> /*************************************************************************/
>
> #ifndef UI_UNTITLED_H
> #define UI_UNTITLED_H
>
> #include<QtCore/QVariant>
> #include<QtGui/QAction>
> #include<QtGui/QApplication>
> #include<QtGui/QButtonGroup>
> #include<QtGui/QGridLayout>
> #include<QtGui/QHeaderView>
> #include<QtGui/QPushButton>
> #include<QtGui/QWidget>
>
> QT_BEGIN_NAMESPACE
>
> class Ui_Form
> {
> public:
> QGridLayout *gridLayout;
> QPushButton *pushButton;
>
> void setupUi(QWidget *Form)
> {
> if (Form->objectName().isEmpty())
> Form->setObjectName(QString::fromUtf8("Form"));
> Form->resize(400, 300);
> gridLayout = new QGridLayout(Form);
> gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
> pushButton = new QPushButton(Form);
> pushButton->setObjectName(QString::fromUtf8("pushButton"));
>
> gridLayout->addWidget(pushButton, 0, 0, 1, 1);
>
>
> retranslateUi(Form);
>
> QMetaObject::connectSlotsByName(Form);
> } // setupUi
>
> void retranslateUi(QWidget *Form)
> {
> Form->setWindowTitle(QApplication::translate(
> "Form", "Form", 0, QApplication::UnicodeUTF8));
> pushButton->setText(QApplication::translate(
> "Form", "PushButton", 0, QApplication::UnicodeUTF8));
> Q_UNUSED(Form);
> } // retranslateUi
>
> };
>
> namespace Ui {
> class Form: public Ui_Form {};
> } // namespace Ui
>
> QT_END_NAMESPACE
>
> #endif // UI_UNTITLED_H
>
> /*************************************************************************/
>
>
> Better is split to header and source file.
>
> Why create next class Ui::Form???
> And why Ui_Form is not called Form in namespace Ui (if we do not
> generate next class)???
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list