主题 : UIC生成.h文件问题 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 3133
精华: 0
发帖: 22
金钱: 115 两
威望: 26 点
综合积分: 44 分
注册时间: 2008-12-27
最后登录: 2010-11-16
楼主  发表于: 2010-05-09 10:09

 UIC生成.h文件问题

我用例程中的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重新编辑 ]
级别: 新手上路
UID: 21422
精华: 0
发帖: 29
金钱: 145 两
威望: 29 点
综合积分: 58 分
注册时间: 2010-05-16
最后登录: 2015-01-22
1楼  发表于: 2010-05-29 20:01
我也遇上这样的问题,请求大虾帮忙解决,谢谢
级别: 新手上路
UID: 3133
精华: 0
发帖: 22
金钱: 115 两
威望: 26 点
综合积分: 44 分
注册时间: 2008-12-27
最后登录: 2010-11-16
2楼  发表于: 2010-05-29 21:15
自己顶一下!希望高手解决一下!
级别: 新手上路
UID: 50712
精华: 0
发帖: 34
金钱: 175 两
威望: 35 点
综合积分: 68 分
注册时间: 2011-06-25
最后登录: 2012-04-20
3楼  发表于: 2011-06-28 14:30
同样遇到问题了谁知道的帮下