首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

继承QDeclarativeListView的小程序为什么编译不通过呢?该如何处理

2012-03-05 
继承QDeclarativeListView的小程序为什么编译不通过呢?.pro文件:C/C++ codeQT+ core gui declarativeTARG

继承QDeclarativeListView的小程序为什么编译不通过呢?
.pro文件:

C/C++ code
QT       += core gui declarativeTARGET = extendedlistviewTEMPLATE = appSOURCES += main.cpp\        extendedlistview.cppHEADERS  += extendedlistview.h


extendedlistview.h文件:
C/C++ code
#include <QtDeclarative>#include "private/qdeclarativelistview_p.h"class ExtendedListView : public QDeclarativeListView{    Q_OBJECTpublic:    ExtendedListView(QDeclarativeListView *parent = 0);    ~ExtendedListView();};


extendedlistview.cpp文件:
C/C++ code
#include "extendedlistview.h"ExtendedListView::ExtendedListView(QDeclarativeListView *parent)    : QDeclarativeListView(parent){}ExtendedListView::~ExtendedListView(){}


main.cpp文件:
C/C++ code
#include <QtGui/QApplication>#include "extendedlistview.h"int main(int argc, char *argv[]){    QApplication a(argc, argv);    ExtendedListView w;    w.show();    return a.exec();}


提示错误:
undefined reference to 'QDeclarativeListView::QDeclarativeListView(QDeclarativeItem*)'
undefined reference to 'QDeclarativeListView::~QDeclarativeListView()'
...

是不是找不到QDeclarativeListView所在的库文件?怎么解决呢?







[解决办法]
QDeclarativeListView is NOT a public interface of Qt!

热点排行