hi,你们好,
我在我的虚拟机上装了qt-embedded-4.5.1-arm,qt-x11-4.5.1 想做个hello的实验,
首先我用tmake1.13的 progen 生成一个hello.pro,
接着我用qt-x11-4.5.1下的 designer 生成了一个hello.ui 文件,然后我用 uic -o hello.h hello.ui 生成了一个hello.h 文件,如下面所示. 接着我想用 uic -o hello.cpp -impl hello.h hello.ui
来生成hello.cpp文件的,他提示我没有-impl这个选项 如果我不加这个选项也可以生成hello.cpp文件但内容和hello.h文件的内容是一样的, 我发现qt -x11-4.5.1 下面还有个uic3 ,我就用uic3命令来重复上面两个命令(uic3 -o hello.h hello.ui 和uic3 -o hello.cpp -impl hello.h hello.ui),没有出错生成了hello.h 文件和hello.cpp文件, 但是这两个文件没有内容啊,很郁闷,请问大侠们这是怎么回事啊, uic 和uic3 有什么区别啊,是版本不一样嘛, 请大家指教了,谢谢了先.
/********************************************************************************
** Form generated from reading ui file 'hello.ui'
**
** Created: Wed May 20 22:06:29 2009
** by: Qt User Interface Compiler version 4.5.1
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
#ifndef HELLO_H
#define HELLO_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QPushButton>
#include <QtGui/QTextEdit>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Hello
{
public:
QPushButton *pushButton;
QTextEdit *textEdit;
void setupUi(QWidget *Hello)
{
if (Hello->objectName().isEmpty())
Hello->setObjectName(QString::fromUtf8("Hello"));
Hello->setEnabled(true);
Hello->resize(240, 320);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(Hello->sizePolicy().hasHeightForWidth());
Hello->setSizePolicy(sizePolicy);
Hello->setMinimumSize(QSize(240, 320));
Hello->setMaximumSize(QSize(240, 320));
Hello->setSizeIncrement(QSize(240, 320));
Hello->setBaseSize(QSize(240, 320));
QFont font;
font.setPointSize(12);
font.setBold(false);
font.setWeight(50);
Hello->setFont(font);
Hello->setAutoFillBackground(true);
pushButton = new QPushButton(Hello);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(60, 80, 80, 26));
textEdit = new QTextEdit(Hello);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
textEdit->setGeometry(QRect(10, 130, 201, 61));
retranslateUi(Hello);
QMetaObject::connectSlotsByName(Hello);
} // setupUi
void retranslateUi(QWidget *Hello)
{
Hello->setWindowTitle(QApplication::translate("Hello", "Form", 0, QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("Hello", "OK", 0, QApplication::UnicodeUTF8));
textEdit->setHtml(QApplication::translate("Hello", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'Sans Serif'; font-size:12pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600; font-style:italic;\">Hello ,I Love My Wife XianXian</span></p></body></html>", 0, QApplication::UnicodeUTF8));
Q_UNUSED(Hello);
} // retranslateUi
};
namespace Ui {
class Hello: public Ui_Hello {};
} // namespace Ui
QT_END_NAMESPACE
#endif // HELLO_H