Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
/me slaps his head
This is an example of extending QML, it doesn't involve Qt Creator in any way. Please understand Qt is not limited to Qt Creator. The example is perfectly valid if you use say... Notepad which doesn't understand qmldir, qmlproject or qml plugin files.
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Thanks for clarifying that. I am new to QML and what may seem simple is new to me. Also I have only been using Qt for a short time. Afterall if we didn't ask questions we wouldn't get answers. I'm going to keep trying and will post my results.
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Quote:
Originally Posted by
kona_echinofu
Afterall if we didn't ask questions we wouldn't get answers.
It's good to do some reading before you start asking questions. You can't always rely somebody will do the research for you.
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Quote:
Originally Posted by
wysota
It's good to do some reading before you start asking questions. You can't always rely somebody will do the research for you.
This is true, but I wasn't looking for a straight answer to my problem, but rather some guidelines to what direction I should be heading to solve this problem. Which, you have provided me with, so thank you.
As stated before, I will take into consideration what I have learnt here, try again, and post my findings :)
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
The directions were provided in post #4 so what the remaining 20 posts are all about?
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Quote:
Originally Posted by
wysota
The directions were provided in post #4 so what the remaining 20 posts are all about?
Read them. Its a discussion, Bruce and Jonathan got involved :)
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
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:
Code:
/* 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" ]
}
.qml file:
Code:
import Qt 4.7
import "plugin"
Rectangle {
width: 200
height: 200
Text {
x: 66
y: 93
text: "Hello World"
}
MyItem{
id: testObj
}
}
qmldir file:
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?
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
By "recognize" you mean syntax highlighting or code execution? Also, please post the code of your plugin.
1 Attachment(s)
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Quote:
Originally Posted by
wysota
By "recognize" you mean syntax highlighting or code execution?
I mean syntax highlighting. The application will run, just Creator won't recognise "MyItem".
Quote:
Also, please post the code of your plugin.
Please find attached a ZIP of all files :)
1 Attachment(s)
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
I has same bug
Thats minimal example Attachment 5541
- Build myitem/myitem.pro plugin as release
- Open face/face.qmlproject
- Open face/face.qml in editor mode and run it - all works fine in qmlviewer
- Swith to design mode - can't load MyItem module
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Thanks for the long discussions.
Now we should have a common understanding of the original problem: Qt Creator (or other QML editor tools) underlines in red any custom module name (like "import Charts 1.0") and custom QML element name (like "PieChart"). This gives us the false impression that there are syntax errors with these custom items, even though the QML code executes perfectly.
This does not happen with standard module names (like "import Qt 4.7") and standard QML element names (like "Rectangle").
So our request is: Do not underline custom module names and custom QML element names in red! Treat them the same as standard ones.
Maybe there is a Qt resource file (a .xml file, for example) that we don't know but where we can tell Qt Creator (or any other QML editor tools) that these are custom items?
Treating custom items the same as standard ones will encourage more developers to transition to QML.
- Jonathan
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
Quote:
Originally Posted by
jonathanz
Maybe there is a Qt resource file (a .xml file, for example) that we don't know but where we can tell Qt Creator (or any other QML editor tools) that these are custom items?
There is no resource file, there is a plugin infrastructure and qmldir facility you need to use. It's a situation similar to using custom widgets in Designer. Feel free to extend Qt Creator with the capabilities of your choice, after all it is open source.
Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"
I have a problem similar to this. I have a qt C++ qt plugin that works just fine if I build for the device the import statement in my qml application does not throw an error because the importPathList variable set in main.cpp point to where the plugin would be found when on the target device.
In qt creator "import plugin 1.0" is underlined as not found but building for target does cause any run-time errors.
However when i use QT designer environment it say the plugin is not found probably because environment paths are setup for the device.
I can qmake the plugin without errors. So what is the proper procedure to have QT Designer (or QT creator) to recognize my plug on the PC?
BTW, when i qmake the plugin its is kept here: "proc/19352/cwd/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/opt/plugin.so"
so i gotto add "proc/19352/cwd/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/opt/" to the qt creator path, How do i do that?