نوشته شده توسط
ravand
نسخه اش 5.5 هست.
این رو تست کنید :
فایل main :
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.4
Window {
visible: true
id:mywindow
width: 640
height: 480
Button {
width: 50
height: 27
text: qsTr("کلیک کنید")
anchors.centerIn: parent
onClicked: {
var component = Qt.createComponent("qrc:/azmayesh.qml")
var window = component.createObject(mywindow)
window.show()
}
}
}
فایل فرم دوم:
import QtQuick 2.0
import QtQuick.Window 2.0
Window {
visible: true
width: 360
height: 360
title: "MyWindow"
Text {
text: "Hello world!"
anchors.centerIn: parent
}
}
مسیر فایل رو هم مشخص کنید.