Results 1 to 6 of 6

Thread: QML C++ extension, qml project can not find a type

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    May 2011
    Posts
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QML C++ extension, qml project can not find a type

    1.
    ldd reports failure in locating my library file as well
    ...Plugin is loaded dynamically, because of this the linker will not find it.

    You have placed your plugin in the default "Import-Path". Perhaps it is not necessary to set the Plugin-Path inside your application. If your application starts, it will be ok, otherwise I would add the PluginPath, like this:

    Qt Code:
    1. QDeclarativeEngine::addPluginPath
    To copy to clipboard, switch view to plain text mode 
    Perhaps in your case:
    Qt Code:
    1. viewer.engine()->addPluginPath()
    To copy to clipboard, switch view to plain text mode 


    2.
    QtCreator can't locate the package, ....It looks like on the image I attached.
    I think, you can use your Plugin, you can use your classes, but QtCreator does not know them. Because of this they are underlined.

    a.) Look at your qmldir-file. It should mean:
    "plugin XMLWriter 1.0"

    b.) The following was written inside of the QtCreator-Doc:
    Ideally, QML modules have a plugins.qmltypes file in the same directory as the qmldir file. The qmltypes file contains a description of the components exported by the module's plugins and is loaded by Qt Creator when the module is imported.
    What i have done:
    1.) I compiled the prog in qtcreator-2.3.0\share\qtcreator\qml\qmldump
    2.) I called .\release\qmldump by the follwing arguments - perhaps in your case:
    Qt Code:
    1. ./qmldump KornicameisterQML.XMLParser 1.0 /usr/lib/qt4/imports > /usr/lib/qt4/imports/KornicameisterQML/XMLParser/plugins.qmltypes
    To copy to clipboard, switch view to plain text mode 
    3.) Important: the file has to be known as "plugins.qmltypes". If you take another name, it will fail. If you know why, post it
    4.) Important: After this, if you will design an element inside of the QMLDesigner, QtCreator will always say "Package not found". This is, because he uses his own "Import-Path" located in "qtcreator-2.3.0\bin\". Place a "qt.conf" in qtcreator-2.3.0\bin with the following lines:
    Qt Code:
    1. [Paths]
    2. Imports = /usr/lib/qt4/imports
    To copy to clipboard, switch view to plain text mode 


    Perhaps this will help...
    Good luck


    Added after 11 minutes:


    @wysota
    Isn't it an issue with your package and Qt Creator being built using different compilers?
    I think this occures only under Windows with msvc2008, mingw and if you create a Style-Plugin for integrating your components in QMLDesigner, like "customstyleplugin" and "Qt.labs.components.custom". Isn't it?
    Last edited by SamFredericks; 12th September 2011 at 09:50.

  2. The following user says thank you to SamFredericks for this useful post:

    kornicameister (18th September 2011)

Similar Threads

  1. How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???
    By Gokulnathvc in forum General Programming
    Replies: 19
    Last Post: 7th April 2011, 11:18
  2. Replies: 0
    Last Post: 17th December 2010, 08:50
  3. using qmotif extension
    By pascasio in forum Newbie
    Replies: 7
    Last Post: 30th November 2010, 13:53
  4. Using Qt with kernel extension dll
    By ramazangirgin in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2008, 13:23
  5. Replies: 17
    Last Post: 31st March 2006, 05:57

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.