Tool class definition:
#ifndef TOOL_H
#define TOOL_H
#include <QObject>
#include <tool.h>
class Tool
{
// Q_OBJECT
public:
Tool();
Q_INVOKABLE QList<Type*>getStorage();
private:
QList<Type*> typeList;
};
#endif // TOOL_H
#ifndef TOOL_H
#define TOOL_H
#include <QObject>
#include <tool.h>
class Tool
{
// Q_OBJECT
public:
Tool();
Q_INVOKABLE QList<Type*>getStorage();
private:
QList<Type*> typeList;
};
#endif // TOOL_H
To copy to clipboard, switch view to plain text mode
The compiling error occurs at line 9:
view->rootContext()->setContextProperty("UReceivedMessage", new Tool);
#include <QDeclarativeView>
#include <QDeclarativeContext>
int main(int argc, char *argv[])
{
QDeclarativeView *view = new QDeclarativeView();
view->rootContext()->setContextProperty("UReceivedMessage", new Tool);
view
->setSource
(QUrl("qrc:/qml/main.qml"));
view->show();
return a.exec();
}
#include <QDeclarativeView>
#include <QDeclarativeContext>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QDeclarativeView *view = new QDeclarativeView();
view->rootContext()->setContextProperty("UReceivedMessage", new Tool);
view->setSource(QUrl("qrc:/qml/main.qml"));
view->show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks