Results 1 to 6 of 6

Thread: my qml problem

  1. #1
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default my qml problem

    can any one tell me whats wrong with it

    firstqml.qml
    Qt Code:
    1. import QtQuick 1.0
    2.  
    3. Rectangle {
    4. width: 100
    5. height: 62
    6.  
    7. color: backgroundColor
    8.  
    9. Text {
    10. anchors.centerIn: parent
    11. text: "Hello Yellow World!"
    12. }
    13.  
    14.  
    15. }
    To copy to clipboard, switch view to plain text mode 

    firstqml.cpp
    Qt Code:
    1. #include "firstqml.h"
    2. #include "ui_firstqml.h"
    3. #include <QtDeclarative/QDeclarativeView>
    4.  
    5. firstqml::firstqml(QWidget *parent) :
    6. QWidget(parent),
    7. ui(new Ui::firstqml)
    8. {
    9. ui->setupUi(this);
    10. QDeclarativeView *qView=new QDeclarativeView(ui->myframe);
    11. qView->setSource(QString("firstqml.qml"));
    12.  
    13. }
    14.  
    15. firstqml::~firstqml()
    16. {
    17. delete ui;
    18. }
    To copy to clipboard, switch view to plain text mode 


    as usual my code shows errors.

  2. #2
    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: my qml problem

    What errors does it show?
    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.


  3. #3
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: my qml problem

    D:\QT BOX 1\myqml-build-desktop/../myqml/firstqml.cpp:10: error: undefined reference to `_imp___ZN16QDeclarativeViewC1EP7QWidget'

    D:\QT BOX 1\myqml-build-desktop/../myqml/firstqml.cpp:11: error: undefined reference to `_imp___ZN16QDeclarativeView9setSourceERK4QUrl'


    D:\QT BOX 1\myqml-build-desktop/../myqml/firstqml.cpp:10: error: undefined reference to `_imp___ZN16QDeclarativeViewC1EP7QWidget'

    D:\QT BOX 1\myqml-build-desktop/../myqml/firstqml.cpp:11: error: undefined reference to `_imp___ZN16QDeclarativeView9setSourceERK4QUrl'

    :-1: error: collect2: ld returned 1 exit status




    :crying

  4. #4
    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: my qml problem

    Looks like you didn't enable the declarative module in your .pro 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.


  5. The following user says thank you to wysota for this useful post:

    vinayaka (27th May 2011)

  6. #5
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: my qml problem

    thanxxxxxxxxxx wysota i got it...............


    Added after 1 18 minutes:


    the pgm ran but the o/p shows only a white small rectangular box. can you plz tell me?
    Last edited by vinayaka; 27th May 2011 at 09:17.

  7. #6
    Join Date
    May 2011
    Posts
    120
    Thanks
    33
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: my qml problem

    thanx at last i got it without error
    Last edited by vinayaka; 27th May 2011 at 11:17. Reason: updated contents

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.