#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.setMainQmlFile(QLatin1String("qml/helloworld/main.qml"));
viewer.showExpanded();
return app.exec();
}
import QtQuick 1.0
Rectangle {
width: 360
height: 360
Text {
text: "Hello World"
anchors.centerIn: parent
}
MouseArea {
x: 0
y: 0
anchors.rightMargin: 0
anchors.bottomMargin: 0
anchors.leftMargin: 0
anchors.topMargin: 0
anchors.fill: parent
onClicked: {
Qt.quit();
}
Image {
id: image1
x: 388
y: 462
width: 100
height: 100
source: "../../../bak-demo-5 (9.20)/www/pic/1.jpg"
}
Text {
id: text1
x: 86
y: 246
width: 300
text: "This is JiangNan first Qt project!!"
font.pixelSize: 12
}
}
BorderImage {
id: border_image1
x: 119
y: 56
width: 51
height: 51
source: "../../../../../media/Now/desktop/psd/logo.png"
}
}
Qt
最新推荐文章于 2024-11-09 22:52:04 发布