PDA

View Full Version : my qml problem



vinayaka
27th May 2011, 06:40
can any one tell me whats wrong with it

firstqml.qml


import QtQuick 1.0

Rectangle {
width: 100
height: 62

color: backgroundColor

Text {
anchors.centerIn: parent
text: "Hello Yellow World!"
}


}




firstqml.cpp


#include "firstqml.h"
#include "ui_firstqml.h"
#include <QtDeclarative/QDeclarativeView>

firstqml::firstqml(QWidget *parent) :
QWidget(parent),
ui(new Ui::firstqml)
{
ui->setupUi(this);
QDeclarativeView *qView=new QDeclarativeView(ui->myframe);
qView->setSource(QString("firstqml.qml"));

}

firstqml::~firstqml()
{
delete ui;
}




as usual my code shows errors.

wysota
27th May 2011, 07:13
What errors does it show?

vinayaka
27th May 2011, 07:31
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::crying::crying::crying

wysota
27th May 2011, 07:42
Looks like you didn't enable the declarative module in your .pro file.

vinayaka
27th May 2011, 09:17
thanxxxxxxxxxx wysota i got it...............:cool:

Added after 1 18 minutes:

the pgm ran but the o/p shows only a white small rectangular box. can you plz tell me?

vinayaka
27th May 2011, 11:16
thanx at last i got it:cool: without error