[Solved] qtc-qmldump - How to use it the right way?



  • Hello,

    I've created a plugin for QML and now I want to add its information to the syntax highlighter.

    "This bug entry":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3289 says Qt Creator will try to automatically execute qtc-qmldump when adding importPaths in the .qmlproject file - for me, this doesn't work.

    So I tried to run it manually. Where ever I execute it, "qmldump" or "qmldump . org.maemo.Packaging", it always results in the same messages:
    @QDeclarativeComponent: Component is not ready
    Could not create "PathPercent" : "xxx:3 module "org.maemo.Packaging" is not installed"
    QDeclarativeComponent: Component is not ready
    Could not create "Repeater" : "xxx:3 module "org.maemo.Packaging" is not installed"@

    The plugin works well in qmlviewer (both debug and release).

    Anyone got a hint for me?



  • Ok, I solved this now.

    Solution (for QtSDK 1.1):

    • Use Qt Creator 2.2 RC
    • Rebuild the "<qtcreator>/share/qtcreator/qml/qmldump" tool (on Windows - Linux may use a different directory)
      ** Copy private headers from "<qtsdk>/QtSources/4.7.3"
      ** Copy the generated binary to "<qtsdk>/Desktop/Qt/4.7.3/msvc2008/qtc-qmldump/debug"

    From now on you can enjoy code completion for your own (c++) components and even use them in the designer :)



  • Hi, could you please elaborate on Copy private headers from “<qtsdk>/QtSources/4.7.3” ?

    Should Icopy the entire folder to <QtSDK>\qtcreator\share\qtcreator\qml\qmldump ? Can't I use

    qmake "QT-PRIVATE-HEADERS=<QtSDK>/QtSources/4.7.3" ?

    Both approaches haven't worked for me



  • You don't need to copy all private headers. Just a few. The qmldump.pro has no references for QT_PRIVATE_HEADERS, so the second approach won't work.

    I've packaged the headers for you "here":http://gri.not-censored.com/qmldump_private_headers.zip. Extract these directories into to directory where qmldump.pro is and you'll be fine.



  • It worked! Thanks

    I'm a bit newbie at this, but where did you get these files? My QtSDK has all these files, but in different folders. Do I have to build Qt to get that folder structure?

    qobject_p.h is in src\corelib\kernel , for instance
    src\declarative\qml its in qdeclarativemetatype_p.h



  • I mean, build with the -developer-bulild flag. It seems that it's the only way



  • If you try to build the "<qtsdk>/QtSources/4.7.3", it executes "syncqt" (in the bin-dir). This creates the include folder and its contents. To save space on my disk I just did the same as syncqt does by hand only with the required headers to build qmldump.



  • Didn't know that. Thanks again!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.