diff options
| author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-12 05:31:14 +1000 |
|---|---|---|
| committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-12 05:31:14 +1000 |
| commit | 4a4f87e9429f5c195e349b2da3c6a7ea659807fc (patch) | |
| tree | 512d6afe7a4c3042d272166de9e88dc124c05b0b /doc/src/snippets/multimedia-snippets/camera.cpp | |
| parent | cac4b3d35b37af16cf2b7c9fa5eab954a7e0c747 (diff) | |
| parent | 39aba7e08104d7ab452536d3a9cff2824aedad74 (diff) | |
Merge branch 'master-from-1.1' of scm.dev.nokia.troll.no:qtmobility/qtmobility-integration into master-integration
* 'master-from-1.1' of scm.dev.nokia.troll.no:qtmobility/qtmobility-integration: (68 commits)
fix for pre 4.7.2 Qt versions
Further modifications for the Location crash bug on S60.
fix mediaplayer_s60.pri project file (parse error)
Symbian CameraBE: Fix internal zooming issue
Create define so that MOBILITY-2664 can be easily reproduced
Don't preserve existing landmarks for tests(unless define is used)
linking problem with VS2008 for qlandmarkmanagerplugins autotest
Fix compile
Extends the fix for QTMOBILITY-995 to the satellite source.
Qtmobility defect fix 995
Fix failing auto tests for symbian 5th ed
fix for merge that went awry
Bug id: ou1cimx1#734817
Clarify the state change is not synchronous.
fix spelling
MOBILITY-2648:Wlanserver leaking memory
Symbian CameraBE: QTMOBILITY-1342
QTMOBILITY-1345: QSystemDeviceInfo::imei() method is crashing with KERN-EXEC 0 panic
fix the CI linux-static-check errors
Unstable test. Try to make it a bit more tolerant.
...
Diffstat (limited to 'doc/src/snippets/multimedia-snippets/camera.cpp')
| -rw-r--r-- | doc/src/snippets/multimedia-snippets/camera.cpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/doc/src/snippets/multimedia-snippets/camera.cpp b/doc/src/snippets/multimedia-snippets/camera.cpp new file mode 100644 index 0000000000..453b44fce4 --- /dev/null +++ b/doc/src/snippets/multimedia-snippets/camera.cpp @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** 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 Qt Mobility Components. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/* Camera snippets */ + +#include "qcamera.h" +#include "qcameraviewfinder.h" +#include "qmediarecorder.h" +#include "qcameraimagecapture.h" + +void camera() +{ + QCamera *camera = 0; + QCameraViewfinder *viewfinder = 0; + QMediaRecorder *recorder = 0; + QCameraImageCapture *imageCapture = 0; + + //! [Camera] + camera = new QCamera; + + viewfinder = new QCameraViewfinder(); + viewfinder->show(); + + camera->setViewfinder(viewfinder); + + recorder = new QMediaRecorder(camera); + imageCapture = new QCameraImageCapture(camera); + + camera->setCaptureMode(QCamera::CaptureStillImage); + camera->start(); + //! [Camera] + + //! [Camera keys] + //on half pressed shutter button + camera->searchAndLock(); + + //on shutter button pressed + imageCapture->capture(); + + //on shutter button released + camera->unlock(); + //! [Camera keys] + +} |
