I didn’t have time to program today, I had to attend to some issues that’s been piling up. So, basically what I did today was part of what I’m going to do in the application I’m building. Now that I got most of the puzzle complete I have to sit down and do some design decisions in the application on how I’m going to lay everything out:

  • Communication between objects
  • How to ensure responsiveness on different displays.
  • How to organize QML files, which is by far the hardest since I’m not that familiar with QML. There seems to be no standard way to organize the files you create.

Anyway, this is what I did today:


<br />
import QtQuick 2.0<br />
import QtQuick.Controls 1.2<br />
import QtQuick.Dialogs 1.2</p>
<p>StackView {</p>
<p>    id: stack<br />
    initialItem: redview</p>
<p>    Component {<br />
        id: redview<br />
        Rectangle {<br />
            id: reddy<br />
            width: parent.width<br />
            height: parent.height<br />
            color: &quot;red&quot;<br />
            border.color: &quot;black&quot;<br />
            border.width: 3</p>
<p>            Text {<br />
                id: blah<br />
                color: &quot;white&quot;<br />
                anchors.centerIn: parent</p>
<p>                text: qsTr(&quot;Jump to [lightblue view]&quot;)</p>
<p>            }<br />
               MouseArea {<br />
                    anchors.fill: parent<br />
                    onClicked: stack.push(lightblueview)<br />
<p>        }</p>
<p>    }</p>
<p>    Component {<br />
        id: lightblueview</p>
<p>        Rectangle {<br />
            id: bloo<br />
            width: 400<br />
            height: 500<br />
            color: &quot;lightblue&quot;<br />
            Text {<br />
                id: blah<br />
                color: &quot;white&quot;</p>
<p>                anchors.centerIn: parent<br />
                text: qsTr(&quot;Jump to [red view]&quot;)<br />
            }<br />
            MouseArea {<br />
                anchors.fill: parent<br />
                onClicked: stack.push(redview)<br />
            }<br />
        }<br />
<p>}<br />

StackView isn’t that bad to use. It’s incredibly easy and the more I read it seems that I’m going to have a good time using it. Hopefully things will work out on my end.

I think QMLs only difficulty right now is actually knowing the all the attributes, members of each QtQuick control, dialog, UI element. I feel it’s really overwhelming.

Before you comment

  • You can use Markdown in your comments, here's a guide.
  • Keep things civil.
  • That means don't do personal attacks.
  • Profanity is highly discouraged.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.