You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, March 18th 2015, 7:32pm

Error static meta object is not a member of QStandardItem

hi guys
i have been stuck at a problem
this is my c++ file

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "webpagedata.h"

webpagedata::webpagedata(QStandardItem *parent) :
   QStandardItem()
{

}
void webpagedata::setdata(QString url, QString title, QString website)
{
    insertRow(0 ,new QStandardItem(url));
    insertRow(0 , new QStandardItem(title));
    insertRow(0 , new QStandardItem(website));
}
]

the problem is in defining the webpage data class
here is the header file

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef WEBPAGEDATA_H
#define WEBPAGEDATA_H

#include <QStandardItem>
class webpagedata : public QStandardItem
{
    Q_OBJECT
public:
    explicit webpagedata(QStandardItem *parent = 0);
    void setdata(QString url, QString title, QString website);
signals:

public slots:

};

#endif // WEBPAGEDATA_H

the error:

Source code

1
2
3
/home/shubham/build-datamanager-Desktop-Debug/moc_webpagedata.cpp:63: error: 'staticMetaObject' is not a member of 'QStandardItem'
     { &QStandardItem::staticMetaObject, qt_meta_stringdata_webpagedata.data,
        ^