Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33

Thread: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #22
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default 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.

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    Quote Originally Posted by kona_echinofu View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #24
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    Quote Originally Posted by wysota View Post
    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

  5. #25
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #26
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    Quote Originally Posted by wysota View Post
    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

  7. #27
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default 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:
    Qt Code:
    1. /* File generated by QtCreator */
    2.  
    3. import QmlProject 1.0
    4.  
    5. Project {
    6. /* Include .qml, .js, and image files from current directory and subdirectories */
    7. QmlFiles {
    8. directory: "."
    9. }
    10. JavaScriptFiles {
    11. directory: "."
    12. }
    13. ImageFiles {
    14. directory: "."
    15. }
    16. /* List of plugin directories passed to QML runtime */
    17. importPaths: [ "../plugin" ]
    18. }
    To copy to clipboard, switch view to plain text mode 
    .qml file:
    Qt Code:
    1. import Qt 4.7
    2. import "plugin"
    3.  
    4. Rectangle {
    5. width: 200
    6. height: 200
    7. Text {
    8. x: 66
    9. y: 93
    10. text: "Hello World"
    11. }
    12. MyItem{
    13. id: testObj
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 

    qmldir file:
    Qt Code:
    1. 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?
    Last edited by kona_echinofu; 9th November 2010 at 01:32. Reason: Additional Information

  8. #28
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #29
    Join Date
    Oct 2010
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    Quote Originally Posted by wysota View Post
    By "recognize" you mean syntax highlighting or code execution?
    I mean syntax highlighting. The application will run, just Creator won't recognise "MyItem".

    Also, please post the code of your plugin.
    Please find attached a ZIP of all files
    Attached Files Attached Files

  10. #30
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    I has same bug
    Thats minimal example creatorbug.zip

    1. Build myitem/myitem.pro plugin as release
    2. Open face/face.qmlproject
    3. Open face/face.qml in editor mode and run it - all works fine in qmlviewer
    4. Swith to design mode - can't load MyItem module

  11. #31
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default 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

  12. #32
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt 4.7 QML/C++ Error : "Package not found" and "Module foobar is not installed"

    Quote Originally Posted by jonathanz View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #33
    Join Date
    Aug 2012
    Posts
    6
    Qt products
    Qt4
    Platforms
    Maemo/MeeGo

    Default 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?

Similar Threads

  1. Replies: 11
    Last Post: 30th March 2015, 07:03
  2. Replies: 21
    Last Post: 20th October 2010, 14:25
  3. "Treat wchar_t as Built-in Type" to "yes" link error
    By sungaoyong in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 12:45
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.