Commit 5b9d0de2 authored by Fabien Freling's avatar Fabien Freling

Add skeleton for bg maps window

parent 161f5681
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
}
}
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 ...@@ -3,6 +3,7 @@ import QtQuick.Controls 1.4
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
ApplicationWindow { ApplicationWindow {
id: root
visible: true visible: true
width: 256 width: 256
height: 128 height: 128
...@@ -25,7 +26,12 @@ ApplicationWindow { ...@@ -25,7 +26,12 @@ ApplicationWindow {
title: qsTr("View") title: qsTr("View")
MenuItem { MenuItem {
text: qsTr("Background maps") 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 { ...@@ -46,4 +52,5 @@ ApplicationWindow {
messageDialog.open(); messageDialog.open();
} }
} }
} }
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
<qresource prefix="/"> <qresource prefix="/">
<file>main.qml</file> <file>main.qml</file>
<file>MainForm.ui.qml</file> <file>MainForm.ui.qml</file>
<file>BackgroundMap.qml</file>
<file>BackgroundMapForm.ui.qml</file>
</qresource> </qresource>
</RCC> </RCC>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment