diff options
Diffstat (limited to 'examples/declarative-camera')
-rw-r--r-- | examples/declarative-camera/CaptureControls.qml | 179 | ||||
-rw-r--r-- | examples/declarative-camera/declarative-camera.qml | 12 | ||||
-rw-r--r-- | examples/declarative-camera/qmlcamera.cpp | 2 |
3 files changed, 106 insertions, 87 deletions
diff --git a/examples/declarative-camera/CaptureControls.qml b/examples/declarative-camera/CaptureControls.qml index 77f69b37be..e431b73b52 100644 --- a/examples/declarative-camera/CaptureControls.qml +++ b/examples/declarative-camera/CaptureControls.qml @@ -49,105 +49,124 @@ FocusScope { property alias flashMode : flashModesButton.value property alias exposureCompensation : exposureCompensationButton.value + property int buttonsPanelWidth: buttonPaneShadow.width + signal previewSelected id : captureControls - Column { - spacing : 8 - anchors.right : parent.right - anchors.rightMargin: 8 - anchors.top : parent.top - anchors.topMargin: 8 + 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 - FocusButton { - camera: captureControls.camera - visible: false - } + contentWidth: buttonsColumn.width + contentHeight: buttonsColumn.height - CameraButton { - text: "Capture" - onClicked: camera.captureImage() - } + Column { + id: buttonsColumn + spacing: 8 - 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" + FocusButton { + camera: captureControls.camera } - ListElement { - icon: "images/camera_flash_fill.png" - value: Camera.FlashOn - text: "On" + + CameraButton { + text: "Capture" + onClicked: camera.captureImage() } - ListElement { - icon: "images/camera_flash_redeye.png" - value: Camera.FlashRedEyeReduction - text: "Red Eye Reduction" + + 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" + CameraPropertyButton { + id : wbModesButton value: Camera.WhiteBalanceAuto - text: "Auto" + 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.WhiteBalanceIncandescent + text: "Incandescent" + } + ListElement { + icon: "images/camera_white_balance_flourescent.png" + value: Camera.WhiteBalanceFluorescent + text: "Fluorescent" + } + } } - 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.WhiteBalanceIncandescent - text: "Incandescent" + + ExposureCompensationButton { + id : exposureCompensationButton } - ListElement { - icon: "images/camera_white_balance_flourescent.png" - value: Camera.WhiteBalanceFluorescent - text: "Fluorescent" + + CameraButton { + text: "View" + onClicked: captureControls.previewSelected() + visible: captureControls.previewAvailable } - } - } - ExposureCompensationButton { - id : exposureCompensationButton - } + CameraButton { + id: quitButton + text: "Quit" + onClicked: Qt.quit() + } - CameraButton { - text: "View" - onClicked: captureControls.previewSelected() - visible: captureControls.previewAvailable + } } } - CameraButton { - id: quitButton - anchors.right : parent.right - anchors.rightMargin: 8 - anchors.bottom : parent.bottom - anchors.bottomMargin: 8 - text: "Quit" - onClicked: Qt.quit() - } Item { id: exposureDetails diff --git a/examples/declarative-camera/declarative-camera.qml b/examples/declarative-camera/declarative-camera.qml index 83509e5b36..c5e8accdb2 100644 --- a/examples/declarative-camera/declarative-camera.qml +++ b/examples/declarative-camera/declarative-camera.qml @@ -43,8 +43,6 @@ import QtMultimediaKit 1.1 Rectangle { id : cameraUI - width : 800 - height : 480 color: "black" state: "PhotoCapture" @@ -90,11 +88,11 @@ Rectangle { Camera { id: camera - x : 0 - y : 0 - width : 640 - height : 480 - focus : visible //to receive focus and capture key events + 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 diff --git a/examples/declarative-camera/qmlcamera.cpp b/examples/declarative-camera/qmlcamera.cpp index 77bb408662..62e17a5f91 100644 --- a/examples/declarative-camera/qmlcamera.cpp +++ b/examples/declarative-camera/qmlcamera.cpp @@ -39,6 +39,7 @@ ****************************************************************************/ #include <QtGui/QApplication> +#include <QtGui/QDesktopWidget> #include <QtDeclarative/QDeclarativeView> #include <QtDeclarative/QDeclarativeEngine> @@ -76,6 +77,7 @@ int main(int argc, char *argv[]) // quit() signal, so do this (optionally use Qt.exit()). QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit())); #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) + view.setGeometry(application.desktop()->screenGeometry()); view.showFullScreen(); #else view.setGeometry(QRect(100, 100, 800, 480)); |