Hello experts.
This is my project. It's a Symbian project:
.PRO:
folder_01.source = qml/GCleaner
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
symbian:TARGET.CAPABILITY += NetworkServices
CONFIG += qt
CONFIG += qt-components
SOURCES += main.cpp
QT += declarative
files.sources += main.qml
DEPLOYMENT += files
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()
folder_01.source = qml/GCleaner
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
symbian:TARGET.CAPABILITY += NetworkServices
CONFIG += qt
CONFIG += qt-components
SOURCES += main.cpp
QT += declarative
files.sources += main.qml
DEPLOYMENT += files
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()
To copy to clipboard, switch view to plain text mode
CPP:
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QObject>
#include <QApplication>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QDir>
#include <QFile>
void deleteDir(const std::string& foldername)
{
dir.rmdir(foldername.c_str());
}
Q_OBJECT
public:
Q_INVOKABLE void delete() {
deleteDir(c:/temp)
};
int main(int argc, char *argv[])
{
Clean clean;
QDeclarativeView view;
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
view.rootContext()->setContextProperty("Clean", &clean);
view.
setSource(QUrl("./main.qml"));
return app.exec();
}
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QObject>
#include <QApplication>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QDir>
#include <QFile>
void deleteDir(const std::string& foldername)
{
QDir dir;
dir.rmdir(foldername.c_str());
}
class Clean : public QObject {
Q_OBJECT
public:
Clean(QObject *parent = 0);
Q_INVOKABLE void delete() {
deleteDir(c:/temp)
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Clean clean;
QDeclarativeView view;
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
view.rootContext()->setContextProperty("Clean", &clean);
view.setSource(QUrl("./main.qml"));
return app.exec();
}
To copy to clipboard, switch view to plain text mode
QML:
import QtQuick 1.1
import com.nokia.symbian 1.1
Window {
id: window
Button {
id:button
onClicked: Clean.delete
} }
import QtQuick 1.1
import com.nokia.symbian 1.1
Window {
id: window
Button {
id:button
onClicked: Clean.delete
} }
To copy to clipboard, switch view to plain text mode
It tells me that "undefined reference to `Clean::Clean(QObject*)' " and "undefined reference for `vtable for Clean'
I'm building this app for Symbian and I'm stuck at that. Please help me out.
My best regards,
George Dao.
Bookmarks