Page 1 of 2 12 LastLast
Results 1 to 20 of 33

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

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

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

    Hey all!

    I've been really excited to get onto the new QML with C++ bandwagon. However, when trying to follow the tutorials (built-in "Charts" example) I've been running into this issue.

    It will not allow me to use Designer for QML, as well as add my own modules/C++ plugins.

    I've wiped Qt, re-installed and even re-built. Still getting the same error.

    I've looked over the internet to find only one guy who experienced the same problem and mentioned QmlObserver being used instead of QmlViewer, but I cannot find any option to change this?

    I have the brand new Qt 4.7 and I've also tried it with the new Qt Creator 2.0.92 (2.1.0 beta 1)

    Here's some images of what I'm seeing:

    In Code Editing View:

    In Designer View:


    Has any body experienced this problem, if so how did you solve it?

    Or are there any Qt experts that could help me out, would be much appreciated as I'm excited to start using QML with C++.

    Thanks in advance.

  2. #2
    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"

    Is anybody else experiencing this, or not?

  3. #3
    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"

    Ok, this gets even more strange.

    I can actually code with C++, create my own types for QML and invokable functions, however. Like in the original pictures they are appearing as invalid in Designer and Code editor... So it is valid at run-time but not whilst coding... What is going on?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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"

    Creator doesn't know anything about your packages and modules so it can't highlight or complete it. You need to write some additional code to make your modules recognizable by Creator.
    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.


  5. #5
    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"

    Hi Wysota,

    Thanks for your reply. Surely, if an example is provided by Qt to view, it should have all code written already. I haven't written this, it came with the Qt package.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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
    Surely, if an example is provided by Qt to view, it should have all code written already.
    It's a coding example, not an example of highlighting qml syntax in Qt Creator which is not the only possible way one might be using Qt. If we try to understand it the way you do, Trolls would have to provide appropriate mechanisms for Visual Studio, Eclipse, KDevelop and all other possible code editors in the world.
    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.


  7. #7
    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 a coding example, not an example of highlighting qml syntax in Qt Creator which is not the only possible way one might be using Qt. If we try to understand it the way you do, Trolls would have to provide appropriate mechanisms for Visual Studio, Eclipse, KDevelop and all other possible code editors in the world.
    I never looked at it that way. Its just frustrating not being able to use c++ with qml designer. Is there anywhere with a tutorial (not the one provided by qt as it doesn't function) or will I have to wait till full release to be able to use qml with c++ with ease?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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
    I never looked at it that way. Its just frustrating not being able to use c++ with qml designer. Is there anywhere with a tutorial (not the one provided by qt as it doesn't function) or will I have to wait till full release to be able to use qml with c++ with ease?
    I have no idea what you mean.
    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. #9
    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"

    I mean setting up Qt 4.7 to allow me to use C++ with QML and QML Designer. At this moment in time, I'm unable to do so as when I create C++ classes and expose them to QML and use them, they work and the application will run, but I cannot use QML Designer as it does not recognise these classes as QML objects and gives me the errors you see in the images.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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
    I mean setting up Qt 4.7 to allow me to use C++ with QML and QML Designer.
    QML and C++ are two different languages. You can't use them "together".

    At this moment in time, I'm unable to do so as when I create C++ classes and expose them to QML and use them, they work and the application will run, but I cannot use QML Designer as it does not recognise these classes as QML objects and gives me the errors you see in the images.
    Did you tell Creator about them by providing an appropriate extension 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.


  11. #11
    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 don't exactly mean together, but more in the sense of extending QML.

    But regarding the PieCharts example, Creator should know about the Charts object through the code "qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");" which is in main.

    From reading the examples and documentation, this should register the Charts Module and PieChart object for use within QML. When I run the application, the Chart appears correctly in the QML embedded within the C++ application.

    However, Creator and Designer itself doesn't recognise it whilst in code/designer view.


    Added after 8 minutes:




    A visual to describe what I mean.
    Last edited by kona_echinofu; 2nd November 2010 at 23:00.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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
    Well I don't exactly mean together, but more in the sense of extending QML.

    But regarding the PieCharts example, Creator should know about the Charts object through the code "qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");" which is in main.
    Creator doesn't execute C++ code nor does it know what elements, its properties and such the "Charts" module might be exporting so putting any C++ statement won't have any effect on it.

    From reading the examples and documentation, this should register the Charts Module and PieChart object for use within QML. When I run the application, the Chart appears correctly in the QML embedded within the C++ application.
    If you start reading something, read until the end, please.

    Chapter 6: Writing an Extension Plugin
    Last edited by wysota; 2nd November 2010 at 23:42.
    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. #13
    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"

    I did indeed read it through. However, Chapter 6 is different from what I'm working with now. In chapter 6, yes a plugin is created for use with a QML application. However, the chapters before that do not use a plugin. As stated in the Chapter 6 documentation
    Currently the PieChart and PieSlice types are used by app.qml, which is displayed using a QDeclarativeView in a C++ application. An alternative way to use our QML extension is to create a plugin library to make it available to the QML engine
    .

    This is what I'm trying to explain, Chapters 1-5 are not QML applications using a C++ plugin, but a C++ application using QDeclarativeView, displaying QML within a C++ application.


    Added after 7 minutes:


    Oh, it seems there is a problem. I have stumbled across this reply from a Nokia software developer.

    So, I guess I will have to wait for a fix.

    http://www.mail-archive.com/qt-qml@t.../msg01207.html
    Last edited by kona_echinofu; 3rd November 2010 at 00:12.

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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"

    Do you have the appropriate plugin at all? It won't work unless you have it, regardless of what Trolls fix in qmlobserver. Just like writing code for a custom widget is not enough to see the widget in Designer - you need an appropriate plugin for that. For QML there are three additional components and subset of them may be required in different situations - a qmlproject file, a qmldir file and a binary 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.


  15. #15
    Join Date
    Nov 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60 Maemo/MeeGo

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

    I'm having a similar frustrating situation. I'm trying to get this example to run as a plugin to a simple QML project:

    http://doc.qt.nokia.com/4.7/declarat...es-adding.html

    I'm using QTCreator 2.0.1 on Mac OS X. I feel as if I am very close. The plugin builds fine. I am thinking that all I need to do is to point the QML project file at the plugin. The plugin project is named "custom" so I've been trying things like this in the QML project 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: [ "/Users/brucecichowlas/custom-build-desktop" ]
    }

    It seems as if this is there for my needs. Am I close? What do I need to do?

    Thanks,
    Bruce

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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"

    Do you have the respective qmldir file?
    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.


  17. #17
    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"

    Hi All,

    I have found the same problem as originally reported. I guess the test example is taken from the Qt 4.7.0 Reference Documentation on extending QML. The original test example does not have a .qmlproj file, so the problem is hidden.

    Note that "app.qml" runs fine and great either within Qt Creator or with "qmlviewer". This is not an issue.

    The real (minor?) issue is that, in Qt Creator's QML editor, both "Charts 1.0" and "PieChart" ARE underlined with a red wave line, which may give us the wrong impression that Qt does not recognize them, although they are actually accepted at runtime.

    This is in contrast with the standard module "Qt 4.7" and standard QML element "Item": They are NOT underlined with a red wave line in Qt Creator's QML editor.

    Is this a bug in Qt Creator 2.0.1? Should we report it to Nokia?

    These are some further details about my setting:

    1. In have created "qmldir" file with a single line like this:
    plugin Charts ../plugins

    2. I have added the following line in "app.qmlproject":
    importPaths: ["../plugins"]

    All these actions are to try to fix the issue by letting Qt Creator know the name and location of the shared library: ../plugins/libCharts.so. But there is no effect.

    Thanks in advance for your reply,

  18. #18
    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 jonathanz View Post
    Hi All,

    I have found the same problem as originally reported. I guess the test example is taken from the Qt 4.7.0 Reference Documentation on extending QML. The original test example does not have a .qmlproj file, so the problem is hidden.

    Note that "app.qml" runs fine and great either within Qt Creator or with "qmlviewer". This is not an issue.

    The real (minor?) issue is that, in Qt Creator's QML editor, both "Charts 1.0" and "PieChart" ARE underlined with a red wave line, which may give us the wrong impression that Qt does not recognize them, although they are actually accepted at runtime.

    This is in contrast with the standard module "Qt 4.7" and standard QML element "Item": They are NOT underlined with a red wave line in Qt Creator's QML editor.

    Is this a bug in Qt Creator 2.0.1? Should we report it to Nokia?

    These are some further details about my setting:

    1. In have created "qmldir" file with a single line like this:
    plugin Charts ../plugins

    2. I have added the following line in "app.qmlproject":
    importPaths: ["../plugins"]

    All these actions are to try to fix the issue by letting Qt Creator know the name and location of the shared library: ../plugins/libCharts.so. But there is no effect.

    Thanks in advance for your reply,
    This is what I've been trying to explain throughout this thread. Its frustrating not being able to use C++ objects with QML Designer!

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 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
    Is this a bug in Qt Creator 2.0.1?
    No, it is not. If it doesn't work then it means your plugin, qmldir or qmlproject file (or all) is incorrect. Actually I can't speak of Creator 2.0.1, I've seen it work in 2.1 but I don't see a reason why this shouldn't work with 2.0.1 as well, the concept of qmldir files was known by the time when 2.0.1 was released.

    People, do me a favour - look for errors in your own doings first before you start blaming others. Only when you have exhausted all possibilities that the problem lies on your side, start speaking of bugs in someone else's code or design and even then double check everything first in case you missed something. In my opinion that's a very good rule when it comes to software development.
    Last edited by wysota; 4th November 2010 at 23:36. Reason: spelling corrections
    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.


  20. #20
    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"

    http://doc.qt.nokia.com/4.7/declarat...es-adding.html
    Hm.. I guess there seems to be confusion on what EXACTLY is needed in order to use C++ objects within QML. As the example itself doesn't contain a qmlproject or qmldir file.

Similar Threads

  1. Replies: 11
    Last Post: 30th March 2015, 06:03
  2. Replies: 21
    Last Post: 20th October 2010, 13: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, 11:45
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15: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.