Add skeleton for bg maps window
This commit is contained in:
parent
161f5681ee
commit
5b9d0de26f
19
qt/BackgroundMap.qml
Normal file
19
qt/BackgroundMap.qml
Normal file
|
@ -0,0 +1,19 @@
|
|||
import QtQuick 2.4
|
||||
import QtQuick.Window 2.0
|
||||
|
||||
Window {
|
||||
title: "Background maps"
|
||||
// A background map is 32 x 32 tiles.
|
||||
// Each tile is 8 x 8 pixels.
|
||||
width: 256
|
||||
height: 256
|
||||
maximumWidth: width
|
||||
minimumWidth: width
|
||||
maximumHeight: height
|
||||
minimumHeight: height
|
||||
|
||||
BackgroundMapForm {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
}
|
33
qt/BackgroundMapForm.ui.qml
Normal file
33
qt/BackgroundMapForm.ui.qml
Normal file
|
@ -0,0 +1,33 @@
|
|||
import QtQuick 2.4
|
||||
|
||||
Item {
|
||||
width: 400
|
||||
height: 400
|
||||
|
||||
Grid {
|
||||
id: grid1
|
||||
x: 0
|
||||
y: 0
|
||||
width: 256
|
||||
height: 256
|
||||
rows: 32
|
||||
columns: 32
|
||||
|
||||
Rectangle {
|
||||
id: rectangle1
|
||||
width: 200
|
||||
height: 200
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "#ffffff"
|
||||
}
|
||||
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: "#000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ import QtQuick.Controls 1.4
|
|||
import QtQuick.Dialogs 1.2
|
||||
|
||||
ApplicationWindow {
|
||||
id: root
|
||||
visible: true
|
||||
width: 256
|
||||
height: 128
|
||||
|
@ -25,7 +26,12 @@ ApplicationWindow {
|
|||
title: qsTr("View")
|
||||
MenuItem {
|
||||
text: qsTr("Background maps")
|
||||
onTriggered: console.log("Background maps");
|
||||
onTriggered: {
|
||||
console.log("Background maps");
|
||||
var component = Qt.createComponent("BackgroundMap.qml")
|
||||
var bgMap = component.createObject(root)
|
||||
bgMap.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,4 +52,5 @@ ApplicationWindow {
|
|||
messageDialog.open();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,5 +2,7 @@
|
|||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
<file>MainForm.ui.qml</file>
|
||||
<file>BackgroundMap.qml</file>
|
||||
<file>BackgroundMapForm.ui.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in a new issue