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.
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.