Hello friends,
I am a little bit confused about the structure of an qml app.
How can I export QObject to my app written in qml:
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import QtQuick.Window 2.0
ApplicationWindow {
width: 640
height: 480
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
statusBar: StatusBar{
Text{
anchors.centerIn: parent
text: "Ready"
font.family: "Verdana"
}
}
}
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import QtQuick.Window 2.0
ApplicationWindow {
width: 640
height: 480
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
statusBar: StatusBar{
Text{
anchors.centerIn: parent
text: "Ready"
font.family: "Verdana"
}
}
}
To copy to clipboard, switch view to plain text mode
The Problem is I cannot imagine how to register my new qobject type without a main.cpp!
Could anybody provide an example project with exporting new c++ types to an app written with
ApplicationWindow {}
ApplicationWindow {}
To copy to clipboard, switch view to plain text mode
Yours,
Bookmarks