diff options
Diffstat (limited to 'examples/declarative-camera')
26 files changed, 0 insertions, 1269 deletions
diff --git a/examples/declarative-camera/CameraButton.qml b/examples/declarative-camera/CameraButton.qml deleted file mode 100644 index 4b2c663..0000000 --- a/examples/declarative-camera/CameraButton.qml +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 - -Item { - id: button - - signal clicked - - property string text - property color color: "white" - - width : 144 - height: 70 - - BorderImage { - id: buttonImage - source: "images/toolbutton.sci" - width: button.width; height: button.height - } - MouseArea { - id: mouseRegion - anchors.fill: buttonImage - onClicked: { button.clicked(); } - } - Text { - id: btnText - color: button.color - anchors.centerIn: buttonImage; font.bold: true - text: button.text; style: Text.Raised; styleColor: "black" - font.pixelSize: 14 - } -} diff --git a/examples/declarative-camera/CameraPropertyButton.qml b/examples/declarative-camera/CameraPropertyButton.qml deleted file mode 100644 index 152bb93..0000000 --- a/examples/declarative-camera/CameraPropertyButton.qml +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -Item { - id: propertyButton - property alias value : popup.currentValue - property alias model : popup.model - - width : 144 - height: 70 - - BorderImage { - id: buttonImage - source: "images/toolbutton.sci" - width: propertyButton.width; height: propertyButton.height - } - - CameraButton { - anchors.fill: parent - Image { - anchors.centerIn: parent - source: popup.currentItem.icon - } - - onClicked: popup.toggle() - } - - CameraPropertyPopup { - id: popup - anchors.right: parent.left - anchors.rightMargin: 16 - anchors.top: parent.top - state: "invisible" - visible: opacity > 0 - - currentValue: propertyButton.value - - states: [ - State { - name: "invisible" - PropertyChanges { target: popup; opacity: 0 } - PropertyChanges { target: camera; focus: true } - }, - - State { - name: "visible" - PropertyChanges { target: popup; opacity: 1.0 } - } - ] - - transitions: Transition { - NumberAnimation { properties: "opacity"; duration: 100 } - } - - function toggle() { - if (state == "visible") - state = "invisible"; - else - state = "visible"; - } - - onSelected: { - popup.state = "invisible" - } - } -} - diff --git a/examples/declarative-camera/CameraPropertyPopup.qml b/examples/declarative-camera/CameraPropertyPopup.qml deleted file mode 100644 index f101b69..0000000 --- a/examples/declarative-camera/CameraPropertyPopup.qml +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 - -Rectangle { - id: propertyPopup - - property alias model : view.model - property variant currentValue - property variant currentItem : model.get(view.currentIndex) - - property int itemWidth : 100 - property int itemHeight : 70 - property int columns : 2 - - width: columns*itemWidth + view.anchors.margins*2 - height: Math.ceil(model.count/columns)*itemHeight + view.anchors.margins*2 + 25 - - radius: 5 - border.color: "#000000" - border.width: 2 - smooth: true - color: "#5e5e5e" - - signal selected - - function indexForValue(value) { - for (var i = 0; i < view.count; i++) { - if (model.get(i).value == value) { - return i; - } - } - - return 0; - } - - GridView { - id: view - anchors.fill: parent - anchors.margins: 5 - cellWidth: propertyPopup.itemWidth - cellHeight: propertyPopup.itemHeight - snapMode: ListView.SnapOneItem - highlightFollowsCurrentItem: true - highlight: Rectangle { color: "gray"; radius: 5 } - currentIndex: indexForValue(propertyPopup.currentValue) - - onCurrentIndexChanged: { - propertyPopup.currentValue = model.get(view.currentIndex).value - } - - delegate: Item { - width: propertyPopup.itemWidth - height: 70 - - Image { - anchors.centerIn: parent - source: icon - } - MouseArea { - anchors.fill: parent - onClicked: { - propertyPopup.currentValue = value - propertyPopup.selected(value) - } - } - } - } - - Text { - anchors.bottom: parent.bottom - anchors.bottomMargin: 8 - anchors.left: parent.left - anchors.leftMargin: 16 - - color: "#ffffff" - font.bold: true - style: Text.Raised; - styleColor: "black" - font.pixelSize: 14 - - text: view.model.get(view.currentIndex).text - } -} diff --git a/examples/declarative-camera/CaptureControls.qml b/examples/declarative-camera/CaptureControls.qml deleted file mode 100644 index 6120dad..0000000 --- a/examples/declarative-camera/CaptureControls.qml +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -FocusScope { - property Camera camera - property bool previewAvailable : false - - property alias whiteBalance : wbModesButton.value - property alias flashMode : flashModesButton.value - property alias exposureCompensation : exposureCompensationButton.value - - property int buttonsPanelWidth: buttonPaneShadow.width - - signal previewSelected - id : captureControls - - Rectangle { - id: buttonPaneShadow - width: buttonPanningPane.width + 16 - height: parent.height - anchors.top: parent.top - anchors.right: parent.right - color: Qt.rgba(0.08, 0.08, 0.08, 1) - - Flickable { - id: buttonPanningPane - anchors { - right: parent.right - top: parent.top - bottom: parent.bottom - margins: 8 - } - width: buttonsColumn.width - - contentWidth: buttonsColumn.width - contentHeight: buttonsColumn.height - - Column { - id: buttonsColumn - spacing: 8 - - FocusButton { - camera: captureControls.camera - } - - CameraButton { - text: "Capture" - onClicked: camera.captureImage() - } - - CameraPropertyButton { - id : flashModesButton - value: Camera.FlashOff - model: ListModel { - ListElement { - icon: "images/camera_flash_auto.png" - value: Camera.FlashAuto - text: "Auto" - } - ListElement { - icon: "images/camera_flash_off.png" - value: Camera.FlashOff - text: "Off" - } - ListElement { - icon: "images/camera_flash_fill.png" - value: Camera.FlashOn - text: "On" - } - ListElement { - icon: "images/camera_flash_redeye.png" - value: Camera.FlashRedEyeReduction - text: "Red Eye Reduction" - } - } - } - - CameraPropertyButton { - id : wbModesButton - value: Camera.WhiteBalanceAuto - model: ListModel { - ListElement { - icon: "images/camera_auto_mode.png" - value: Camera.WhiteBalanceAuto - text: "Auto" - } - ListElement { - icon: "images/camera_white_balance_sunny.png" - value: Camera.WhiteBalanceSunlight - text: "Sunlight" - } - ListElement { - icon: "images/camera_white_balance_cloudy.png" - value: Camera.WhiteBalanceCloudy - text: "Cloudy" - } - ListElement { - icon: "images/camera_white_balance_incandescent.png" - value: Camera.WhiteBalanceTungsten - text: "Tungsten" - } - ListElement { - icon: "images/camera_white_balance_flourescent.png" - value: Camera.WhiteBalanceFluorescent - text: "Fluorescent" - } - } - } - - ExposureCompensationButton { - id : exposureCompensationButton - } - - CameraButton { - text: "View" - onClicked: captureControls.previewSelected() - visible: captureControls.previewAvailable - } - - CameraButton { - id: quitButton - text: "Quit" - onClicked: Qt.quit() - } - - } - } - } - - - Item { - id: exposureDetails - anchors.bottom : parent.bottom - anchors.left : parent.left - anchors.bottomMargin: 16 - anchors.leftMargin: 16 - height: childrenRect.height - width: childrenRect.width - - visible : camera.lockStatus == Camera.Locked - - Rectangle { - opacity: 0.4 - color: "black" - anchors.fill: parent - } - - Row { - spacing : 16 - - Text { - text: "Av: "+camera.aperture.toFixed(1) - font.pixelSize: 18 - color: "white" - visible: camera.aperture > 0 - } - - Text { - font.pixelSize: 18 - color: "white" - visible: camera.shutterSpped > 0 - text: "Tv: "+printableExposureTime(camera.shutterSpeed) - - function printableExposureTime(t) { - if (t > 3.9) - return "Tv: "+t.toFixed() + "\""; - - if (t > 0.24 ) - return "Tv: "+t.toFixed(1) + "\""; - - if (t > 0) - return "Tv: 1/"+(1/t).toFixed(); - - return ""; - } - } - - Text { - text: "ISO: "+camera.iso.toFixed() - font.pixelSize: 18 - color: "white" - visible: camera.iso > 0 - } - } - } - - ZoomControl { - x : 0 - y : 0 - width : 100 - height: parent.height - - currentZoom: camera.digitalZoom - maximumZoom: Math.min(4.0, camera.maximumDigitalZoom) - onZoomTo: camera.setDigitalZoom(value) - } -} diff --git a/examples/declarative-camera/ExposureCompensationButton.qml b/examples/declarative-camera/ExposureCompensationButton.qml deleted file mode 100644 index cf6fc5d..0000000 --- a/examples/declarative-camera/ExposureCompensationButton.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 - -Item { - id: exposureCompensation - property real value : flickableList.items[flickableList.index] - signal clicked - - width : 144 - height: 70 - - BorderImage { - id: buttonImage - source: "images/toolbutton.sci" - width: exposureCompensation.width; height: exposureCompensation.height - } - - Text { - text: "Ev:" - x: 8 - y: 8 - font.pixelSize: 18 - color: "white" - } - - FlickableList { - anchors.fill: buttonImage - id: flickableList - items: ["-2", "-1.5", "-1", "-0.5", "0", "+0.5", "+1", "+1.5", "+2"] - index: 4 - - onClicked: exposureCompensation.clicked() - - delegate: Text { - font.pixelSize: 22 - color: "white" - styleColor: "black" - width: flickableList.width - height: flickableList.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - text: flickableList.items[index] - } - } -} - diff --git a/examples/declarative-camera/FlickableList.qml b/examples/declarative-camera/FlickableList.qml deleted file mode 100644 index d39519e..0000000 --- a/examples/declarative-camera/FlickableList.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 - -Item { - id: flickableList - clip: true - - signal clicked - - property alias delegate : repeater.delegate - - property variant items: [] - property int index: 0 - property int itemWidth : flickableList.width - - function scrollTo(id) { - var x = id*flickableList.itemWidth - if (flickArea.contentX != x) { - centeringAnimation.stop(); - flickArea.newX = id*flickableList.itemWidth - centeringAnimation.start(); - } - } - - onIndexChanged: scrollTo(index) - onWidthChanged: scrollTo(index) - - Flickable { - id: flickArea - property int newX: 0 - - MouseArea { - anchors.fill: parent - onClicked: { - var x = mapToItem(flickableList, mouseX, mouseY).x - - if (x < flickableList.width/3) { - if (flickableList.index > 0) - flickableList.scrollTo(flickableList.index-1); - } else if (x > flickableList.width*2/3) { - if (flickableList.index < flickableList.items.length-1) - flickableList.scrollTo(flickableList.index+1); - } else { - flickableList.clicked() - } - - } - } - - PropertyAnimation { - id: centeringAnimation - target: flickArea - properties: "contentX" - easing.type: Easing.OutQuad - from: flickArea.contentX - to: flickArea.newX - - onCompleted: { - flickableList.index = flickArea.newX / flickableList.itemWidth - } - } - - onMovementStarted: { - centeringAnimation.stop(); - } - - onMovementEnded: { - var modulo = flickArea.contentX % flickableList.itemWidth; - var offset = flickableList.itemWidth / 2; - flickArea.newX = modulo < offset ? flickArea.contentX - modulo : flickArea.contentX + (flickableList.itemWidth - modulo); - centeringAnimation.start(); - } - - - width: flickableList.width - height: flickableList.height - contentWidth: items.width - contentHeight: items.height - flickDeceleration: 4000 - - Row { - id: items - Repeater { - id: repeater - model: flickableList.items.length - } - } - } -} diff --git a/examples/declarative-camera/FocusButton.qml b/examples/declarative-camera/FocusButton.qml deleted file mode 100644 index 6a54c8d..0000000 --- a/examples/declarative-camera/FocusButton.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -CameraButton { - property Camera camera - - onClicked: { - if (camera.lockStatus == Camera.Unlocked) - camera.searchAndLock(); - else - camera.unlock(); - } - - text: { - if (camera.lockStatus == Camera.Unlocked) - "Focus"; - else if (camera.lockStatus == Camera.Searching) - "Focusing" - else - "Unlock" - } -} diff --git a/examples/declarative-camera/PhotoPreview.qml b/examples/declarative-camera/PhotoPreview.qml deleted file mode 100644 index 6cd7f35..0000000 --- a/examples/declarative-camera/PhotoPreview.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -Item { - property alias source : preview.source - signal closed - - Image { - id: preview - anchors.fill : parent - fillMode: Image.PreserveAspectFit - smooth: true - } - - MouseArea { - anchors.fill: parent - onClicked: { - parent.closed(); - } - } -} - diff --git a/examples/declarative-camera/ZoomControl.qml b/examples/declarative-camera/ZoomControl.qml deleted file mode 100644 index b141523..0000000 --- a/examples/declarative-camera/ZoomControl.qml +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -Item { - id : zoomControl - property real currentZoom : 1 - property real maximumZoom : 1 - signal zoomTo(real value) - - MouseArea { - id : mouseArea - anchors.fill: parent - - property real initialZoom : 0 - property real initialPos : 0 - - onPressed: { - initialPos = mouseY - initialZoom = zoomControl.currentZoom - } - - onMousePositionChanged: { - if (pressed) { - var target = initialZoom * Math.pow(2, (initialPos-mouseY)/zoomControl.height); - target = Math.max(1, Math.min(target, zoomControl.maximumZoom)) - zoomControl.zoomTo(target) - } - } - } - - Item { - id : bar - x : 16 - y : parent.height/4 - width : 24 - height : parent.height/2 - opacity : 0 - - Rectangle { - anchors.fill: parent - - smooth: true - radius: 8 - border.color: "black" - border.width: 2 - color: "white" - opacity: 0.3 - } - - Rectangle { - x : 0 - y : parent.height * (1.0 - (zoomControl.currentZoom-1.0) / (zoomControl.maximumZoom-1.0)) - width: parent.width - height: parent.height - y - smooth: true - radius: 8 - color: "black" - opacity: 0.5 - } - - states: State { - name: "ShowBar" - when: mouseArea.pressed || zoomControl.currentZoom > 1.0 - PropertyChanges { target: bar; opacity: 1 } - } - - transitions: [ - Transition { - to : "ShowBar" - NumberAnimation { properties: "opacity"; duration: 100 } - }, - Transition { - from : "ShowBar" - NumberAnimation { properties: "opacity"; duration: 500 } - } - ] - } -} diff --git a/examples/declarative-camera/declarative-camera.pro b/examples/declarative-camera/declarative-camera.pro deleted file mode 100644 index f159974..0000000 --- a/examples/declarative-camera/declarative-camera.pro +++ /dev/null @@ -1,22 +0,0 @@ - -TEMPLATE=app - -QT += declarative qtquick1 network multimedia - -contains(QT_CONFIG, opengl) { - QT += opengl -} - -SOURCES += $$PWD/qmlcamera.cpp -!mac:TARGET = qml_camera -else:TARGET = QmlCamera - -RESOURCES += declarative-camera.qrc - -target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/qml_camera -sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro -sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimedia/qml_camera - -INSTALLS += target sources - -QT+=widgets diff --git a/examples/declarative-camera/declarative-camera.qml b/examples/declarative-camera/declarative-camera.qml deleted file mode 100644 index fdc210d..0000000 --- a/examples/declarative-camera/declarative-camera.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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 Qt 4.7 -import QtMultimedia 4.0 - -Rectangle { - id : cameraUI - color: "black" - state: "PhotoCapture" - - states: [ - State { - name: "PhotoCapture" - StateChangeScript { - script: { - camera.visible = true - camera.focus = true - stillControls.visible = true - photoPreview.visible = false - } - } - }, - State { - name: "PhotoPreview" - StateChangeScript { - script: { - camera.visible = false - stillControls.visible = false - photoPreview.visible = true - photoPreview.focus = true - } - } - } - ] - - PhotoPreview { - id : photoPreview - anchors.fill : parent - onClosed: cameraUI.state = "PhotoCapture" - focus: visible - - Keys.onPressed : { - //return to capture mode if the shutter button is touched - if (event.key == Qt.Key_CameraFocus && !event.isAutoRepeat) { - cameraUI.state = "PhotoCapture" - event.accepted = true; - } - } - } - - Camera { - id: camera - x: 0 - y: 0 - width: parent.width - stillControls.buttonsPanelWidth - height: parent.height - focus: visible //to receive focus and capture key events - //captureResolution : "640x480" - - flashMode: stillControls.flashMode - whiteBalanceMode: stillControls.whiteBalance - exposureCompensation: stillControls.exposureCompensation - - onImageCaptured : { - photoPreview.source = preview - stillControls.previewAvailable = true - cameraUI.state = "PhotoPreview" - } - } - - CaptureControls { - id: stillControls - anchors.fill: parent - camera: camera - onPreviewSelected: cameraUI.state = "PhotoPreview" - } - -} diff --git a/examples/declarative-camera/declarative-camera.qmlproject b/examples/declarative-camera/declarative-camera.qmlproject deleted file mode 100644 index 53f5ecb..0000000 --- a/examples/declarative-camera/declarative-camera.qmlproject +++ /dev/null @@ -1,18 +0,0 @@ -/* File generated by QtCreator */ - -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ "../exampleplugin" ] -} diff --git a/examples/declarative-camera/declarative-camera.qrc b/examples/declarative-camera/declarative-camera.qrc deleted file mode 100644 index f8ce527..0000000 --- a/examples/declarative-camera/declarative-camera.qrc +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE RCC> - <RCC version="1.0"> - - <qresource prefix="/"> - <file>declarative-camera.qml</file> - <file>CameraButton.qml</file> - <file>CameraPropertyPopup.qml</file> - <file>CameraPropertyButton.qml</file> - <file>CaptureControls.qml</file> - <file>ExposureCompensationButton.qml</file> - <file>FlickableList.qml</file> - <file>FocusButton.qml</file> - <file>PhotoPreview.qml</file> - <file>ZoomControl.qml</file> - <file>images/camera_auto_mode.png</file> - <file>images/camera_camera_setting.png</file> - <file>images/camera_flash_auto.png</file> - <file>images/camera_flash_fill.png</file> - <file>images/camera_flash_off.png</file> - <file>images/camera_flash_redeye.png</file> - <file>images/camera_white_balance_cloudy.png</file> - <file>images/camera_white_balance_flourescent.png</file> - <file>images/camera_white_balance_incandescent.png</file> - <file>images/camera_white_balance_sunny.png</file> - <file>images/toolbutton.png</file> - <file>images/toolbutton.sci</file> - </qresource> - </RCC> diff --git a/examples/declarative-camera/images/camera_auto_mode.png b/examples/declarative-camera/images/camera_auto_mode.png Binary files differdeleted file mode 100644 index f168296..0000000 --- a/examples/declarative-camera/images/camera_auto_mode.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_camera_setting.png b/examples/declarative-camera/images/camera_camera_setting.png Binary files differdeleted file mode 100644 index 7b993ee..0000000 --- a/examples/declarative-camera/images/camera_camera_setting.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_flash_auto.png b/examples/declarative-camera/images/camera_flash_auto.png Binary files differdeleted file mode 100644 index fb5cc40..0000000 --- a/examples/declarative-camera/images/camera_flash_auto.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_flash_fill.png b/examples/declarative-camera/images/camera_flash_fill.png Binary files differdeleted file mode 100644 index 7bc5949..0000000 --- a/examples/declarative-camera/images/camera_flash_fill.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_flash_off.png b/examples/declarative-camera/images/camera_flash_off.png Binary files differdeleted file mode 100644 index 3c5db10..0000000 --- a/examples/declarative-camera/images/camera_flash_off.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_flash_redeye.png b/examples/declarative-camera/images/camera_flash_redeye.png Binary files differdeleted file mode 100644 index 534a087..0000000 --- a/examples/declarative-camera/images/camera_flash_redeye.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_white_balance_cloudy.png b/examples/declarative-camera/images/camera_white_balance_cloudy.png Binary files differdeleted file mode 100644 index 243b699..0000000 --- a/examples/declarative-camera/images/camera_white_balance_cloudy.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_white_balance_flourescent.png b/examples/declarative-camera/images/camera_white_balance_flourescent.png Binary files differdeleted file mode 100644 index 032efe1..0000000 --- a/examples/declarative-camera/images/camera_white_balance_flourescent.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_white_balance_incandescent.png b/examples/declarative-camera/images/camera_white_balance_incandescent.png Binary files differdeleted file mode 100644 index 98f9067..0000000 --- a/examples/declarative-camera/images/camera_white_balance_incandescent.png +++ /dev/null diff --git a/examples/declarative-camera/images/camera_white_balance_sunny.png b/examples/declarative-camera/images/camera_white_balance_sunny.png Binary files differdeleted file mode 100644 index d7d5c9a..0000000 --- a/examples/declarative-camera/images/camera_white_balance_sunny.png +++ /dev/null diff --git a/examples/declarative-camera/images/toolbutton.png b/examples/declarative-camera/images/toolbutton.png Binary files differdeleted file mode 100644 index 1131001..0000000 --- a/examples/declarative-camera/images/toolbutton.png +++ /dev/null diff --git a/examples/declarative-camera/images/toolbutton.sci b/examples/declarative-camera/images/toolbutton.sci deleted file mode 100644 index 9e4f965..0000000 --- a/examples/declarative-camera/images/toolbutton.sci +++ /dev/null @@ -1,5 +0,0 @@ -border.left: 15 -border.top: 4 -border.bottom: 4 -border.right: 15 -source: toolbutton.png diff --git a/examples/declarative-camera/qmlcamera.cpp b/examples/declarative-camera/qmlcamera.cpp deleted file mode 100644 index 697f797..0000000 --- a/examples/declarative-camera/qmlcamera.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Nokia Corporation and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include <QtWidgets/QApplication> -#include <QtWidgets/QDesktopWidget> -#include <QtQuick1/qdeclarativeview.h> -#include <QtDeclarative/QDeclarativeEngine> - -#if !defined(QT_NO_OPENGL) -#include <QtOpenGL/QGLWidget> -#endif - -int main(int argc, char *argv[]) -{ - -#if defined (Q_WS_X11) || defined (Q_WS_MAC) - //### default to using raster graphics backend for now - bool gsSpecified = false; - for (int i = 0; i < argc; ++i) { - QString arg = argv[i]; - if (arg == "-graphicssystem") { - gsSpecified = true; - break; - } - } - - if (!gsSpecified) - QApplication::setGraphicsSystem("raster"); -#endif - - QApplication application(argc, argv); - const QString mainQmlApp = QLatin1String("qrc:/declarative-camera.qml"); - QDeclarativeView view; -#if !defined(QT_NO_OPENGL) - view.setViewport(new QGLWidget); -#endif - view.setSource(QUrl(mainQmlApp)); - view.setResizeMode(QDeclarativeView::SizeRootObjectToView); - // Qt.quit() called in embedded .qml by default only emits - // quit() signal, so do this (optionally use Qt.exit()). - QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit())); -#if defined(Q_WS_MAEMO_6) - view.setGeometry(application.desktop()->screenGeometry()); - view.showFullScreen(); -#else - view.setGeometry(QRect(100, 100, 800, 480)); - view.show(); -#endif - return application.exec(); -} - |