Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Meet problem when I inherit a class from QDeclarativeListView
Forum Updated to NodeBB v4.3 + New Features

Meet problem when I inherit a class from QDeclarativeListView

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nan3113
    wrote on last edited by
    #1

    .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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved