Results 1 to 10 of 10

Thread: Problems with QtQuick wizard generated project

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problems with QtQuick wizard generated project

    Lets try with a very simple example

    main.cpp
    Qt Code:
    1. #include <QtQml>
    2.  
    3. int main(int argc, char **argv)
    4. {
    5. QCoreApplication app(argc, argv);
    6.  
    7. qmlRegisterType<QTimer>("APP_CHILD", 1, 0, "AppChild");
    8.  
    9. QQmlEngine engine;
    10.  
    11. QQmlComponent component(&engine);
    12. component.setData("import APP_CHILD 1.0\n\nAppChild { }", QUrl());
    13. qDebug() << "created object=" << component.create();
    14.  
    15. return 0;
    16. }
    To copy to clipboard, switch view to plain text mode 

    appchildtest.pro
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = appchildtest
    3. INCLUDEPATH += .
    4.  
    5. # Input
    6. SOURCES += main.cpp
    7.  
    8. QT += qml
    To copy to clipboard, switch view to plain text mode 

    Executing that should give you an output like this:

    created object= QTimer(0xc2b250)

    Once you've veryfied that, add you class and register it instead of QTimer.

    Cheers,
    _

  2. #2
    Join Date
    Feb 2014
    Posts
    14
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problems with QtQuick wizard generated project

    Your example works perfectly, this makes me think there's some problem in the way I've attached the main.qml file in my project. But that was done automatically by the Qt Quick wizard for projects creation. This thing is making me crazy!!!

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problems with QtQuick wizard generated project

    Have you tried running the program from a terminal/shell?

    Just to make sure you are actually running the program, not just "running" the QML file.

    Cheers,
    _

Similar Threads

  1. How to create a QtQuick 1 Application project?
    By TheIndependentAquarius in forum Qt Tools
    Replies: 1
    Last Post: 23rd October 2013, 11:02
  2. MSVC Project generated using qmake - turn off flat structure
    By Piskvorkar in forum Qt Programming
    Replies: 3
    Last Post: 4th February 2013, 23:25
  3. Replies: 1
    Last Post: 29th September 2011, 11:14
  4. visualize qtQuick project
    By amadanes in forum Newbie
    Replies: 1
    Last Post: 8th May 2011, 23:15
  5. Qt Creator Crossplatform project wizard
    By lunarcloud in forum Qt Tools
    Replies: 0
    Last Post: 11th April 2011, 07:43

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
  •  
Qt is a trademark of The Qt Company.