PDA

View Full Version : QMake how to let UIC generate BOTH header and source files?



timewolf
17th August 2011, 02:59
in the .pro file, I defined both UI_HEADERS_DIR = ./uic/include UI_SOURCES_DIR = ./uic/src but after compiling, I only get the ui_x.h files, which contain both declarations and implementations.

Is this mean QMake can't produce a simple header file containing only the minimal declarations and put all the implementation details into source file?

This is a sample generated .h file, you can find both declarations and implementations are placed within the .h file:


/************************************************** ******************************
** Form generated from reading UI file 'DemoDialog.ui'
**
** Created: Thu 21. Jul 16:08:58 2011
** by: Qt User Interface Compiler version 4.7.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
************************************************** ******************************/

QT_BEGIN_NAMESPACE

class Ui_DemoDialog
{
public:

void setupUi(QDialog *DemoDialog)
{
if (DemoDialog->objectName().isEmpty())
DemoDialog->setObjectName(QString::fromUtf8("DemoDialog"));
DemoDialog->resize(400, 300);

retranslateUi(DemoDialog);

QMetaObject::connectSlotsByName(DemoDialog);
} // setupUi

void retranslateUi(QDialog *DemoDialog)
{
DemoDialog->setWindowTitle(QApplication::translate("DemoDialog", "Dialog", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};

namespace Ui {
class DemoDialog: public Ui_DemoDialog {};
} // namespace Ui

QT_END_NAMESPACE

wysota
17th August 2011, 08:27
UIC doesn't produce .cpp files.

timewolf
17th August 2011, 15:27
UIC doesn't produce .cpp files.

Thanks with noted:-)