• 10963阅读
  • 0回复

[提问]错误: 对不完全的类型‘struct QStatusBar’的非法使用 [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 楼主  发表于: 2012-03-18
ubuntu 11.10   +  4.4.3编译器

ui_mainwindow.h: 在成员函数‘void Ui_MainWindow::setupUi(QMainWindow*)’中:
ui_mainwindow.h:81:42: 错误: 对不完全的类型‘struct QStatusBar’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54:7: 错误: ‘struct QStatusBar’的前向声明
ui_mainwindow.h:82:14: 错误: 对不完全的类型‘struct QStatusBar’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:54:7: 错误: ‘struct QStatusBar’的前向声明
ui_mainwindow.h:83:17: 错误: ‘class QMainWindow’没有名为‘setStatusBar’的成员
ui_mainwindow.h:84:44: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:85:15: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:86:15: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:87:15: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:88:15: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:110:15: 错误: 对不完全的类型‘struct QDockWidget’的非法使用
/witech/builddir/sdk/qtopiacore/target/include/QtGui/qmainwindow.h:51:7: 错误: ‘struct QDockWidget’的前向声明
ui_mainwindow.h:111:17: 错误: ‘class QMainWindow’没有名为‘addDockWidget’的成员
make: *** [mainwindow.o] 错误 1
错误中报的struct QStatusBar,struct QDockWidget都是在designer中设计时带的,在程序中没有他的代码。
文件
mainwindow.cpp

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QSqlDatabase db,QString accountStr,QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->db = db;
    this->accountStr = accountStr;
    connect(ui->chaxunxitong,SIGNAL(clicked()),this,SLOT(chaxunxitong()));
}

void MainWindow::chaxunxitong(){
    chaxunxitong1 = new querysystem(db,accountStr,this);
    setCentralWidget(chaxunxitong1);
}
MainWindow::~MainWindow()
{
    delete ui;
}
头文件
mainwindow.h

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QSqlDatabase>
#include "querysystem.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QSqlDatabase db,QString accountStr,QWidget *parent = 0);
    ~MainWindow();
private slots:
    void chaxunxitong();
private:
    Ui::MainWindow *ui;
    QSqlDatabase db;
    QString accountStr;
    querysystem* chaxunxitong1;
};

#endif // MAINWINDOW_H




有缘相聚在这个论坛
快速回复
限100 字节
 
上一个 下一个