summaryrefslogtreecommitdiffstats
path: root/examples/canvas3d/canvas3d/threejs/oneqt/oneqt.qml
blob: 0d51e2bd0a3afdf0714214bd11903de940ba87f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCanvas3D module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
**   * Redistributions of source code must retain the above copyright
**     notice, this list of conditions and the following disclaimer.
**   * Redistributions in binary form must reproduce the above copyright
**     notice, this list of conditions and the following disclaimer in
**     the documentation and/or other materials provided with the
**     distribution.
**   * Neither the name of The Qt Company Ltd nor the names of its
**     contributors may be used to endorse or promote products derived
**     from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/

import QtQuick 2.0
import QtCanvas3D 1.0
import QtQuick.Layouts 1.1

Item {
    id: mainview
    width: 1280
    height: 768
    visible: true
    focus: true

    Keys.onPressed: {
        if (event.key === Qt.Key_1) imageCube.state = 'image1';
        else if (event.key === Qt.Key_2) imageCube.state = 'image2';
        else if (event.key === Qt.Key_3) imageCube.state = 'image3';
        else if (event.key === Qt.Key_4) imageCube.state = 'image4';
        else if (event.key === Qt.Key_5) imageCube.state = 'image5';
        else if (event.key === Qt.Key_6) imageCube.state = 'image6';
    }

    //! [0]
    ImageCube {
        id: imageCube
        width: 512 * (parent.width / 1280)
        height: 512 * (parent.height / 768)
        anchors.bottom: parent.bottom
        anchors.right: parent.right
        //! [0]
        angleOffset: -180 / 8.0
        backgroundColor: "#FCFCFC"
        state: "image6"
        image1: "qrc:/textures/devices.png"
        image2: "qrc:/textures/iot.png"
        image3: "qrc:/textures/embedded.png"
        image4: "qrc:/textures/dataviz.jpg"
        image5: "qrc:/textures/multiscreen.png"
        image6: "qrc:/textures/puzzle-pieces.png"

        onStateChanged: {
            if (imageCube.state == "image1") {
                page1Button.selected = true;
                page2Button.selected = false;
                page3Button.selected = false;
                page4Button.selected = false;
                page5Button.selected = false;
                page6Button.selected = false;
                info1.visible = true;
                info2.visible = false;
                info4.visible = false;
                info3.visible = false;
                info5.visible = false;
                info6.visible = false;
            } else if (imageCube.state == "image2") {
                page1Button.selected = false;
                page2Button.selected = true;
                page3Button.selected = false;
                page4Button.selected = false;
                page5Button.selected = false;
                page6Button.selected = false;
                info1.visible = false;
                info2.visible = true;
                info4.visible = false;
                info3.visible = false;
                info5.visible = false;
                info6.visible = false;
            } else if (imageCube.state == "image3") {
                page1Button.selected = false;
                page2Button.selected = false;
                page3Button.selected = true;
                page4Button.selected = false;
                page5Button.selected = false;
                page6Button.selected = false;
                info1.visible = false;
                info2.visible = false;
                info3.visible = true;
                info4.visible = false;
                info5.visible = false;
                info6.visible = false;
            } else if (imageCube.state == "image4") {
                page1Button.selected = false;
                page2Button.selected = false;
                page3Button.selected = false;
                page4Button.selected = true;
                page5Button.selected = false;
                page6Button.selected = false;
                info1.visible = false;
                info2.visible = false;
                info3.visible = false;
                info4.visible = true;
                info5.visible = false;
                info6.visible = false;
            } else if (imageCube.state == "image5") {
                page1Button.selected = false;
                page2Button.selected = false;
                page3Button.selected = false;
                page4Button.selected = false;
                page5Button.selected = true;
                page6Button.selected = false;
                info1.visible = false;
                info2.visible = false;
                info3.visible = false;
                info4.visible = false;
                info5.visible = true;
                info6.visible = false;
            } else if (imageCube.state == "image6") {
                page1Button.selected = false;
                page2Button.selected = false;
                page3Button.selected = false;
                page4Button.selected = false;
                page5Button.selected = false;
                page6Button.selected = true;
                info1.visible = false;
                info2.visible = false;
                info3.visible = false;
                info4.visible = false;
                info5.visible = false;
                info6.visible = true;
            }
        }
    }

    Rectangle {
        id: menuBar
        anchors.top: parent.top
        width: parent.width
        height: 52
        color: "#ffffff"
        RowLayout {
            spacing: 28

            Image {
                id: qtLogo
                source: "qrc:/textures/qtlogosmall.png"
                Layout.minimumWidth: 133
                Layout.minimumHeight:52
                Layout.preferredWidth: 133
                Layout.preferredHeight: 52
                Layout.maximumWidth: 133
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page1Button
                text: "Device Creation"
                stateTarget: imageCube
                stateSelect: "image1"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page2Button
                text: "IoT"
                stateTarget: imageCube
                stateSelect: "image2"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page3Button
                text: "Rapid Development"
                stateTarget: imageCube
                stateSelect: "image3"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page4Button
                text: "Modern UX"
                stateTarget: imageCube
                stateSelect: "image4"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page5Button
                text: "Cross Platform"
                stateTarget: imageCube
                stateSelect: "image5"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }

            Navibutton {
                id: page6Button
                text: "In the Box"
                stateTarget: imageCube
                stateSelect: "image6"
                Layout.minimumHeight:52
                Layout.preferredHeight: 52
                Layout.maximumHeight: 52
            }
        }
    }

    Rectangle {
        id: separator
        anchors.top: menuBar.bottom
        width: parent.width
        height: 4
        color: "#e6e6e6"
    }

    InfoSheet {
        id: info1
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left
        visible: false
        headingText1: "Easily Create "
        headingText2: "Powerful & Connected Devices"
        text: "We believe modern embedded development must include a cross-platform user<br>"+
              "experience and that your tech strategy should be based on easy creation of<br>"+
              "connected devices and UIs that run anywhere on any embedded platform including<br>"+
              "RTOS – making your and your end users’ life easier. With Qt, you can do this and<br>"+
              "more."
    }

    InfoSheet {
        id: info2
        visible: false
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left
        headingText1: "Write & Recycle "
        headingText2: "Internet of Things"
        text: "A key focus for us is to help you get your embedded device to market quickly. You<br>"+
              "can write and recycle Qt application and device UI code to run on all your target<br>"+
              "devices. You can take your applications everywhere: embedded, desktop and mobile<br>"+
              "platforms. Qt lets you future-proof your “things” by making them platform<br>"+
              "independent. Should you want diversity between platforms, like a responsive UI<br>"+
              "design for different screen sizes, this is simple to implement with Qt, as well."

    }

    InfoSheet {
        id: info3
        visible: false
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left

        headingText1: "Rapid Embedded "
        headingText2: "Prototyping & Deployment"

        text: "We don’t want you wasting hundreds of man hours just setting up your embedded<br>"+
              "toolchains. Prototyping on a real device can start immediately upon installation with<br>"+
              "our fully pre-configured software stack, Boot to Qt. We provide full embedded<br>"+
              "tooling for direct device deployment, on-device debugging and profiling, and the<br>"+
              "needed tools to customize your stack."
    }

    InfoSheet {
        id: info4
        visible: false
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left

        headingText1: "Modern UX with "
        headingText2: "Top Performance"
        text: "Your productivity is at the core of what drives us. We made creating embedded<br>"+
              "devices agile and painless without sacrificing maximum native performance. You get<br>"+
              "to write your application using high level C++ libraries with no need to worry about<br>"+
              "nasty platform details. Using Qt Creator IDE and with a variety of UI approaches to<br>"+
              "choose from you can create the optimal UX for your end users."
    }

    InfoSheet {
        id: info5
        visible: false
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left

        headingText1: "Cross-platform "
        headingText2: "is Our Specialty"
        text: "We make cross-platform application development easy. Target all the screens in your<br>"+
              "end users’ lives. You only need to write and maintain one code base regardless of<br>"+
              "what kind of and how many target platforms you might have and we’re talking about<br>"+
              "all major operating systems here. No need for separate implementations for<br>"+
              "different user devices. Qt makes your time-to-market faster, technology strategy<br>"+
              "simpler and future-proof, consequently reducing costs."
    }

    InfoSheet {
        id: info6
        visible: false
        width: parent.width
        anchors.top: separator.bottom
        anchors.left: parent.left

        headingText1: "What’s in the Box "
        headingText2: "Everything You Need"
        text: "Qt combines functionality with productivity. You can amaze your users with stunning<br>"+
              "UIs and native performance by developing your desktop and multiscreen<br>"+
              "applications with Qt.<br>"+
              "<ul>"+
              "<li>C++ library classes – comprehensive, highly intuitive, and modularized</li>"+
              "<li>Declarative programming technology – exquisite UI design with Qt Quick</li>"+
              "<li>Tooling – productive and professional development with Qt Creator IDE</li>"+
              "</ul><br>"+
              "Qt saves you development time, adds efficiency and ultimately shortens your<br>"+
              "time-to-market."
    }
}