我用例程中的hello_base.ui通过uic生成hello.h文件和例程中的hello.h文件不同,导致最终编译老出错!
例程中的hello.h文件:
#ifndef HELLOFORM_H
#define HELLOFORM_H
#include "hello_base.h"
class HelloForm : public HelloBaseForm
{
public:
HelloForm( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
virtual ~HelloForm();
protected:
virtual void SayHello();
};
#endif // HELLOFORM_H
我通过uic生成的hello.h文件
/****************************************************************************
** Form interface generated from reading ui file 'hello_base.ui'
**
** Created: Sun May 9 09:58:39 2010
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#ifndef HELLOBASEFORM_H
#define HELLOBASEFORM_H
#include <qvariant.h>
#include <qwidget.h>
class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QLabel;
class QPushButton;
class HelloBaseForm : public QWidget
{
Q_OBJECT
public:
HelloBaseForm( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~HelloBaseForm();
QLabel* MessageLabel;
QPushButton* PushButton1;
protected slots:
virtual void SayHello();
};
#endif // HELLOBASEFORM_H
[ 此帖被jiangxiang在2010-05-09 14:19重新编辑 ]