Meet problem when I inherit a class from QDeclarativeListView



  • .pro file:
    @
    QT += core gui declarative

    TARGET = extendedlistview
    TEMPLATE = app

    SOURCES += main.cpp
    extendedlistview.cpp

    HEADERS += extendedlistview.h

    @

    extendedlistview.h file:

    @
    #include <QtDeclarative>
    #include "private/qdeclarativelistview_p.h"

    class ExtendedListView : public QDeclarativeListView
    {
    Q_OBJECT

    public:
    ExtendedListView(QDeclarativeListView *parent = 0);
    ~ExtendedListView();
    };

    @

    extendedlistview.cpp file:
    @
    #include "extendedlistview.h"

    ExtendedListView::ExtendedListView(QDeclarativeListView *parent)
    : QDeclarativeListView(parent)
    {
    }

    ExtendedListView::~ExtendedListView()
    {

    }

    @

    main.cpp file:
    @
    #include <QtGui/QApplication>
    #include "extendedlistview.h"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    ExtendedListView w;
    w.show();

    return a.exec&#40;&#41;;
    

    }

    @

    build errors:
    undefined reference to 'QDeclarativeListView::QDeclarativeListView(QDeclarativeItem*)'
    undefined reference to 'QDeclarativeListView::~QDeclarativeListView()'
    ...errors like these

    Does it can't find library in which QDeclarativeListView class lies? how can I solve it?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.