首页| 论坛| 消息

标题:【提问】程序有问题,大家帮我看看!
作者:gongyh
日期:2005-09-13 10:56
内容:

我的程序是这样的,我用designer设计了界面文件是note.h
#ifndef NOTE_H
#define NOTE_H
#include
#include
#include
#include
#include
#include
#include
class Ui_Form
{
public:
QPushButton *pushButton;
QPushButton *pushButton_2;
QTextEdit *textEdit;
void setupUi(QWidget *Form)
{
Form->setObjectName(QString::fromUtf8("Form"));
Form->setEnabled(true);
Form->resize(QSize(220, 277).expandedTo(Form->minimumSizeHint()));
pushButton = new QPushButton(Form);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(10, 250, 75, 23));
pushButton_2 = new QPushButton(Form);
pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
pushButton_2->setGeometry(QRect(136, 250, 75, 23));
textEdit = new QTextEdit(Form);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
textEdit->setGeometry(QRect(10, 10, 201, 221));
retranslateUi(Form);
QObject::connect(pushButton_2, SIGNAL(clicked()), textEdit, SLOT(clear()));
QObject::connect(pushButton_2, SIGNAL(clicked()), textEdit, SLOT(setFocus()));
QMetaObject::connectSlotsByName(Form);
} // setupUi
void retranslateUi(QWidget *Form)
{
pushButton->setText(QApplication::translate("Form", "Ok"));
pushButton_2->setText(QApplication::translate("Form", "Cance"));
Q_UNUSED(Form);
} // retranslateUi
};
namespace Ui {
class Form: public Ui_Form {};
} // namespace Ui
#endif // NOTE_H

/////////////////////////////////
// note_ok.h ..


#1 [XChinux 09-13 11:04]
楼主啊,问题在哪里啊
#2 [gongyh 09-13 11:15]
C:\Qt\4.0.0\notebook1>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.0.0/notebook1'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_D
LL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"C:/Qt/4.0.0/include/QtGui" -I"C:/Qt/4.0.0/include/QtCore" -I"C:/Qt/4.0.0/inc
lude" -I"." -I"C:/Qt/4.0.0/include/ActiveQt" -I"tmp\moc\release_shared" -I"." -I
"C:\Qt\4.0.0\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cpp
In file included from main.cpp:3:
note_ok.h:9: error: expected `)' before '*' token
main.cpp: In function `int qMain(int, char**)':
main.cpp:9: error: 'class note_ok' has no member named 'show'
mingw32-make[1]: *** Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.0.0/notebook1'
mingw32-make: *** Error 2
#3 [XChinux 09-13 11:27]
你的类定义后面没跟语句分隔符";"
#4 [XChinux 09-13 11:57]
不应该单继承Form,它只是界面,并没有实际的东西。
应该以QMainForm或QDialog或QWidget来继承
采用多重继承
#5 [gongyh 09-13 12:58]
我觉得那不是问题的所在,现在只有一个错误,大家帮帮看看,
C:\Qt\4.0.0\notebook1>make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.0.0/notebook1'
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_D
LL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I"C:/Qt/4.0.0/include/QtGui" -I"C:/Qt/4.0.0/include/QtCore" -I"C:/Qt/4.0.0/inc
lude" -I"." -I"C:/Qt/4.0.0/include/ActiveQt" -I"tmp\moc\release_shared" -I"." -I
"C:\Qt\4.0.0\mkspecs\win32-g++" -o tmp\obj\release_shared\main.o main.cpp
In file included from main.cpp:3:
note_ok.h:9: error: expected `)' before '*' token
mingw32-make[1]: *** Error 1
mingw32-make[1]: Leaving directory `C:/Qt/4.0.0/notebook1'
mingw32-make: *** Error 2

<< 1 2 >> (1/2)

回复 发表
主题 版块