Merge lp:~dandrader/qtubuntu/noQtSensors-lp1481389 into lp:qtubuntu

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Gerry Boland
Approved revision: 275
Merged at revision: 278
Proposed branch: lp:~dandrader/qtubuntu/noQtSensors-lp1481389
Merge into: lp:qtubuntu
Diff against target: 1165 lines (+23/-925)
22 files modified
debian/control (+0/-6)
debian/copyright (+1/-5)
qtubuntu.pro (+1/-1)
src/ubuntumirclient/input.cpp (+5/-5)
src/ubuntumirclient/integration.cpp (+6/-1)
src/ubuntumirclient/orientationchangeevent_p.h (+4/-3)
src/ubuntumirclient/screen.cpp (+4/-4)
src/ubuntumirclient/ubuntumirclient.pro (+2/-2)
tests/Application.qml (+0/-180)
tests/Fullscreen.qml (+0/-43)
tests/Input.qml (+0/-88)
tests/InputFilter.qml (+0/-71)
tests/Logo.qml (+0/-21)
tests/MovingLogo.qml (+0/-73)
tests/TextInput.qml (+0/-34)
tests/WarpingLogo.qml (+0/-84)
tests/clipboard/clipboard.cc (+0/-61)
tests/clipboard/clipboard.pro (+0/-7)
tests/qmlscene_ubuntu/qmlscene_ubuntu.cc (+0/-178)
tests/qmlscene_ubuntu/qmlscene_ubuntu.h (+0/-36)
tests/qmlscene_ubuntu/qmlscene_ubuntu.pro (+0/-12)
tests/tests.pro (+0/-10)
To merge this branch: bzr merge lp:~dandrader/qtubuntu/noQtSensors-lp1481389
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Gerry Boland (community) Approve
Daniel d'Andrada (community) Approve
Review via email: mp+267198@code.launchpad.net

Commit message

Remove QtSensors dependency

The only thing the Mir plugin used from QtSensors was the enum
QOrientationReading::Orientation.

Description of the change

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Approving as this code is not mine and I reviewed and tested it

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

Please remove libqt5sensors5-dev from debian/control

Also is qtdeclarative5-dev needed?

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
273. By Daniel d'Andrada

Remove unneeded dependencies from debian/control and ancient manual tests

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> Please remove libqt5sensors5-dev from debian/control
>
> Also is qtdeclarative5-dev needed?

Well spotted. Removed them all

Revision history for this message
Gerry Boland (gerboland) wrote :

Minor nitpick:
debian/copyright - remove reference to tests dir.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
274. By Daniel d'Andrada

Update debian/copyright

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 06/08/15 13:44, Gerry Boland wrote:
> Minor nitpick:
> debian/copyright - remove reference to tests dir.
Done.

Revision history for this message
Gerry Boland (gerboland) wrote :

+QT += core-private gui-private ....
We don't need gui-private either

review: Needs Fixing
275. By Daniel d'Andrada

We don't need gui-private either

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

On 06/08/15 14:07, Gerry Boland wrote:
> Review: Needs Fixing
>
> +QT += core-private gui-private ....
> We don't need gui-private either
Done.

Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-06-23 18:02:16 +0000
3+++ debian/control 2015-08-06 17:11:31 +0000
4@@ -16,8 +16,6 @@
5 libxkbcommon-dev,
6 qt5-default,
7 qtbase5-private-dev,
8- qtdeclarative5-dev,
9- libqt5sensors5-dev,
10 libmirclient-dev (>= 0.13.0),
11 # if you don't have have commit access to this branch but would like to upload
12 # directly to Ubuntu, don't worry: your changes will be merged back into the
13@@ -39,8 +37,6 @@
14 Provides: qtubuntu,
15 Depends: ${misc:Depends},
16 ${shlibs:Depends},
17- libqt5sensors5,
18- qtubuntu-sensors,
19 ubuntu-application-api3-touch,
20 Description: Qt plugins for Ubuntu Platform API (mobile)
21 QtUbuntu is a set of Qt5 components for the Ubuntu Platform API. It contains a
22@@ -62,8 +58,6 @@
23 Provides: qtubuntu,
24 Depends: ${misc:Depends},
25 ${shlibs:Depends},
26- libqt5sensors5,
27- qtubuntu-sensors,
28 ubuntu-application-api3-desktop,
29 Description: Qt plugins for Ubuntu Platform API (desktop)
30 QtUbuntu is a set of Qt5 components for the Ubuntu Platform API. It contains a
31
32=== modified file 'debian/copyright'
33--- debian/copyright 2014-06-30 11:09:14 +0000
34+++ debian/copyright 2015-08-06 17:11:31 +0000
35@@ -9,10 +9,6 @@
36 Copyright: 2014 Canonical Ltd.
37 License: GPL-3
38
39-Files: tests/*
40-Copyright: 2013 Canonical Ltd.
41-License: GPL-3
42-
43 License: LGPL-3
44 This package is free software; you can redistribute it and/or
45 modify it under the terms of the GNU Lesser General Public
46@@ -29,7 +25,7 @@
47 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
48 .
49 On Debian systems, the complete text of the GNU Lesser General
50- Public License can be found in `/usr/share/common-licenses/LGPL-3'.
51+ Public License can be found in `/usr/share/common-licenses/LGPL-3'.
52
53 License: GPL-3
54 This program is free software: you can redistribute it and/or modify
55
56=== modified file 'qtubuntu.pro'
57--- qtubuntu.pro 2014-06-20 11:34:53 +0000
58+++ qtubuntu.pro 2015-08-06 17:11:31 +0000
59@@ -1,2 +1,2 @@
60 TEMPLATE = subdirs
61-SUBDIRS += src tests
62+SUBDIRS += src
63
64=== modified file 'src/ubuntumirclient/input.cpp'
65--- src/ubuntumirclient/input.cpp 2015-06-17 13:46:49 +0000
66+++ src/ubuntumirclient/input.cpp 2015-08-06 17:11:31 +0000
67@@ -470,19 +470,19 @@
68 return;
69 }
70
71- QOrientationReading::Orientation orientation;
72+ OrientationChangeEvent::Orientation orientation;
73 switch (mir_orientation) {
74 case mir_orientation_normal:
75- orientation = QOrientationReading::TopUp;
76+ orientation = OrientationChangeEvent::TopUp;
77 break;
78 case mir_orientation_left:
79- orientation = QOrientationReading::LeftUp;
80+ orientation = OrientationChangeEvent::LeftUp;
81 break;
82 case mir_orientation_inverted:
83- orientation = QOrientationReading::TopDown;
84+ orientation = OrientationChangeEvent::TopDown;
85 break;
86 case mir_orientation_right:
87- orientation = QOrientationReading::RightUp;
88+ orientation = OrientationChangeEvent::RightUp;
89 break;
90 default:
91 DLOG("No such orientation %d", mir_orientation);
92
93=== modified file 'src/ubuntumirclient/integration.cpp'
94--- src/ubuntumirclient/integration.cpp 2015-06-23 22:19:27 +0000
95+++ src/ubuntumirclient/integration.cpp 2015-08-06 17:11:31 +0000
96@@ -55,7 +55,12 @@
97 Q_UNUSED(archive)
98 DASSERT(context != NULL);
99 UbuntuClientIntegration* integration = static_cast<UbuntuClientIntegration*>(context);
100- integration->inputContext()->hideInputPanel();
101+ QPlatformInputContext *inputContext = integration->inputContext();
102+ if (inputContext) {
103+ inputContext->hideInputPanel();
104+ } else {
105+ qWarning("UbuntuClientIntegration aboutToStopCallback(): no input context");
106+ }
107 QCoreApplication::postEvent(QCoreApplication::instance(),
108 new QEvent(QEvent::ApplicationDeactivate));
109 }
110
111=== modified file 'src/ubuntumirclient/orientationchangeevent_p.h'
112--- src/ubuntumirclient/orientationchangeevent_p.h 2014-09-02 10:34:47 +0000
113+++ src/ubuntumirclient/orientationchangeevent_p.h 2015-08-06 17:11:31 +0000
114@@ -18,19 +18,20 @@
115 #define ORIENTATIONCHANGEEVENT_P_H
116
117 #include <QEvent>
118-#include <QOrientationReading>
119 #include "logging.h"
120
121 class OrientationChangeEvent : public QEvent {
122 public:
123- OrientationChangeEvent(QEvent::Type type, QOrientationReading::Orientation orientation)
124+ enum Orientation { TopUp, LeftUp, TopDown, RightUp };
125+
126+ OrientationChangeEvent(QEvent::Type type, Orientation orientation)
127 : QEvent(type)
128 , mOrientation(orientation)
129 {
130 }
131
132 static const QEvent::Type mType;
133- QOrientationReading::Orientation mOrientation;
134+ Orientation mOrientation;
135 };
136
137 #endif // ORIENTATIONCHANGEEVENT_P_H
138
139=== modified file 'src/ubuntumirclient/screen.cpp'
140--- src/ubuntumirclient/screen.cpp 2015-06-24 17:21:21 +0000
141+++ src/ubuntumirclient/screen.cpp 2015-08-06 17:11:31 +0000
142@@ -210,22 +210,22 @@
143
144 OrientationChangeEvent* oReadingEvent = static_cast<OrientationChangeEvent*>(event);
145 switch (oReadingEvent->mOrientation) {
146- case QOrientationReading::LeftUp: {
147+ case OrientationChangeEvent::LeftUp: {
148 mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
149 Qt::InvertedPortraitOrientation : Qt::LandscapeOrientation;
150 break;
151 }
152- case QOrientationReading::TopUp: {
153+ case OrientationChangeEvent::TopUp: {
154 mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
155 Qt::LandscapeOrientation : Qt::PortraitOrientation;
156 break;
157 }
158- case QOrientationReading::RightUp: {
159+ case OrientationChangeEvent::RightUp: {
160 mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
161 Qt::PortraitOrientation : Qt::InvertedLandscapeOrientation;
162 break;
163 }
164- case QOrientationReading::TopDown: {
165+ case OrientationChangeEvent::TopDown: {
166 mCurrentOrientation = (screen()->primaryOrientation() == Qt::LandscapeOrientation) ?
167 Qt::InvertedLandscapeOrientation : Qt::InvertedPortraitOrientation;
168 break;
169
170=== modified file 'src/ubuntumirclient/ubuntumirclient.pro'
171--- src/ubuntumirclient/ubuntumirclient.pro 2015-01-28 17:26:55 +0000
172+++ src/ubuntumirclient/ubuntumirclient.pro 2015-08-06 17:11:31 +0000
173@@ -2,7 +2,7 @@
174 TEMPLATE = lib
175
176 QT -= gui
177-QT += core-private gui-private platformsupport-private sensors dbus
178+QT += core-private platformsupport-private dbus
179
180 CONFIG += plugin no_keywords qpa/genericunixfontdatabase
181
182@@ -35,7 +35,7 @@
183 integration.h \
184 logging.h \
185 nativeinterface.h \
186- orientationchangeevent_p.h \
187+ orientationchangeevent_p.h \
188 platformservices.h \
189 plugin.h \
190 screen.h \
191
192=== removed directory 'tests'
193=== removed file 'tests/Application.qml'
194--- tests/Application.qml 2013-09-04 12:01:57 +0000
195+++ tests/Application.qml 1970-01-01 00:00:00 +0000
196@@ -1,180 +0,0 @@
197-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
198-// Copyright © 2013 Canonical Ltd.
199-//
200-// This program is free software: you can redistribute it and/or modify it under
201-// the terms of the GNU General Public License version 3, as published by the
202-// Free Software Foundation.
203-//
204-// This program is distributed in the hope that it will be useful, but WITHOUT
205-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
206-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
207-// General Public License for more details.
208-//
209-// You should have received a copy of the GNU General Public License along with
210-// this program. If not, see <http://www.gnu.org/licenses/>.
211-
212-// That example demonstrates the types added by the Ubuntu application plugin and how to use them.
213-//
214-// Here is how to create a window with specific surface role (Greeter here) from QML.
215-//
216-// import QtQuick.Window 2.0
217-//
218-// Window {
219-// width: 400
220-// height: 400
221-// Component.onCompleted: {
222-// window.role = ApplicationManager.Greeter
223-// window.visible = true
224-// }
225-// }
226-//
227-// Here is how to start a new process:
228-// ApplicationManager.startProcess("snowshoe")
229-//
230-// In order to pass additional arguments, a second optional argument can be used:
231-// ApplicationManager.startProcess("snowshoe", [ "http://www.ubuntu.com" ])
232-//
233-// An application can be stopped by using:
234-// ApplicationManager.stopProcess(application)
235-//
236-// In order to focus or start a favorite application, that function can be used:
237-// ApplicationManager.focusFavoriteApplication(ApplicationManager.GalleryApplication);
238-//
239-// A good way to use Application.qml is to launch it using:
240-// qmlscene-ubuntu --fullscreen --session 1 --role 0 Application.qml
241-// and then to launch other applications using:
242-// qmlscene-ubuntu --session 0 --role 1 MovingLogo.qml \
243-// --desktop_file_hint=/usr/share/applications/goodhope.desktop --stage_hint=main_stage
244-
245-import QtQuick 2.0
246-import Unity.Application 0.1
247-
248-Rectangle {
249- id: surface
250- width: 2560
251- height: 1600
252- color: "#000020"
253-
254- Connections {
255- target: ApplicationManager
256- onFocusRequested: {
257- var favoriteApplicationStr = [
258- 'CameraApplication', 'GalleryApplication', 'BrowserApplication', 'ShareApplication'
259- ];
260- print("focus request:", favoriteApplicationStr[favoriteApplication])
261- }
262- }
263-
264- MouseArea {
265- id: touchArea
266- anchors.fill: parent
267- onClicked: {
268- // ApplicationManager.focusFavoriteApplication(ApplicationManager.BrowserApplication);
269- }
270- }
271-
272- Column {
273- id: mainHeader
274-
275- anchors {
276- left: parent.left
277- right: parent.right
278- }
279- spacing: 10
280-
281- Text {
282- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 40; color: "white"
283- text: "Main stage:"
284- }
285- }
286-
287- Row {
288- id: mainRow
289-
290- anchors {
291- top: mainHeader.bottom
292- topMargin: 10
293- }
294-
295- Repeater {
296- model: ApplicationManager.mainStageApplications
297- delegate: ApplicationImage {
298- id: applicationImage
299- width: 2560 / 5; height: 1600 / 5
300- source: application
301- Text {
302- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 30; color: "white"
303- text: application.name
304- }
305-
306- MouseArea {
307- anchors.fill: parent
308- onClicked: applicationImage.scheduleUpdate()
309- }
310-
311- Timer {
312- running: true
313- onTriggered: applicationImage.scheduleUpdate()
314- }
315- }
316- }
317- }
318-
319- Column {
320- id: sideHeader
321- y: surface.height / 2
322-
323- anchors {
324- left: parent.left
325- right: parent.right
326- }
327- spacing: 10
328-
329- Text {
330- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 40; color: "white"
331- text: "Side stage:"
332- }
333- }
334-
335- Row {
336- anchors {
337- top: sideHeader.bottom
338- topMargin: 10
339- }
340-
341- Repeater {
342- model: ApplicationManager.sideStageApplications
343- delegate: ApplicationImage {
344- id: applicationImage
345- width: 2560 / 5; height: 1600 / 5
346- source: application
347- Text {
348- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 30; color: "white"
349- text: application.name
350- }
351-
352- MouseArea {
353- anchors.fill: parent
354- onClicked: applicationImage.scheduleUpdate()
355- }
356-
357- Timer {
358- running: true
359- onTriggered: applicationImage.scheduleUpdate()
360- }
361- }
362- }
363- }
364-
365- Component.onCompleted: {
366- // Display form factor and stage hints.
367- var formFactorHintStr = [
368- 'Desktop', 'Phone', 'Tablet'
369- ];
370- var stageHintStr = [
371- 'Main', 'Integration', 'Share', 'ContentPicking', 'Side', 'Configuration'
372- ];
373- print('Form factor hint:', formFactorHintStr[ApplicationManager.formFactorHint]);
374- print('Stage hint:', stageHintStr[ApplicationManager.stageHint]);
375- }
376-}
377
378=== removed file 'tests/Fullscreen.qml'
379--- tests/Fullscreen.qml 2013-09-04 12:01:57 +0000
380+++ tests/Fullscreen.qml 1970-01-01 00:00:00 +0000
381@@ -1,43 +0,0 @@
382-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
383-// Copyright © 2013 Canonical Ltd.
384-//
385-// This program is free software: you can redistribute it and/or modify it under
386-// the terms of the GNU General Public License version 3, as published by the
387-// Free Software Foundation.
388-//
389-// This program is distributed in the hope that it will be useful, but WITHOUT
390-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
391-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
392-// General Public License for more details.
393-//
394-// You should have received a copy of the GNU General Public License along with
395-// this program. If not, see <http://www.gnu.org/licenses/>.
396-
397-// Non graphical test watching fullscreen states of main and side stages.
398-
399-import QtQuick 2.0
400-import Unity.Application 0.1
401-
402-Item {
403- Timer {
404- id: time
405- interval: 1000
406- repeat: true
407- onTriggered: {
408- if (ApplicationManager.mainStageFocusedApplication) {
409- print(ApplicationManager.sideStageFocusedApplication.name,
410- "in main stage is fullscreen: ",
411- ApplicationManager.sideStageFocusedApplication.fullscreen)
412- }
413- if (ApplicationManager.sideStageFocusedApplication) {
414- print(ApplicationManager.sideStageFocusedApplication.name,
415- "in side stage is fullscreen: ",
416- ApplicationManager.sideStageFocusedApplication.fullscreen)
417- }
418- }
419- Component.onCompleted: time.start()
420- }
421- Component.onCompleted: {
422- time.start()
423- }
424-}
425
426=== removed file 'tests/Input.qml'
427--- tests/Input.qml 2013-02-14 16:31:33 +0000
428+++ tests/Input.qml 1970-01-01 00:00:00 +0000
429@@ -1,88 +0,0 @@
430-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
431-// Copyright © 2013 Canonical Ltd.
432-//
433-// This program is free software: you can redistribute it and/or modify it under
434-// the terms of the GNU General Public License version 3, as published by the
435-// Free Software Foundation.
436-//
437-// This program is distributed in the hope that it will be useful, but WITHOUT
438-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
439-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
440-// General Public License for more details.
441-//
442-// You should have received a copy of the GNU General Public License along with
443-// this program. If not, see <http://www.gnu.org/licenses/>.
444-
445-import QtQuick 2.0
446-
447-Item {
448- id: surface
449-
450- // Hard-coded Samsung Galaxy Nexus screen size.
451- width: 720
452- height: 1280
453-
454- // Needed for the key events to be emitted.
455- focus: true
456-
457- MultiPointTouchArea {
458- anchors.fill: parent
459- touchPoints: [
460- TouchPoint { id: point1 }, TouchPoint { id: point2 }, TouchPoint { id: point3 },
461- TouchPoint { id: point4 }, TouchPoint { id: point5 }
462- ]
463- }
464-
465- // Touch elements.
466- Text {
467- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 100; color: "#9F9F00"
468- x: point5.x + 50; y: point5.y - 200
469- visible: point5.pressed
470- text: "5"
471- }
472- Text {
473- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 100; color: "#AF00AF"
474- x: point4.x + 50; y: point4.y - 200
475- visible: point4.pressed
476- text: "4"
477- }
478- Text {
479- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 100; color: "#0000EF"
480- x: point3.x + 50; y: point3.y - 200
481- visible: point3.pressed
482- text: "3"
483- }
484- Text {
485- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 100; color: "#00FF00"
486- x: point2.x + 50; y: point2.y - 200
487- visible: point2.pressed
488- text: "2"
489- }
490- Text {
491- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 100; color: "#FF0000"
492- x: point1.x + 50; y: point1.y - 200
493- visible: point1.pressed
494- text: "1"
495- }
496-
497- // Key elements.
498- Text {
499- id: keyText
500- font.family: "Ubuntu Mono"; font.weight: Font.Bold; font.pixelSize: 75; color: "#DFDFDF"
501- anchors.centerIn: surface
502- visible: false
503- text: ""
504- }
505- Keys.onPressed: {
506- if (event.key == Qt.Key_PowerOff)
507- keyText.text = "Power Off";
508- else if (event.key == Qt.Key_VolumeUp)
509- keyText.text = "Volume Up";
510- else if (event.key == Qt.Key_VolumeDown)
511- keyText.text = "Volume Down";
512- keyText.visible = true;
513- }
514- Keys.onReleased: {
515- keyText.visible = false;
516- }
517-}
518
519=== removed file 'tests/InputFilter.qml'
520--- tests/InputFilter.qml 2013-09-04 12:01:57 +0000
521+++ tests/InputFilter.qml 1970-01-01 00:00:00 +0000
522@@ -1,71 +0,0 @@
523-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
524-// Copyright © 2013 Canonical Ltd.
525-//
526-// This program is free software: you can redistribute it and/or modify it under
527-// the terms of the GNU General Public License version 3, as published by the
528-// Free Software Foundation.
529-//
530-// This program is distributed in the hope that it will be useful, but WITHOUT
531-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
532-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
533-// General Public License for more details.
534-//
535-// You should have received a copy of the GNU General Public License along with
536-// this program. If not, see <http://www.gnu.org/licenses/>.
537-
538-import QtQuick 2.0
539-import Unity.Application 0.1
540-
541-Item {
542- width: 700; height: 700
543-
544- InputFilterArea {
545- id: topLeftFilter
546- width: 500
547- height: 500
548- blockInput: true
549-
550- Rectangle {
551- anchors.fill: parent
552- color: parent.blockInput ? "red" : "green"
553- opacity: parent.blockInput ? 1.0 : 0.8
554- }
555- }
556-
557- MouseArea {
558- anchors.centerIn: parent
559- width: 500
560- height: 200
561- onClicked: {
562- topLeftFilter.blockInput = !topLeftFilter.blockInput;
563- bottomRightFilter.blockInput = !bottomRightFilter.blockInput;
564- }
565-
566- Rectangle {
567- anchors.fill: parent
568- color: "grey"
569- }
570-
571- Text {
572- anchors.centerIn: parent
573- text: "Press to toggle filters"
574- font.pixelSize: 45
575- color: "lightgrey"
576- }
577- }
578-
579- InputFilterArea {
580- id: bottomRightFilter
581- anchors.right: parent.right
582- anchors.bottom: parent.bottom
583- width: 500
584- height: 500
585- blockInput: true
586-
587- Rectangle {
588- anchors.fill: parent
589- color: parent.blockInput ? "red" : "green"
590- opacity: parent.blockInput ? 1.0 : 0.8
591- }
592- }
593-}
594
595=== removed file 'tests/Logo.qml'
596--- tests/Logo.qml 2013-02-14 16:31:33 +0000
597+++ tests/Logo.qml 1970-01-01 00:00:00 +0000
598@@ -1,21 +0,0 @@
599-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
600-// Copyright © 2013 Canonical Ltd.
601-//
602-// This program is free software: you can redistribute it and/or modify it under
603-// the terms of the GNU General Public License version 3, as published by the
604-// Free Software Foundation.
605-//
606-// This program is distributed in the hope that it will be useful, but WITHOUT
607-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
608-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
609-// General Public License for more details.
610-//
611-// You should have received a copy of the GNU General Public License along with
612-// this program. If not, see <http://www.gnu.org/licenses/>.
613-
614-import QtQuick 2.0
615-
616-Item {
617- width: 720; height: 1280
618- Image { anchors.fill: parent; source: "logo.png" }
619-}
620
621=== removed file 'tests/MovingLogo.qml'
622--- tests/MovingLogo.qml 2013-02-14 16:31:33 +0000
623+++ tests/MovingLogo.qml 1970-01-01 00:00:00 +0000
624@@ -1,73 +0,0 @@
625-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
626-// Copyright © 2013 Canonical Ltd.
627-//
628-// This program is free software: you can redistribute it and/or modify it under
629-// the terms of the GNU General Public License version 3, as published by the
630-// Free Software Foundation.
631-//
632-// This program is distributed in the hope that it will be useful, but WITHOUT
633-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
634-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
635-// General Public License for more details.
636-//
637-// You should have received a copy of the GNU General Public License along with
638-// this program. If not, see <http://www.gnu.org/licenses/>.
639-
640-import QtQuick 2.0
641-
642-Item {
643- id: surface
644-
645- // Hard-coded Samsung Galaxy Nexus screen size.
646- width: 720
647- height: 1280
648-
649- property real seed
650-
651- function lerp(x, a, b) {
652- return ((1.0 - x) * a) + (x * b);
653- }
654-
655- Item {
656- id: scene
657- anchors.fill: parent
658-
659- Image {
660- id: logo
661- source: "logo.png"
662-
663- SequentialAnimation on y {
664- loops: Animation.Infinite
665- NumberAnimation {
666- from: 0.0; to: surface.height - logo.height
667- duration: Math.floor(lerp(Math.random(surface.seed), 2250.0, 2750.0))
668- easing.type: Easing.InOutSine;
669- }
670- NumberAnimation {
671- to: 0.0; from: surface.height - logo.height
672- duration: Math.floor(lerp(Math.random(surface.seed), 2250.0, 2750.0))
673- easing.type: Easing.InOutSine;
674- }
675- }
676-
677- SequentialAnimation on x {
678- loops: Animation.Infinite
679- NumberAnimation {
680- from: 0.0; to: surface.width - logo.width
681- duration: Math.floor(lerp(Math.random(surface.seed), 1750.0, 2250.0))
682- easing.type: Easing.InOutSine;
683- }
684- NumberAnimation {
685- to: 0.0; from: surface.width - logo.width
686- duration: Math.floor(lerp(Math.random(surface.seed), 1750.0, 2250.0))
687- easing.type: Easing.InOutSine;
688- }
689- }
690- }
691- }
692-
693- Component.onCompleted: {
694- var d = new Date();
695- surface.seed = d.getSeconds();
696- }
697-}
698
699=== removed file 'tests/TextInput.qml'
700--- tests/TextInput.qml 2014-09-17 06:12:22 +0000
701+++ tests/TextInput.qml 1970-01-01 00:00:00 +0000
702@@ -1,34 +0,0 @@
703-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
704-// Copyright © 2014 Canonical Ltd.
705-//
706-// This program is free software: you can redistribute it and/or modify it under
707-// the terms of the GNU General Public License version 3, as published by the
708-// Free Software Foundation.
709-//
710-// This program is distributed in the hope that it will be useful, but WITHOUT
711-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
712-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
713-// General Public License for more details.
714-//
715-// You should have received a copy of the GNU General Public License along with
716-// this program. If not, see <http://www.gnu.org/licenses/>.
717-
718-import QtQuick 2.0
719-
720-Item {
721- width: 700
722- height: 700
723-
724- Rectangle {
725- width: 700
726- height: 25
727- TextInput {
728- anchors {
729- fill: parent
730- margins: 5
731- }
732- focus: true
733- echoMode: TextInput.Password
734- }
735- }
736-}
737
738=== removed file 'tests/WarpingLogo.qml'
739--- tests/WarpingLogo.qml 2013-02-14 16:31:33 +0000
740+++ tests/WarpingLogo.qml 1970-01-01 00:00:00 +0000
741@@ -1,84 +0,0 @@
742-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
743-// Copyright © 2013 Canonical Ltd.
744-//
745-// This program is free software: you can redistribute it and/or modify it under
746-// the terms of the GNU General Public License version 3, as published by the
747-// Free Software Foundation.
748-//
749-// This program is distributed in the hope that it will be useful, but WITHOUT
750-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
751-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
752-// General Public License for more details.
753-//
754-// You should have received a copy of the GNU General Public License along with
755-// this program. If not, see <http://www.gnu.org/licenses/>.
756-
757-import QtQuick 2.0
758-
759-Item {
760- id: surface
761-
762- // Hard-coded Samsung Galaxy Nexus screen size.
763- width: 720
764- height: 1280
765-
766- property real displace
767- SequentialAnimation on displace {
768- loops: Animation.Infinite
769- NumberAnimation { from: 0.0; to: 1.0; duration: 30000 }
770- }
771-
772- Item {
773- id: scene
774- anchors.fill: parent
775- Image {
776- id: logo
777- x: (scene.width - sourceSize.width) / 2
778- y: (scene.height - sourceSize.height) / 2
779- width: sourceSize.width
780- height: sourceSize.height
781- source: "logo.png"
782- sourceSize: Qt.size(400, 400)
783- }
784- }
785-
786- ShaderEffect {
787- property variant tex: ShaderEffectSource {
788- sourceItem: scene; hideSource: true; live: false; smooth: true
789- }
790- property variant noise: ShaderEffectSource {
791- sourceItem: Image { source: "noise.png"; smooth: true }
792- wrapMode: ShaderEffectSource.Repeat
793- }
794- property variant size: Qt.size(scene.width, scene.height)
795- property variant displace: surface.displace
796-
797- anchors.fill: parent
798- blending: false
799-
800- vertexShader: "
801- uniform mediump float displace;
802- uniform mediump vec2 size;
803- uniform mediump mat4 qt_Matrix;
804- attribute mediump vec4 qt_Vertex;
805- attribute mediump vec2 qt_MultiTexCoord0;
806- varying mediump vec2 texCoord;
807- varying mediump vec2 noiseCoord;
808- void main() {
809- texCoord = qt_MultiTexCoord0.xy;
810- noiseCoord = vec2(qt_MultiTexCoord0.x * 0.25,
811- qt_MultiTexCoord0.y * 0.25 + displace);
812- gl_Position = qt_Matrix * qt_Vertex;
813- }"
814-
815- fragmentShader: "
816- uniform sampler2D noise;
817- uniform sampler2D tex;
818- varying mediump vec2 texCoord;
819- varying mediump vec2 noiseCoord;
820- void main() {
821- mediump vec2 noiseVec = texture2D(noise, noiseCoord).xy;
822- gl_FragColor = texture2D(tex, texCoord + ((noiseVec - 0.5) * 0.05));
823- }"
824- }
825-}
826
827=== removed directory 'tests/clipboard'
828=== removed file 'tests/clipboard/clipboard.cc'
829--- tests/clipboard/clipboard.cc 2013-02-05 14:42:15 +0000
830+++ tests/clipboard/clipboard.cc 1970-01-01 00:00:00 +0000
831@@ -1,61 +0,0 @@
832-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
833-// Copyright © 2013 Canonical Ltd.
834-//
835-// This program is free software: you can redistribute it and/or modify it under
836-// the terms of the GNU General Public License version 3, as published by
837-// the Free Software Foundation.
838-//
839-// This program is distributed in the hope that it will be useful, but WITHOUT
840-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
841-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
842-// General Public License for more details.
843-//
844-// You should have received a copy of the GNU General Public License
845-// along with this program. If not, see <http://www.gnu.org/licenses/>.
846-
847-#include <QtGui/QGuiApplication>
848-#include <QtGui/QClipboard>
849-#include <cstdio>
850-
851-enum Operation { kNone, kCopy, kPaste };
852-
853-static void usage() {
854- fprintf(stdout,
855- "Usage: clipboard [options]\n\n"
856- " Options:\n"
857- " -c or --copy \"text\" ... Copy text to clipboard\n"
858- " -p or --paste ... Paste text from clipboard\n"
859- " -h or --help ... Show that help\n");
860-}
861-
862-int main(int argc, char* argv[]) {
863- Operation operation = kNone;
864- QString text;
865-
866- for (int i = 1; i < argc; ++i) {
867- const QString kArg = QString::fromLatin1(argv[i]).toLower();
868- if ((kArg == QLatin1String("-c") || kArg == QLatin1String("--copy")) && i + 1 < argc) {
869- operation = kCopy;
870- text = QString::fromLatin1(argv[++i]);
871- } else if (kArg == QLatin1String("-p") || kArg == QLatin1String("--paste")) {
872- operation = kPaste;
873- } else if (kArg == QLatin1String("-h") || kArg == QLatin1String("--help")) {
874- usage();
875- return 1;
876- }
877- }
878- if (operation == kNone) {
879- usage();
880- return 1;
881- }
882-
883- QGuiApplication app(argc, argv);
884- if (operation == kCopy) {
885- QGuiApplication::clipboard()->setText(text);
886- fprintf(stdout, "Copied: \"%s\"\n", text.toLatin1().data());
887- } else {
888- fprintf(stdout, "Pasted: \"%s\"\n", QGuiApplication::clipboard()->text().toLatin1().data());
889- }
890-
891- return 0;
892-}
893
894=== removed file 'tests/clipboard/clipboard.pro'
895--- tests/clipboard/clipboard.pro 2013-02-05 14:42:15 +0000
896+++ tests/clipboard/clipboard.pro 1970-01-01 00:00:00 +0000
897@@ -1,7 +0,0 @@
898-QT += core gui
899-
900-TARGET = clipboard
901-TEMPLATE = app
902-
903-SOURCES += clipboard.cc
904-LIBS += -lrt
905
906=== removed file 'tests/logo.png'
907Binary files tests/logo.png 2012-09-27 18:17:22 +0000 and tests/logo.png 1970-01-01 00:00:00 +0000 differ
908=== removed file 'tests/noise.png'
909Binary files tests/noise.png 2012-09-27 22:15:46 +0000 and tests/noise.png 1970-01-01 00:00:00 +0000 differ
910=== removed directory 'tests/qmlscene_ubuntu'
911=== removed file 'tests/qmlscene_ubuntu/qmlscene_ubuntu.cc'
912--- tests/qmlscene_ubuntu/qmlscene_ubuntu.cc 2013-11-25 09:31:28 +0000
913+++ tests/qmlscene_ubuntu/qmlscene_ubuntu.cc 1970-01-01 00:00:00 +0000
914@@ -1,178 +0,0 @@
915-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
916-// Copyright © 2013 Canonical Ltd.
917-//
918-// This program is free software: you can redistribute it and/or modify it under
919-// the terms of the GNU General Public License version 3, as published by the
920-// Free Software Foundation.
921-//
922-// This program is distributed in the hope that it will be useful, but WITHOUT
923-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
924-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
925-// General Public License for more details.
926-//
927-// You should have received a copy of the GNU General Public License along with
928-// this program. If not, see <http://www.gnu.org/licenses/>.
929-
930-#include "qmlscene_ubuntu.h"
931-#include <QtCore/QFileInfo>
932-#include <QtGui/QGuiApplication>
933-#include <QtQuick/QQuickView>
934-#include <QtQml/qqmlengine.h>
935-#include <qpa/qplatformnativeinterface.h>
936-#include <cstdio>
937-#include <ctime>
938-#include <csignal>
939-#include <cfloat>
940-
941-Scene::Scene(QObject* parent)
942- : QObject(parent)
943- , frames_(0)
944- , sum_(0.0)
945- , min_(DBL_MAX)
946- , max_(0.0) {
947-}
948-
949-void Scene::beforeRendering() {
950- clock_gettime(CLOCK_MONOTONIC, &t1_);
951-}
952-
953-void Scene::afterRendering() {
954- clock_gettime(CLOCK_MONOTONIC, &t2_);
955- double time = ((t2_.tv_sec * 1000000000 + t2_.tv_nsec) -
956- (t1_.tv_sec * 1000000000 + t1_.tv_nsec)) / 1000000.0;
957- if (time < min_)
958- min_ = time;
959- if (time > max_)
960- max_ = time;
961- sum_ += time;
962- frames_++;
963-}
964-
965-void Scene::getStats(int* frames, double* min, double* max, double* average) {
966- *frames = frames_;
967- *min = min_;
968- *max = max_;
969- *average = sum_ / frames_;
970-}
971-
972-static void usage() {
973- fprintf(stdout,
974- "Usage: qmlscene-ubuntu [options] <filename>\n\n"
975- " Options:\n"
976- " -i <path> ... Add <path> to the list of import paths\n"
977- " -f or --fullscreen ... Show the window fullscreen\n"
978- " -m or --maximized ... Show the window maximized\n"
979- " -s or --session <session> ... Set the Ubuntu session type\n"
980- " -r or --role <role> ... Set the Ubuntu surface role\n"
981- " -o or --opaque ... Set the Ubuntu opaque surface flag\n"
982- " -h or --help ... Show that help\n");
983-}
984-
985-// static void logger(QtMsgType type, const char* msg) {
986-// Q_UNUSED(type);
987-// Q_UNUSED(msg);
988-// }
989-
990-static void signalHandler(int signal) {
991- switch (signal) {
992- case SIGINT:
993- case SIGTERM: {
994- QGuiApplication::quit();
995- break;
996- }
997- default: {
998- break;
999- }
1000- }
1001-}
1002-
1003-int main(int argc, char* argv[]) {
1004- QQuickView* view;
1005- int exit_code;
1006- QUrl url;
1007- QStringList imports;
1008- bool fullscreen = false;
1009- bool maximized = false;
1010- int session = 0;
1011- int role = 1;
1012- int opaque = 0;
1013-
1014- for (int i = 1; i < argc; ++i) {
1015- if (QFileInfo(QFile::decodeName(argv[i])).exists()) {
1016- url = QUrl::fromLocalFile(argv[i]);
1017- } else {
1018- const QString kArg = QString::fromLatin1(argv[i]).toLower();
1019- if (kArg == QLatin1String("-i") && i + 1 < argc) {
1020- imports.append(QString::fromLatin1(argv[++i]));
1021- } else if (kArg == QLatin1String("-f") || kArg == QLatin1String("--fullscreen")) {
1022- fullscreen = true;
1023- } else if (kArg == QLatin1String("-m") || kArg == QLatin1String("--maximized")) {
1024- maximized = true;
1025- } else if ((kArg == QLatin1String("-s") || kArg == QLatin1String("--session"))
1026- && i + 1 < argc) {
1027- session = atoi(argv[++i]);
1028- } else if ((kArg == QLatin1String("-r") || kArg == QLatin1String("--role"))
1029- && i + 1 < argc) {
1030- role = atoi(argv[++i]);
1031- } else if ((kArg == QLatin1String("-o") || kArg == QLatin1String("--opaque"))
1032- && i + 1 < argc) {
1033- opaque = atoi(argv[++i]);
1034- } else if (kArg == QLatin1String("-h") || kArg == QLatin1String("--help")) {
1035- usage();
1036- return 0;
1037- }
1038- }
1039- }
1040- if (url.isEmpty()) {
1041- usage();
1042- return 1;
1043- }
1044-
1045- // Swallow all the messages to avoid cluttering the standard output.
1046- // qInstallMsgHandler(logger);
1047-
1048- signal(SIGINT, signalHandler);
1049- signal(SIGTERM, signalHandler);
1050-
1051- QGuiApplication app(argc, argv);
1052- app.setApplicationName("QmlSceneUbuntu");
1053- app.setOrganizationName("Canonical");
1054- app.setOrganizationDomain("canonical.com");
1055-
1056- view = new QQuickView();
1057-
1058- QPlatformNativeInterface* native = QGuiApplication::platformNativeInterface();
1059- native->setProperty("session", session);
1060- view->setProperty("role", role);
1061- view->setProperty("opaque", opaque);
1062-
1063- QQmlEngine* engine = view->engine();
1064- for (int i = 0; i < imports.size(); ++i)
1065- engine->addImportPath(imports.at(i));
1066-
1067- view->setColor(Qt::transparent);
1068- view->setTitle("QML Scene Ubuntu");
1069- view->setResizeMode(QQuickView::SizeRootObjectToView);
1070- view->setSource(url);
1071- if (fullscreen)
1072- view->showFullScreen();
1073- else if (maximized)
1074- view->showMaximized();
1075- else
1076- view->show();
1077-
1078- Scene scene;
1079- QObject::connect(view, SIGNAL(beforeRendering()), &scene, SLOT(beforeRendering()));
1080- QObject::connect(view, SIGNAL(afterRendering()), &scene, SLOT(afterRendering()));
1081-
1082- exit_code = app.exec();
1083- delete view;
1084-
1085- int frames;
1086- double min, max, average;
1087- scene.getStats(&frames, &min, &max, &average);
1088- fprintf(stdout, "Over %d frames\nmin: %.2lf ms\nmax: %.2lf ms\navg: %.2lf ms\n",
1089- frames, min, max, average);
1090-
1091- return exit_code;
1092-}
1093
1094=== removed file 'tests/qmlscene_ubuntu/qmlscene_ubuntu.h'
1095--- tests/qmlscene_ubuntu/qmlscene_ubuntu.h 2013-02-14 16:31:33 +0000
1096+++ tests/qmlscene_ubuntu/qmlscene_ubuntu.h 1970-01-01 00:00:00 +0000
1097@@ -1,36 +0,0 @@
1098-// This file is part of QtUbuntu, a set of Qt components for Ubuntu.
1099-// Copyright © 2013 Canonical Ltd.
1100-//
1101-// This program is free software: you can redistribute it and/or modify it under
1102-// the terms of the GNU General Public License version 3, as published by the
1103-// Free Software Foundation.
1104-//
1105-// This program is distributed in the hope that it will be useful, but WITHOUT
1106-// ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1107-// SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1108-// General Public License for more details.
1109-//
1110-// You should have received a copy of the GNU General Public License along with
1111-// this program. If not, see <http://www.gnu.org/licenses/>.
1112-
1113-#include <QObject>
1114-
1115-class Scene : public QObject {
1116- Q_OBJECT
1117-
1118- public:
1119- Scene(QObject* parent = 0);
1120- void getStats(int* frames, double* min, double* max, double* average);
1121-
1122- private slots:
1123- void beforeRendering();
1124- void afterRendering();
1125-
1126- private:
1127- struct timespec t1_;
1128- struct timespec t2_;
1129- qint64 frames_;
1130- double sum_;
1131- double min_;
1132- double max_;
1133-};
1134
1135=== removed file 'tests/qmlscene_ubuntu/qmlscene_ubuntu.pro'
1136--- tests/qmlscene_ubuntu/qmlscene_ubuntu.pro 2013-06-13 18:07:55 +0000
1137+++ tests/qmlscene_ubuntu/qmlscene_ubuntu.pro 1970-01-01 00:00:00 +0000
1138@@ -1,12 +0,0 @@
1139-QT += core quick qml gui-private
1140-
1141-TARGET = qmlscene-ubuntu
1142-TEMPLATE = app
1143-
1144-HEADERS += qmlscene_ubuntu.h
1145-SOURCES += qmlscene_ubuntu.cc
1146-
1147-LIBS += -lrt
1148-
1149-sources.path = $$[QT_INSTALL_EXAMPLES]/qtubuntu
1150-sources.files = $$HEADERS $$SOURCES qmlscene_ubuntu.pro
1151
1152=== removed file 'tests/tests.pro'
1153--- tests/tests.pro 2013-02-05 02:05:42 +0000
1154+++ tests/tests.pro 1970-01-01 00:00:00 +0000
1155@@ -1,10 +0,0 @@
1156-TEMPLATE = subdirs
1157-
1158-SUBDIRS += qmlscene_ubuntu clipboard
1159-
1160-OTHER_FILES += *.qml logo.png noise.png
1161-
1162-target.path = $$[QT_INSTALL_EXAMPLES]/qtubuntu
1163-sources.path = $$[QT_INSTALL_EXAMPLES]/qtubuntu
1164-sources.files = $$OTHER_FILES tests.pro
1165-INSTALLS += target

Subscribers

People subscribed via source and target branches