Well I've created my own qmlproject with my own qmldir and C++ extenstion (No longer using the build in example - Charts). I have had some good progress I don't know (or think) downloading Qt Creator 2.1 has helped, but I'm no longer getting the "Package not found" error message. However, a little problem remaining now is how to get Creator to recognise my types exported from C++.
Here's the code to my little test:
.qmlproject file:
/* File generated by QtCreator */
import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
importPaths: [ "../plugin" ]
}
/* File generated by QtCreator */
import QmlProject 1.0
Project {
/* Include .qml, .js, and image files from current directory and subdirectories */
QmlFiles {
directory: "."
}
JavaScriptFiles {
directory: "."
}
ImageFiles {
directory: "."
}
/* List of plugin directories passed to QML runtime */
importPaths: [ "../plugin" ]
}
To copy to clipboard, switch view to plain text mode
.qml file:
import Qt 4.7
import "plugin"
Rectangle {
width: 200
height: 200
Text {
x: 66
y: 93
text: "Hello World"
}
MyItem{
id: testObj
}
}
import Qt 4.7
import "plugin"
Rectangle {
width: 200
height: 200
Text {
x: 66
y: 93
text: "Hello World"
}
MyItem{
id: testObj
}
}
To copy to clipboard, switch view to plain text mode
qmldir file:
plugin plugin
plugin plugin
To copy to clipboard, switch view to plain text mode
Importing "plugin" is a folder I have used to contain the plugin I have built from C++. It contains the dll and relevent files for the plugin. Not sure how to get Creator to recognise the "Types" from this plugin though?
Bookmarks