Going to be so bold as to remove this, following posts on the mailing list, as it already also homed at https://projects.developer.nokia.com/QZXing/browser and may not be as maintained or relevant going forward
git-svn-id: https://zxing.googlecode.com/svn/trunk@2713 59b500cc-1b3d-0410-9834-0bbf25fbcc57
1
CHANGES
|
@ -306,6 +306,7 @@
|
|||
|
||||
2.2 (X May 2013)
|
||||
|
||||
- Retire Symbian port
|
||||
- Improved PDF417 decoding, including macro PDF417
|
||||
- Added Aztec and Data Matrix encoders
|
||||
- Added RSS Expanded decoder
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif //QZXING_GLOBAL_H
|
|
@ -1,89 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
#include <QtDeclarative>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_QR_CODE = 1,
|
||||
DecoderFormat_DATA_MATRIX = 2,
|
||||
DecoderFormat_UPC_E = 4,
|
||||
DecoderFormat_UPC_A = 8,
|
||||
DecoderFormat_EAN_8 = 16,
|
||||
DecoderFormat_EAN_13 = 32,
|
||||
DecoderFormat_CODE_128 = 64,
|
||||
DecoderFormat_CODE_39 = 128,
|
||||
DecoderFormat_ITF = 256,
|
||||
DecoderFormat_Aztec = 512
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* As argument it is possible to pass conjuction of decoders by using logic OR.
|
||||
* e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
|
||||
*/
|
||||
void setDecoder(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
*/
|
||||
QString decodeImageQML(QObject *item);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML. Able to set the decoding
|
||||
* of a portion of the image.
|
||||
*/
|
||||
QString decodeSubImageQML(QObject* item,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
QObject* imageHandler;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // QZXING_GLOBAL_H
|
|
@ -1,74 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
#include <QtDeclarative>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_QR_CODE = 1,
|
||||
DecoderFormat_DATA_MATRIX = 2,
|
||||
DecoderFormat_UPC_E = 4,
|
||||
DecoderFormat_UPC_A = 8,
|
||||
DecoderFormat_EAN_8 = 16,
|
||||
DecoderFormat_EAN_13 = 32,
|
||||
DecoderFormat_CODE_128 = 64,
|
||||
DecoderFormat_CODE_39 = 128,
|
||||
DecoderFormat_ITF = 256
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* As argument it is possible to pass conjuction of decoders by using logic OR.
|
||||
* e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
|
||||
*/
|
||||
void setDecoder(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 0, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
#include <QtDeclarative>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_QR_CODE = 1,
|
||||
DecoderFormat_DATA_MATRIX = 2,
|
||||
DecoderFormat_UPC_E = 4,
|
||||
DecoderFormat_UPC_A = 8,
|
||||
DecoderFormat_EAN_8 = 16,
|
||||
DecoderFormat_EAN_13 = 32,
|
||||
DecoderFormat_CODE_128 = 64,
|
||||
DecoderFormat_CODE_39 = 128,
|
||||
DecoderFormat_ITF = 256,
|
||||
DecoderFormat_Aztec = 512
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* As argument it is possible to pass conjuction of decoders by using logic OR.
|
||||
* e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
|
||||
*/
|
||||
void setDecoder(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
*/
|
||||
QString decodeImageQML(QObject *item);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML. Able to set the decoding
|
||||
* of a portion of the image.
|
||||
*/
|
||||
QString decodeSubImageQML(QObject* item,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
QObject* imageHandler;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // QZXING_GLOBAL_H
|
|
@ -1,89 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
#include <QtDeclarative>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_QR_CODE = 1,
|
||||
DecoderFormat_DATA_MATRIX = 2,
|
||||
DecoderFormat_UPC_E = 4,
|
||||
DecoderFormat_UPC_A = 8,
|
||||
DecoderFormat_EAN_8 = 16,
|
||||
DecoderFormat_EAN_13 = 32,
|
||||
DecoderFormat_CODE_128 = 64,
|
||||
DecoderFormat_CODE_39 = 128,
|
||||
DecoderFormat_ITF = 256,
|
||||
DecoderFormat_Aztec = 512
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* As argument it is possible to pass conjuction of decoders by using logic OR.
|
||||
* e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
|
||||
*/
|
||||
void setDecoder(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
*/
|
||||
QString decodeImageQML(QObject *item);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML. Able to set the decoding
|
||||
* of a portion of the image.
|
||||
*/
|
||||
QString decodeSubImageQML(QObject* item,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
QObject* imageHandler;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // QZXING_GLOBAL_H
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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
|
||||
}
|
||||
}
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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
|
||||
}
|
||||
}
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
|
||||
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: "Decode"
|
||||
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.WhiteBalanceIncandescent
|
||||
text: "Incandescent"
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
import QtQuick 1.1
|
||||
import com.nokia.symbian 1.1
|
||||
|
||||
CommonDialog {
|
||||
id: dialog
|
||||
titleText: "Decoded message"
|
||||
//titleIcon: "images/QrButton_toolbar.svg"
|
||||
buttonTexts: ["OK"]
|
||||
|
||||
property alias text: messageLabel.text
|
||||
|
||||
content: Rectangle {
|
||||
height: messageLabel.height
|
||||
width: messageLabel.width
|
||||
color: "#ff000000"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
Text{
|
||||
id: messageLabel
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
TEMPLATE=app
|
||||
|
||||
VERSION = 1.1.0
|
||||
|
||||
QT += declarative network
|
||||
|
||||
!maemo5 {
|
||||
contains(QT_CONFIG, opengl) {
|
||||
# QT += opengl
|
||||
}
|
||||
}
|
||||
|
||||
win32 {
|
||||
#required by Qt SDK to resolve Mobility libraries
|
||||
CONFIG+=mobility
|
||||
MOBILITY+=multimedia
|
||||
}
|
||||
|
||||
SOURCES += $$PWD/qmlcamera.cpp
|
||||
!mac:TARGET = QMLBarcodeReader
|
||||
else:TARGET = QMLBarcodeReader
|
||||
|
||||
RESOURCES += declarative-camera.qrc
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = UserEnvironment NetworkServices Location ReadUserData WriteUserData
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
|
||||
LIBS += -lqzxing
|
||||
|
||||
customrules.pkg_prerules = \
|
||||
";QZXing" \
|
||||
"@\"$$(EPOCROOT)Epoc32/InstallToDevice/QZXing_selfsigned.sis\",(0xE618743C)"\
|
||||
" "
|
||||
DEPLOYMENT += customrules
|
||||
}
|
||||
|
||||
ICON = QMLBarcodeReader.svg
|
|
@ -1,22 +0,0 @@
|
|||
// ============================================================================
|
||||
// * Generated by qmake (2.01a) (Qt 4.7.4) on: 2012-05-19T19:03:01
|
||||
// * This file is generated by qmake and should not be modified by the
|
||||
// * user.
|
||||
// ============================================================================
|
||||
|
||||
CHARACTER_SET UTF8
|
||||
#include <appinfo.rh>
|
||||
#include "QMLBarcodeReader.loc"
|
||||
|
||||
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
|
||||
{
|
||||
short_caption = STRING_r_short_caption;
|
||||
caption_and_icon =
|
||||
CAPTION_AND_ICON_INFO
|
||||
{
|
||||
caption = STRING_r_caption;
|
||||
number_of_icons = 0;
|
||||
icon_file = "\\resource\\apps\\QMLBarcodeReader.mif";
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 38 KiB |
|
@ -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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
|
||||
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 }
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,90 +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 Mobility Components.
|
||||
**
|
||||
** $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 QtMultimediaKit 1.1
|
||||
import QZXing 1.2
|
||||
|
||||
Rectangle {
|
||||
id : cameraUI
|
||||
color: "black"
|
||||
|
||||
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 : {
|
||||
imageToDecode.source = preview
|
||||
decoder.decodeImageQML(imageToDecode);
|
||||
}
|
||||
}
|
||||
|
||||
Image{
|
||||
id: imageToDecode
|
||||
visible: false
|
||||
}
|
||||
|
||||
CaptureControls {
|
||||
id: stillControls
|
||||
anchors.fill: parent
|
||||
camera: camera
|
||||
}
|
||||
|
||||
MessageDialog{
|
||||
id:dialog
|
||||
}
|
||||
|
||||
QZXing{
|
||||
id: decoder
|
||||
onTagFound: {
|
||||
dialog.text = tag
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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" ]
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
<RCC>
|
||||
<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>
|
||||
<file>MessageDialog.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
Before Width: | Height: | Size: 778 B |
Before Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 945 B |
Before Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 600 B |
Before Width: | Height: | Size: 587 B |
Before Width: | Height: | Size: 2.5 KiB |
|
@ -1,5 +0,0 @@
|
|||
border.left: 15
|
||||
border.top: 4
|
||||
border.bottom: 4
|
||||
border.right: 15
|
||||
source: toolbutton.png
|
|
@ -1,92 +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 Mobility Components.
|
||||
**
|
||||
** $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 <QtGui/QApplication>
|
||||
#include <QtGui/QDesktopWidget>
|
||||
#include <QtDeclarative/QDeclarativeView>
|
||||
#include <QtDeclarative/QDeclarativeEngine>
|
||||
|
||||
#include <QZXing.h>
|
||||
|
||||
#if !defined(QT_NO_OPENGL)
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
QZXing::registerQMLTypes();
|
||||
|
||||
#if defined (Q_WS_X11) || defined (Q_WS_MAC) || defined (Q_OS_SYMBIAN)
|
||||
//### 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) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_S60)
|
||||
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_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));
|
||||
view.show();
|
||||
#endif
|
||||
return application.exec();
|
||||
}
|
||||
|
14
symbian/QZXing/examples/QQrDecoder/.gitignore
vendored
|
@ -1,14 +0,0 @@
|
|||
moc/
|
||||
obj/
|
||||
rcc/
|
||||
tmp/
|
||||
ui/
|
||||
.make.cache
|
||||
*.BAT
|
||||
*.inf
|
||||
Makefile
|
||||
*.mk
|
||||
*.loc
|
||||
*.user
|
||||
*.mmp
|
||||
*.pkg
|
|
@ -1,128 +0,0 @@
|
|||
#include "CameraImageWrapper.h"
|
||||
#include <QColor>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
CameraImageWrapper::CameraImageWrapper() : LuminanceSource()
|
||||
{
|
||||
}
|
||||
|
||||
CameraImageWrapper::CameraImageWrapper(CameraImageWrapper& otherInstance) : LuminanceSource()
|
||||
{
|
||||
image = otherInstance.getOriginalImage().copy();
|
||||
}
|
||||
|
||||
CameraImageWrapper::~CameraImageWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
int CameraImageWrapper::getWidth() const
|
||||
{
|
||||
return image.width();
|
||||
}
|
||||
|
||||
int CameraImageWrapper::getHeight() const
|
||||
{
|
||||
return image.height();
|
||||
}
|
||||
|
||||
unsigned char CameraImageWrapper::getPixel(int x, int y) const
|
||||
{
|
||||
QRgb pixel = image.pixel(x,y);
|
||||
|
||||
return qGray(pixel);//((qRed(pixel) + qGreen(pixel) + qBlue(pixel)) / 3);
|
||||
}
|
||||
|
||||
unsigned char* CameraImageWrapper::copyMatrix() const
|
||||
{
|
||||
unsigned char* newMatrix = (unsigned char*)malloc(image.width()*image.height()*sizeof(unsigned char));
|
||||
|
||||
int cnt = 0;
|
||||
for(int i=0; i<image.width(); i++)
|
||||
{
|
||||
for(int j=0; j<image.height(); j++)
|
||||
{
|
||||
newMatrix[cnt++] = getPixel(i,j);
|
||||
}
|
||||
}
|
||||
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
void CameraImageWrapper::setImage(QString fileName)
|
||||
{
|
||||
image.load(fileName);
|
||||
|
||||
if(image.width() > QApplication::desktop()->width())
|
||||
image = image.scaled(QApplication::desktop()->width(), image.height(), Qt::IgnoreAspectRatio);
|
||||
|
||||
if(image.height() > QApplication::desktop()->height())
|
||||
image = image.scaled(image.width(), QApplication::desktop()->height(), Qt::IgnoreAspectRatio);
|
||||
}
|
||||
|
||||
void CameraImageWrapper::setImage(QImage newImage)
|
||||
{
|
||||
image = newImage.copy();
|
||||
|
||||
if(image.width() > 640)
|
||||
image = image.scaled(640, image.height(), Qt::KeepAspectRatio);
|
||||
}
|
||||
|
||||
QImage CameraImageWrapper::grayScaleImage(QImage::Format f)
|
||||
{
|
||||
QImage tmp(image.width(), image.height(), f);
|
||||
for(int i=0; i<image.width(); i++)
|
||||
{
|
||||
for(int j=0; j<image.height(); j++)
|
||||
{
|
||||
int pix = (int)getPixel(i,j);
|
||||
tmp.setPixel(i,j, qRgb(pix ,pix,pix));
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
|
||||
//return image.convertToFormat(f);
|
||||
}
|
||||
|
||||
QImage CameraImageWrapper::getOriginalImage()
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
unsigned char* CameraImageWrapper::getRow(int y, unsigned char* row)
|
||||
{
|
||||
int width = getWidth();
|
||||
|
||||
if (row == NULL)
|
||||
{
|
||||
row = new unsigned char[width];
|
||||
pRow = row;
|
||||
}
|
||||
|
||||
for (int x = 0; x < width; x++)
|
||||
row[x] = getPixel(x,y);
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
unsigned char* CameraImageWrapper::getMatrix()
|
||||
{
|
||||
int width = getWidth();
|
||||
int height = getHeight();
|
||||
unsigned char* matrix = new unsigned char[width*height];
|
||||
unsigned char* m = matrix;
|
||||
|
||||
for(int y=0; y<height; y++)
|
||||
{
|
||||
unsigned char* tmpRow;
|
||||
memcpy(m, tmpRow = getRow(y, NULL), width);
|
||||
m += width * sizeof(unsigned char);
|
||||
|
||||
delete tmpRow;
|
||||
}
|
||||
|
||||
pMatrix = matrix;
|
||||
return matrix;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
#ifndef CAMERAIMAGE_H
|
||||
#define CAMERAIMAGE_H
|
||||
|
||||
#include <QImage>
|
||||
#include <QString>
|
||||
#include <zxing/LuminanceSource.h>
|
||||
|
||||
using namespace zxing;
|
||||
|
||||
class CameraImageWrapper : public LuminanceSource
|
||||
{
|
||||
public:
|
||||
CameraImageWrapper();
|
||||
CameraImageWrapper(QImage& image);
|
||||
CameraImageWrapper(CameraImageWrapper& otherInstance);
|
||||
~CameraImageWrapper();
|
||||
|
||||
int getWidth() const;
|
||||
int getHeight() const;
|
||||
|
||||
unsigned char getPixel(int x, int y) const;
|
||||
unsigned char* copyMatrix() const;
|
||||
|
||||
void setImage(QString fileName);
|
||||
void setImage(QImage newImage);
|
||||
QImage grayScaleImage(QImage::Format f);
|
||||
QImage getOriginalImage();
|
||||
|
||||
|
||||
// Callers take ownership of the returned memory and must call delete [] on it themselves.
|
||||
unsigned char* getRow(int y, unsigned char* row);
|
||||
unsigned char* getMatrix();
|
||||
|
||||
private:
|
||||
QImage image;
|
||||
unsigned char* pRow;
|
||||
unsigned char* pMatrix;
|
||||
};
|
||||
|
||||
#endif //CAMERAIMAGE_H
|
|
@ -1,103 +0,0 @@
|
|||
#include "myvideosurface.h"
|
||||
|
||||
MyVideoSurface::MyVideoSurface(QWidget* widget, VideoIF* target, QObject* parent)
|
||||
: QAbstractVideoSurface(parent)
|
||||
{
|
||||
m_targetWidget = widget;
|
||||
m_target = target;
|
||||
m_imageFormat = QImage::Format_Invalid;
|
||||
|
||||
// timer = new QTimer(this);
|
||||
// connect(timer, SIGNAL(timeout()), this, SLOT(sendImageToDecode()));
|
||||
// timer->start(500);
|
||||
}
|
||||
|
||||
MyVideoSurface::~MyVideoSurface()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyVideoSurface::start(const QVideoSurfaceFormat &format)
|
||||
{
|
||||
m_videoFormat = format;
|
||||
const QImage::Format imageFormat = QVideoFrame::imageFormatFromPixelFormat(format.pixelFormat());
|
||||
const QSize size = format.frameSize();
|
||||
|
||||
if (imageFormat != QImage::Format_Invalid && !size.isEmpty()) {
|
||||
m_imageFormat = imageFormat;
|
||||
QAbstractVideoSurface::start(format);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool MyVideoSurface::present(const QVideoFrame &frame)
|
||||
{
|
||||
m_frame = frame;
|
||||
if (surfaceFormat().pixelFormat() != m_frame.pixelFormat() ||
|
||||
surfaceFormat().frameSize() != m_frame.size()) {
|
||||
stop();
|
||||
return false;
|
||||
} else {
|
||||
m_target->updateVideo();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void MyVideoSurface::paint(QPainter *painter)
|
||||
{
|
||||
if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) {
|
||||
QImage image(
|
||||
m_frame.bits(),
|
||||
m_frame.width(),
|
||||
m_frame.height(),
|
||||
m_frame.bytesPerLine(),
|
||||
m_imageFormat);
|
||||
|
||||
QRect r = m_targetWidget->rect();
|
||||
QPoint centerPic((qAbs(r.size().width() - image.size().width())) / 2, (qAbs(
|
||||
r.size().height() - image.size().height())) / 2);
|
||||
|
||||
if (!image.isNull()) {
|
||||
painter->drawImage(centerPic,image);
|
||||
}
|
||||
|
||||
m_frame.unmap();
|
||||
}
|
||||
}
|
||||
|
||||
QList<QVideoFrame::PixelFormat> MyVideoSurface::supportedPixelFormats(
|
||||
QAbstractVideoBuffer::HandleType handleType) const
|
||||
{
|
||||
if (handleType == QAbstractVideoBuffer::NoHandle) {
|
||||
return QList<QVideoFrame::PixelFormat>()
|
||||
<< QVideoFrame::Format_UYVY
|
||||
<< QVideoFrame::Format_RGB32
|
||||
<< QVideoFrame::Format_ARGB32
|
||||
<< QVideoFrame::Format_ARGB32_Premultiplied
|
||||
<< QVideoFrame::Format_RGB565
|
||||
<< QVideoFrame::Format_RGB555;
|
||||
} else {
|
||||
return QList<QVideoFrame::PixelFormat>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// disabled it: 1.2.1
|
||||
void MyVideoSurface::sendImageToDecode()
|
||||
{
|
||||
if (m_frame.map(QAbstractVideoBuffer::ReadOnly)) {
|
||||
QImage image(
|
||||
m_frame.bits(),
|
||||
m_frame.width(),
|
||||
m_frame.height(),
|
||||
m_frame.bytesPerLine(),
|
||||
m_imageFormat);
|
||||
|
||||
if (!image.isNull())
|
||||
emit imageCaptured(image);
|
||||
|
||||
m_frame.unmap();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the demonstration applications 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$
|
||||
**
|
||||
****************************************************************************/
|
|
@ -1,454 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the demonstration applications 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 "QCameraControllerWidget.h"
|
||||
//#include <QDebug>
|
||||
#include <QCameraFlashControl>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* QCameraControllerWidget
|
||||
*/
|
||||
QCameraControllerWidget::QCameraControllerWidget(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
setWindowTitle("QCameraControllerWidget");
|
||||
|
||||
// Opitimizations for screen update and drawing qwidget
|
||||
setAutoFillBackground(false);
|
||||
|
||||
// Prevent to screensaver to activate
|
||||
// m_systemScreenSaver = new QSystemScreenSaver(this);
|
||||
// m_systemScreenSaver->setScreenSaverInhibit();
|
||||
|
||||
m_myVideoSurface = 0;
|
||||
pictureCaptured = false;
|
||||
showViewFinder = false;
|
||||
m_focusing = false;
|
||||
|
||||
// Black background
|
||||
QPalette palette = this->palette();
|
||||
palette.setColor(QPalette::Background, Qt::black);
|
||||
setPalette(palette);
|
||||
|
||||
// Main widget & layout
|
||||
// QWidget* mainWidget = new QWidget(this);
|
||||
setPalette(palette);
|
||||
|
||||
QHBoxLayout* hboxl = new QHBoxLayout;
|
||||
hboxl->setSpacing(0);
|
||||
hboxl->setMargin(0);
|
||||
|
||||
// UI stack
|
||||
m_stackedWidget = new QStackedWidget();
|
||||
m_stackedWidget->setPalette(palette);
|
||||
|
||||
// First widget to stack
|
||||
m_videoWidget = new QWidget();
|
||||
m_videoWidget->setPalette(palette);
|
||||
m_stackedWidget->addWidget(m_videoWidget);
|
||||
|
||||
// Second widget to stack
|
||||
QWidget* secondWidget = new QWidget(this);
|
||||
secondWidget->setPalette(palette);
|
||||
m_stackedWidget->addWidget(secondWidget);
|
||||
m_stackedWidget->setCurrentIndex(0);
|
||||
|
||||
|
||||
// Buttons
|
||||
QSize iconSize(80, 80);
|
||||
QVBoxLayout* vboxl = new QVBoxLayout;
|
||||
vboxl->setSpacing(0);
|
||||
vboxl->setMargin(0);
|
||||
|
||||
zoomIn = new Button(this);
|
||||
QObject::connect(zoomIn, SIGNAL(pressed()), this, SLOT(onZoomIn()));
|
||||
QPixmap p = QPixmap(":/icons/zoomIn");
|
||||
zoomIn->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
vboxl->addWidget(zoomIn);
|
||||
vboxl->setAlignment(zoomIn,Qt::AlignTop | Qt::AlignHCenter);
|
||||
|
||||
captButton = new Button(this);
|
||||
QObject::connect(captButton, SIGNAL(pressed()), this, SLOT(searchAndLock()));
|
||||
p = QPixmap(":/icons/camera");
|
||||
captButton->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
vboxl->addWidget(captButton);
|
||||
vboxl->setAlignment(captButton, Qt::AlignHCenter);
|
||||
|
||||
zoomOut = new Button(this);
|
||||
QObject::connect(zoomOut, SIGNAL(pressed()), this, SLOT(onZoomOut()));
|
||||
p = QPixmap(":/icons/zoomOut");
|
||||
zoomOut->setPixmap(p.scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
vboxl->addWidget(zoomOut);
|
||||
vboxl->setAlignment(zoomOut, Qt::AlignBottom | Qt::AlignHCenter);
|
||||
|
||||
//hboxl->addLayout(vboxl);
|
||||
hboxl->addWidget(m_stackedWidget);
|
||||
hboxl->addLayout(vboxl);
|
||||
|
||||
setLayout(hboxl);
|
||||
|
||||
fileWatcher = new QFileSystemWatcher();
|
||||
fileWatcher->addPath(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
|
||||
connect(fileWatcher, SIGNAL( directoryChanged (const QString &)), this, SLOT(deleteImage(const QString &)));
|
||||
|
||||
imageFolder = QDir(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
|
||||
QStringList filters;
|
||||
filters << "camera*";
|
||||
imageFolder.setNameFilters(filters);
|
||||
|
||||
// Enable camera after 1s, so that the application is started
|
||||
// and widget is created to landscape orientation
|
||||
QTimer::singleShot(1000,this,SLOT(enableCamera()));
|
||||
}
|
||||
|
||||
QCameraControllerWidget::~QCameraControllerWidget()
|
||||
{
|
||||
if (m_myVideoSurface)
|
||||
m_myVideoSurface->stop();
|
||||
m_camera->stop();
|
||||
delete m_stackedWidget;
|
||||
delete m_stillImageCapture;
|
||||
delete m_camera;
|
||||
delete fileWatcher;
|
||||
}
|
||||
|
||||
|
||||
void QCameraControllerWidget::enableCamera()
|
||||
{
|
||||
|
||||
//QVideoFrame::Format_UYVY;
|
||||
m_camera = new QCamera();
|
||||
m_camera->setCaptureMode(QCamera::CaptureStillImage);
|
||||
connect(m_camera, SIGNAL(error(QCamera::Error)), this, SLOT(error(QCamera::Error)));
|
||||
connect(m_camera, SIGNAL(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)), this, SLOT(lockStatusChanged(QCamera::LockStatus,QCamera::LockChangeReason)));
|
||||
connect(m_camera, SIGNAL(stateChanged( QCamera::State) ), this, SLOT(onStateChanged(QCamera::State)));
|
||||
|
||||
// Own video output drawing that shows camera view finder pictures
|
||||
//! [0]
|
||||
QMediaService* ms = m_camera->service();
|
||||
QVideoRendererControl* vrc = ms->requestControl<QVideoRendererControl*>();
|
||||
m_myVideoSurface = new MyVideoSurface(this,this,this);
|
||||
vrc->setSurface(m_myVideoSurface);
|
||||
|
||||
connect(m_myVideoSurface, SIGNAL(imageCaptured(QImage)), this, SLOT(redirectImageSignalFromVideoFinder(QImage)));
|
||||
|
||||
//! [0]
|
||||
// Image capturer
|
||||
m_stillImageCapture = new QCameraImageCapture(m_camera);
|
||||
connect(m_stillImageCapture, SIGNAL(imageCaptured(int,QImage)), this, SLOT(onImageCaptured(int,QImage)));
|
||||
|
||||
// Start camera
|
||||
if (m_camera->state() == QCamera::ActiveState) {
|
||||
m_camera->stop();
|
||||
}
|
||||
m_videoWidget->show();
|
||||
m_camera->start();
|
||||
showViewFinder = true;
|
||||
|
||||
cameraFocus = m_camera->focus();
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
QWidget::mousePressEvent(event);
|
||||
|
||||
if (pictureCaptured) {
|
||||
// Starting view finder
|
||||
pictureCaptured = false;
|
||||
m_stackedWidget->setCurrentIndex(0);
|
||||
if (m_myVideoSurface) {
|
||||
showViewFinder = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::searchAndLock()
|
||||
{
|
||||
m_focusing = false;
|
||||
m_focusMessage.clear();
|
||||
|
||||
if (pictureCaptured) {
|
||||
// Starting view finder again
|
||||
pictureCaptured = false;
|
||||
m_stackedWidget->setCurrentIndex(0);
|
||||
if (m_myVideoSurface) {
|
||||
showViewFinder = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Search and lock picture (=focus)
|
||||
if (m_camera->supportedLocks() & QCamera::LockFocus) {
|
||||
m_focusing = true;
|
||||
m_focusMessage = "Focusing...";
|
||||
m_camera->searchAndLock(QCamera::LockFocus);
|
||||
} else {
|
||||
// No focus functionality, take picture right away
|
||||
captureImage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason)
|
||||
{
|
||||
if (status == QCamera::Locked) {
|
||||
if (reason == QCamera::LockAcquired) {
|
||||
// Focus locked
|
||||
m_focusMessage.clear();
|
||||
m_focusing = false;
|
||||
// Capture new image
|
||||
captureImage();
|
||||
// Unlock camera
|
||||
m_camera->unlock();
|
||||
} else {
|
||||
if (m_focusing)
|
||||
m_focusMessage = "No focus, try again";
|
||||
}
|
||||
} else if (status == QCamera::Unlocked && m_focusing) {
|
||||
m_focusMessage = "No focus, try again";
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::captureImage()
|
||||
{
|
||||
if (pictureCaptured) {
|
||||
// Starting view finder again
|
||||
pictureCaptured = false;
|
||||
m_stackedWidget->setCurrentIndex(0);
|
||||
showViewFinder = true;
|
||||
}
|
||||
else {
|
||||
// Capturing image
|
||||
showViewFinder = false;
|
||||
// Get picture location where to store captured images
|
||||
// QString path(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
|
||||
// QDir dir(path);
|
||||
|
||||
// Get next filename
|
||||
// QStringList files = dir.entryList(QStringList() << "camera");//_*.jpg");
|
||||
// int lastImage = 0;
|
||||
// foreach ( QString fileName, files ) {
|
||||
// int imgNumber = fileName.mid(7, fileName.size() - 11).toInt();
|
||||
// lastImage = qMax(lastImage, imgNumber);
|
||||
// }
|
||||
// Capture image
|
||||
if (m_stillImageCapture->isReadyForCapture()) {
|
||||
m_imageName = QString("camera_0");//%1.jpg").arg(lastImage+1);
|
||||
m_stillImageCapture->capture(m_imageName);
|
||||
}
|
||||
}
|
||||
|
||||
m_camera->unlock();
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::onImageCaptured(int id, const QImage &preview)
|
||||
{
|
||||
m_stillImageCapture->cancelCapture();
|
||||
// showViewFinder = false;
|
||||
m_focusing = false;
|
||||
pictureCaptured = true;
|
||||
captureImage(); // added this line to restart viewfinder
|
||||
emit imageCaptured(preview);
|
||||
//qdebug() << "Image sent for decoding";
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::deleteImage(const QString & folderPath)
|
||||
{
|
||||
//qdebug() << "Detected change to folder: " << folderPath;
|
||||
QStringList files = imageFolder.entryList(imageFolder.nameFilters());
|
||||
|
||||
for(int i=0; i<files.size(); i++)
|
||||
{
|
||||
QString image = files[i];
|
||||
//qdebug() << "Checking file: " << image;
|
||||
if(image.startsWith("camera"))
|
||||
{
|
||||
QString path(QDesktopServices::storageLocation(QDesktopServices::PicturesLocation));
|
||||
QDir pathDir(path);
|
||||
pathDir.remove(image);
|
||||
//qdebug() << "file deleted: " << image;
|
||||
|
||||
// QStringList filters;
|
||||
// filters << "*.cpp" << "*.cxx" << "*.cc";
|
||||
// dir.setNameFilters(filters);
|
||||
}
|
||||
// QMessageBox msgBox;
|
||||
// msgBox.setText(image);
|
||||
// msgBox.exec();
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::error(QCamera::Error e)
|
||||
{
|
||||
switch (e) {
|
||||
case QCamera::NoError:
|
||||
{
|
||||
break;
|
||||
}
|
||||
case QCamera::CameraError:
|
||||
{
|
||||
QMessageBox::warning(this, "QCameraControllerWidget", "General Camera error");
|
||||
break;
|
||||
}
|
||||
case QCamera::InvalidRequestError:
|
||||
{
|
||||
QMessageBox::warning(this, "QCameraControllerWidget", "Camera invalid request error");
|
||||
break;
|
||||
}
|
||||
case QCamera::ServiceMissingError:
|
||||
{
|
||||
QMessageBox::warning(this, "QCameraControllerWidget", "Camera service missing error");
|
||||
break;
|
||||
}
|
||||
case QCamera::NotSupportedFeatureError :
|
||||
{
|
||||
QMessageBox::warning(this, "QCameraControllerWidget", "Camera not supported error");
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::updateVideo()
|
||||
{
|
||||
if (showViewFinder) {
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
//QMainWindow::paintEvent(event);
|
||||
|
||||
QPainter painter(this);
|
||||
QRect r = this->rect();
|
||||
|
||||
QFont font = painter.font();
|
||||
font.setPixelSize(20);
|
||||
painter.setFont(font);
|
||||
painter.setPen(Qt::white);
|
||||
|
||||
if (showViewFinder && m_myVideoSurface && m_myVideoSurface->isActive()) {
|
||||
// Show view finder
|
||||
m_myVideoSurface->paint(&painter);
|
||||
|
||||
// Paint focus message
|
||||
if (!m_focusMessage.isEmpty())
|
||||
painter.drawText(r, Qt::AlignCenter, m_focusMessage);
|
||||
|
||||
} else {
|
||||
painter.fillRect(event->rect(), palette().background());
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::redirectImageSignalFromVideoFinder(QImage image)
|
||||
{
|
||||
emit imageCaptured(image);
|
||||
}
|
||||
|
||||
|
||||
void QCameraControllerWidget::onZoomIn()
|
||||
{
|
||||
qreal optical = cameraFocus->opticalZoom();
|
||||
qreal digital = cameraFocus->digitalZoom();
|
||||
|
||||
if(optical == cameraFocus->maximumOpticalZoom())
|
||||
cameraFocus->zoomTo(optical, digital + 0.1);
|
||||
else
|
||||
cameraFocus->zoomTo(optical + 0.1, 1.0);
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::onZoomOut()
|
||||
{
|
||||
qreal optical = cameraFocus->opticalZoom();
|
||||
qreal digital = cameraFocus->digitalZoom();
|
||||
|
||||
|
||||
if(optical == cameraFocus->maximumOpticalZoom() && digital != 0.0)
|
||||
{
|
||||
if(digital - 0.1 >= 1)
|
||||
cameraFocus->zoomTo(optical, digital - 0.1);
|
||||
else
|
||||
cameraFocus->zoomTo(optical, 1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(optical - 0.1 >= 1)
|
||||
cameraFocus->zoomTo(optical - 0.1, 1.0);
|
||||
else
|
||||
cameraFocus->zoomTo(1.0, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
void QCameraControllerWidget::onStateChanged(QCamera::State state)
|
||||
{
|
||||
if(state == QCamera::ActiveState)
|
||||
{
|
||||
// cameraFocus->setFocusMode(QCameraFocus::AutoFocus);
|
||||
// cameraFocus->setFocusPointMode(QCameraFocus::FocusPointAuto);
|
||||
}
|
||||
}
|
||||
|
||||
//void QCameraControllerWidget::toggleFlash()
|
||||
//{
|
||||
// if(!m_camera)
|
||||
// return;
|
||||
|
||||
// QCameraExposure* cameraexpo = m_camera->exposure();
|
||||
// if(!cameraexpo)
|
||||
// return;
|
||||
|
||||
// if(!flash->isPressed())
|
||||
// cameraexpo->setFlashMode(QCameraExposure::FlashOff);
|
||||
// else
|
||||
// {
|
||||
// if(cameraexpo->isFlashModeSupported(QCameraExposure::FlashTorch))
|
||||
// {
|
||||
// cameraexpo->setFlashMode(QCameraExposure::FlashTorch);
|
||||
// flash->disableBtn(false);
|
||||
// }
|
||||
// else if(cameraexpo->isFlashModeSupported(QCameraExposure::FlashOn))
|
||||
// {
|
||||
// cameraexpo->setFlashMode(QCameraExposure::FlashOn);
|
||||
// flash->disableBtn(false);
|
||||
// }
|
||||
// else
|
||||
// flash->disableBtn(true);
|
||||
// }
|
||||
//}
|
|
@ -1,122 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the demonstration applications 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$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QCAMERAEXAMPLE_H
|
||||
#define QCAMERAEXAMPLE_H
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
// Multimedia API in QtMobility API
|
||||
// Unlike the other APIs in Qt Mobility,
|
||||
// the Multimedia API is not in the QtMobility namespace "QTM_USE_NAMESPACE"
|
||||
#include <QCamera>
|
||||
#include <QCameraImageCapture>
|
||||
#include <QCameraFocus>
|
||||
#include <QTimer>
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
// QtMobility API
|
||||
//#include <QSystemScreenSaver>
|
||||
//QTM_USE_NAMESPACE
|
||||
|
||||
#include "myvideosurface.h"
|
||||
#include "button.h"
|
||||
|
||||
|
||||
class QCameraControllerWidget: public QWidget, public VideoIF
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCameraControllerWidget(QWidget *parent = 0);
|
||||
~QCameraControllerWidget();
|
||||
|
||||
void paintEvent(QPaintEvent*);
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
|
||||
void updateVideo();
|
||||
|
||||
|
||||
public slots:
|
||||
void enableCamera();
|
||||
void lockStatusChanged(QCamera::LockStatus status, QCamera::LockChangeReason reason);
|
||||
void searchAndLock();
|
||||
void captureImage();
|
||||
void onImageCaptured(int id, const QImage &preview);
|
||||
void error(QCamera::Error);
|
||||
void redirectImageSignalFromVideoFinder(QImage image);
|
||||
|
||||
void onStateChanged(QCamera::State state) ;
|
||||
void onZoomIn();
|
||||
void onZoomOut();
|
||||
void deleteImage(const QString & folderPath);
|
||||
|
||||
//void toggleFlash();
|
||||
|
||||
|
||||
signals:
|
||||
void imageCaptured(QImage image);
|
||||
|
||||
private:
|
||||
QWidget* m_videoWidget;
|
||||
QWidget* zoomButtons;
|
||||
QCamera* m_camera;
|
||||
QCameraImageCapture* m_stillImageCapture;
|
||||
|
||||
QStackedWidget* m_stackedWidget;
|
||||
Button* zoomIn;
|
||||
Button* zoomOut;
|
||||
Button* captButton;
|
||||
QImage m_capturedImage;
|
||||
QString m_imageName;
|
||||
QString m_focusMessage;
|
||||
bool m_focusing;
|
||||
QString m_phoneNumber;
|
||||
|
||||
bool bufferingSupported;
|
||||
bool pictureCaptured;
|
||||
bool showViewFinder;
|
||||
MyVideoSurface* m_myVideoSurface;
|
||||
QCameraFocus* cameraFocus;
|
||||
QFileSystemWatcher* fileWatcher;
|
||||
QDir imageFolder;
|
||||
};
|
||||
|
||||
#endif // QCAMERA_H
|
|
@ -1,62 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Trolltech hereby grants a license to use the Qt/Eclipse Integration
|
||||
** plug-in (the software contained herein), in binary form, solely for the
|
||||
** purpose of creating code to be used with Trolltech's Qt software.
|
||||
**
|
||||
** Qt Designer is licensed under the terms of the GNU General Public
|
||||
** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
|
||||
** right to use certain no GPL licensed software under the terms of its GPL
|
||||
** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "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."
|
||||
**
|
||||
** Since we now have the GPL exception I think that the "special exception
|
||||
** is no longer needed. The license text proposed above (other than the
|
||||
** special exception portion of it) is the BSD license and we have added
|
||||
** the BSD license as a permissible license under the exception.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "QQrDecoder.h"
|
||||
#include <QFileDialog>
|
||||
#include <QGraphicsView>
|
||||
#include <QPainter>
|
||||
#include <QPoint>
|
||||
#include <QPixmap>
|
||||
#include <QMessageBox>
|
||||
|
||||
QQrDecoder::QQrDecoder(QWidget *parent): QMainWindow(parent), decoder(this)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
connect(ui.centralwidget, SIGNAL(imageCaptured(QImage)), this, SLOT(decodeImage(QImage)));
|
||||
connect(&decoder, SIGNAL(tagFound(QString)), this, SLOT(reportTagFound(QString)));
|
||||
|
||||
//by default all decoders available are enabled
|
||||
//decoder.setDecoder( QZXing::DecoderFormat_DATA_MATRIX);
|
||||
//decoder.setDecoder( QZXing::DecoderFormat_Aztec );
|
||||
}
|
||||
|
||||
QQrDecoder::~QQrDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
void QQrDecoder::decodeImage(QImage originalImage)
|
||||
{
|
||||
decoder.decodeImage(originalImage);
|
||||
}
|
||||
|
||||
void QQrDecoder::reportTagFound(QString tag)
|
||||
{
|
||||
QMessageBox::information((QWidget*)ui.centralwidget, QString("Decoding result") ,tag);
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Trolltech hereby grants a license to use the Qt/Eclipse Integration
|
||||
** plug-in (the software contained herein), in binary form, solely for the
|
||||
** purpose of creating code to be used with Trolltech's Qt software.
|
||||
**
|
||||
** Qt Designer is licensed under the terms of the GNU General Public
|
||||
** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
|
||||
** right to use certain no GPL licensed software under the terms of its GPL
|
||||
** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "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."
|
||||
**
|
||||
** Since we now have the GPL exception I think that the "special exception
|
||||
** is no longer needed. The license text proposed above (other than the
|
||||
** special exception portion of it) is the BSD license and we have added
|
||||
** the BSD license as a permissible license under the exception.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QQRDECODER_H
|
||||
#define QQRDECODER_H
|
||||
|
||||
#include <QtGui/QMainWindow>
|
||||
#include <QPixmap>
|
||||
#include "ui_QQrDecoder.h"
|
||||
#include <qzxing.h>
|
||||
|
||||
class QQrDecoder : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QQrDecoder(QWidget *parent = 0);
|
||||
~QQrDecoder();
|
||||
|
||||
protected slots:
|
||||
void decodeImage(QImage originalImage);
|
||||
void reportTagFound(QString tag);
|
||||
|
||||
private:
|
||||
Ui::QQrDecoder ui;
|
||||
QZXing decoder;
|
||||
};
|
||||
|
||||
#endif // QQRDECODER_H
|
|
@ -1,53 +0,0 @@
|
|||
TEMPLATE = app
|
||||
TARGET = QQrDecoder
|
||||
QT += core \
|
||||
gui \
|
||||
declarative
|
||||
|
||||
VERSION = 1.3.0
|
||||
|
||||
CONFIG += mobility
|
||||
MOBILITY = multimedia #\
|
||||
#systeminfo
|
||||
|
||||
RESOURCES += resources.qrc
|
||||
|
||||
HEADERS += QQrDecoder.h \
|
||||
QCameraControllerWidget.h \
|
||||
button.h \
|
||||
myvideosurface.h
|
||||
SOURCES += main.cpp \
|
||||
QQrDecoder.cpp \
|
||||
QCameraControllerWidget.cpp \
|
||||
button.cpp \
|
||||
myvideosurface.cpp
|
||||
FORMS += QQrDecoder.ui
|
||||
|
||||
symbian{
|
||||
TARGET.UID3 = 0xEF2CE79D
|
||||
TARGET.EPOCSTACKSIZE = 0x14000
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x8000000
|
||||
|
||||
# Because landscape orientation lock
|
||||
LIBS += -lcone -leikcore -lavkon -lqzxing
|
||||
|
||||
# Self-signing capabilities
|
||||
TARGET.CAPABILITY += NetworkServices \
|
||||
ReadUserData \
|
||||
WriteUserData \
|
||||
LocalServices \
|
||||
UserEnvironment
|
||||
|
||||
customrules.pkg_prerules = \
|
||||
";QZXing" \
|
||||
"@\"$$(EPOCROOT)Epoc32/InstallToDevice/QZXing_selfsigned.sis\",(0xE618743C)"\
|
||||
" "
|
||||
DEPLOYMENT += customrules
|
||||
}
|
||||
|
||||
ICON = QQrDecoder.svg
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
// ============================================================================
|
||||
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2012-05-14T15:44:30
|
||||
// * This file is generated by qmake and should not be modified by the
|
||||
// * user.
|
||||
// ============================================================================
|
||||
|
||||
CHARACTER_SET UTF8
|
||||
#include <appinfo.rh>
|
||||
#include "QQrDecoder.loc"
|
||||
|
||||
RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
|
||||
{
|
||||
short_caption = STRING_r_short_caption;
|
||||
caption_and_icon =
|
||||
CAPTION_AND_ICON_INFO
|
||||
{
|
||||
caption = STRING_r_caption;
|
||||
number_of_icons = 1;
|
||||
icon_file = "\\resource\\apps\\QQrDecoder.mif";
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 38 KiB |
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QQrDecoder</class>
|
||||
<widget class="QMainWindow" name="QQrDecoder">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>340</width>
|
||||
<height>640</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QQrDecoder</string>
|
||||
</property>
|
||||
<widget class="QCameraControllerWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch=""/>
|
||||
</widget>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QCameraControllerWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>qcameracontrollerwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,18 +0,0 @@
|
|||
// ============================================================================
|
||||
// * Generated by qmake (2.01a) (Qt 4.7.3) on: 2012-05-14T15:44:30
|
||||
// * This file is generated by qmake and should not be modified by the
|
||||
// * user.
|
||||
// ============================================================================
|
||||
|
||||
#include <QQrDecoder.rsg>
|
||||
#include <appinfo.rh>
|
||||
|
||||
UID2 KUidAppRegistrationResourceFile
|
||||
UID3 0xEF2CE79D
|
||||
|
||||
RESOURCE APP_REGISTRATION_INFO
|
||||
{
|
||||
app_file="QQrDecoder";
|
||||
localisable_resource_file="\\resource\\apps\\QQrDecoder";
|
||||
|
||||
}
|
|
@ -1,201 +0,0 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -1,139 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the demonstration applications 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 "button.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
Button::Button(QWidget *parent, Qt::WindowFlags f) :
|
||||
QLabel(parent, f)
|
||||
{
|
||||
m_downPixmap = 0;
|
||||
m_disabled = false;
|
||||
m_toggled = false;
|
||||
m_toggle_enabled = false;
|
||||
}
|
||||
|
||||
Button::~Button()
|
||||
{
|
||||
}
|
||||
|
||||
void Button::disableBtn(bool b)
|
||||
{
|
||||
m_disabled = b;
|
||||
setPressed(m_disabled);
|
||||
}
|
||||
|
||||
void Button::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (!m_disabled) {
|
||||
event->accept();
|
||||
setPixmap(m_downPixmap);
|
||||
repaint();
|
||||
// Lift button back to up after 300ms
|
||||
|
||||
if(m_toggle_enabled)
|
||||
{
|
||||
m_toggled = !m_toggled;
|
||||
setPressed(m_toggled);
|
||||
emit pressed();
|
||||
}
|
||||
else
|
||||
QTimer::singleShot(300, this, SLOT(backToUp()));
|
||||
}
|
||||
}
|
||||
|
||||
void Button::backToUp()
|
||||
{
|
||||
setPixmap(m_upPixmap);
|
||||
repaint();
|
||||
emit pressed();
|
||||
}
|
||||
|
||||
void Button::setPixmap(const QPixmap& p)
|
||||
{
|
||||
// Set up and down picture for the button
|
||||
// Set pixmap
|
||||
if (!p.isNull())
|
||||
QLabel::setPixmap(p);
|
||||
|
||||
// Make down pixmap if it does not exists
|
||||
if (m_downPixmap.isNull()) {
|
||||
// Store up pixmap
|
||||
m_upPixmap = *pixmap();
|
||||
|
||||
// Create down pixmap
|
||||
// Make m_downPixmap as a transparent m_upPixmap
|
||||
QPixmap transparent(m_upPixmap.size());
|
||||
transparent.fill(Qt::transparent);
|
||||
QPainter painter(&transparent);
|
||||
painter.setCompositionMode(QPainter::CompositionMode_Source);
|
||||
painter.drawPixmap(0, 0, m_upPixmap);
|
||||
painter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
|
||||
painter.fillRect(transparent.rect(), QColor(0, 0, 0, 150));
|
||||
painter.end();
|
||||
m_downPixmap = transparent;
|
||||
}
|
||||
}
|
||||
|
||||
void Button::enableToggle(bool enable)
|
||||
{
|
||||
m_toggle_enabled = enable;
|
||||
}
|
||||
|
||||
void Button::setPressed(bool isPressed)
|
||||
{
|
||||
if(isPressed)
|
||||
{
|
||||
m_toggled = true;
|
||||
setPixmap(m_downPixmap);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_toggled = false;
|
||||
setPixmap(m_upPixmap);
|
||||
}
|
||||
}
|
||||
|
||||
bool Button::isPressed()
|
||||
{
|
||||
return m_toggled;
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the demonstration applications 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$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef BUTTON_H
|
||||
#define BUTTON_H
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
|
||||
class Button: public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Button(QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
~Button();
|
||||
|
||||
void mousePressEvent(QMouseEvent *);
|
||||
void disableBtn(bool);
|
||||
void enableToggle(bool enable);
|
||||
void setPressed(bool isPressed);
|
||||
bool isPressed();
|
||||
|
||||
public slots:
|
||||
void setPixmap(const QPixmap &);
|
||||
void backToUp();
|
||||
|
||||
signals:
|
||||
void pressed();
|
||||
|
||||
private:
|
||||
QPixmap m_upPixmap;
|
||||
QPixmap m_downPixmap;
|
||||
bool m_disabled;
|
||||
bool m_toggled;
|
||||
bool m_toggle_enabled;
|
||||
|
||||
};
|
||||
|
||||
#endif // BUTTON_H
|
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 8.4 KiB |
|
@ -1,42 +0,0 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Trolltech hereby grants a license to use the Qt/Eclipse Integration
|
||||
** plug-in (the software contained herein), in binary form, solely for the
|
||||
** purpose of creating code to be used with Trolltech's Qt software.
|
||||
**
|
||||
** Qt Designer is licensed under the terms of the GNU General Public
|
||||
** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the
|
||||
** right to use certain no GPL licensed software under the terms of its GPL
|
||||
** Exception version 1.2 (http://trolltech.com/products/qt/gplexception).
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "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."
|
||||
**
|
||||
** Since we now have the GPL exception I think that the "special exception
|
||||
** is no longer needed. The license text proposed above (other than the
|
||||
** special exception portion of it) is the BSD license and we have added
|
||||
** the BSD license as a permissible license under the exception.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "QQrDecoder.h"
|
||||
|
||||
#include <QtGui>
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
QQrDecoder w;
|
||||
w.showMaximized();
|
||||
return a.exec();
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
#ifndef MYVIDEOSURFACE_H
|
||||
#define MYVIDEOSURFACE_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVideoFrame>
|
||||
#include <QImage>
|
||||
#include <QVideoSurfaceFormat>
|
||||
#include <QAbstractVideoSurface>
|
||||
#include <QVideoRendererControl>
|
||||
#include <QVideoSurfaceFormat>
|
||||
#include <QPainter>
|
||||
#include <QTimer>
|
||||
|
||||
class VideoIF
|
||||
{
|
||||
public:
|
||||
virtual void updateVideo() = 0;
|
||||
};
|
||||
|
||||
class MyVideoSurface: public QAbstractVideoSurface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MyVideoSurface(QWidget* widget, VideoIF* target, QObject * parent = 0);
|
||||
~MyVideoSurface();
|
||||
|
||||
bool start(const QVideoSurfaceFormat &format);
|
||||
|
||||
bool present(const QVideoFrame &frame);
|
||||
|
||||
QList<QVideoFrame::PixelFormat> supportedPixelFormats(
|
||||
QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;
|
||||
|
||||
void paint(QPainter*);
|
||||
|
||||
public slots:
|
||||
void sendImageToDecode();
|
||||
|
||||
signals:
|
||||
void imageCaptured(QImage image);
|
||||
|
||||
private:
|
||||
QWidget* m_targetWidget;
|
||||
VideoIF* m_target;
|
||||
QVideoFrame m_frame;
|
||||
QImage::Format m_imageFormat;
|
||||
QVideoSurfaceFormat m_videoFormat;
|
||||
QTimer* timer;
|
||||
};
|
||||
|
||||
#endif // MYVIDEOSURFACE_H
|
|
@ -1,7 +0,0 @@
|
|||
<RCC>
|
||||
<qresource prefix="/icons">
|
||||
<file alias="zoomIn">icons/zoomIn.png</file>
|
||||
<file alias="zoomOut">icons/zoomOut.png</file>
|
||||
<file alias="camera">icons/camera.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
14
symbian/QZXing/source/.gitignore
vendored
|
@ -1,14 +0,0 @@
|
|||
moc/
|
||||
obj/
|
||||
rcc/
|
||||
tmp/
|
||||
ui/
|
||||
.make.cache
|
||||
*.BAT
|
||||
*.inf
|
||||
Makefile
|
||||
*.mk
|
||||
*.loc
|
||||
*.user
|
||||
*.mmp
|
||||
*.pkg
|
|
@ -1,146 +0,0 @@
|
|||
#include "CameraImageWrapper.h"
|
||||
#include <QColor>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
CameraImageWrapper::CameraImageWrapper() : LuminanceSource(), isSmoothTransformationEnabled(false)
|
||||
{
|
||||
}
|
||||
|
||||
CameraImageWrapper::CameraImageWrapper(QImage& image) : LuminanceSource() , isSmoothTransformationEnabled(false)
|
||||
{
|
||||
setImage(image);
|
||||
}
|
||||
|
||||
CameraImageWrapper::CameraImageWrapper(CameraImageWrapper& otherInstance) : LuminanceSource() , isSmoothTransformationEnabled(false)
|
||||
{
|
||||
image = otherInstance.getOriginalImage().copy();
|
||||
}
|
||||
|
||||
CameraImageWrapper::~CameraImageWrapper()
|
||||
{
|
||||
}
|
||||
|
||||
int CameraImageWrapper::getWidth() const
|
||||
{
|
||||
return image.width();
|
||||
}
|
||||
|
||||
int CameraImageWrapper::getHeight() const
|
||||
{
|
||||
return image.height();
|
||||
}
|
||||
|
||||
unsigned char CameraImageWrapper::getPixel(int x, int y) const
|
||||
{
|
||||
QRgb pixel = image.pixel(x,y);
|
||||
|
||||
return qGray(pixel);//((qRed(pixel) + qGreen(pixel) + qBlue(pixel)) / 3);
|
||||
}
|
||||
|
||||
unsigned char* CameraImageWrapper::copyMatrix() const
|
||||
{
|
||||
unsigned char* newMatrix = (unsigned char*)malloc(image.width()*image.height()*sizeof(unsigned char));
|
||||
|
||||
int cnt = 0;
|
||||
for(int i=0; i<image.width(); i++)
|
||||
{
|
||||
for(int j=0; j<image.height(); j++)
|
||||
{
|
||||
newMatrix[cnt++] = getPixel(i,j);
|
||||
}
|
||||
}
|
||||
|
||||
return newMatrix;
|
||||
}
|
||||
|
||||
bool CameraImageWrapper::setImage(QString fileName)
|
||||
{
|
||||
bool isLoaded = image.load(fileName);
|
||||
|
||||
if(!isLoaded)
|
||||
return false;
|
||||
|
||||
if(image.width() > QApplication::desktop()->width())
|
||||
image = image.scaled(QApplication::desktop()->width(), image.height(), Qt::IgnoreAspectRatio);
|
||||
|
||||
if(image.height() > QApplication::desktop()->height())
|
||||
image = image.scaled(image.width(), QApplication::desktop()->height(), Qt::IgnoreAspectRatio);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CameraImageWrapper::setImage(QImage newImage)
|
||||
{
|
||||
if(newImage.isNull())
|
||||
return false;
|
||||
|
||||
image = newImage.copy();
|
||||
|
||||
if(image.width() > 640)
|
||||
image = image.scaled(640, image.height(), Qt::KeepAspectRatio, isSmoothTransformationEnabled ? Qt::SmoothTransformation : Qt::FastTransformation);
|
||||
return true;
|
||||
}
|
||||
|
||||
QImage CameraImageWrapper::grayScaleImage(QImage::Format f)
|
||||
{
|
||||
QImage tmp(image.width(), image.height(), f);
|
||||
for(int i=0; i<image.width(); i++)
|
||||
{
|
||||
for(int j=0; j<image.height(); j++)
|
||||
{
|
||||
int pix = (int)getPixel(i,j);
|
||||
tmp.setPixel(i,j, qRgb(pix ,pix,pix));
|
||||
}
|
||||
}
|
||||
|
||||
return tmp;
|
||||
|
||||
//return image.convertToFormat(f);
|
||||
}
|
||||
|
||||
QImage CameraImageWrapper::getOriginalImage()
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
unsigned char* CameraImageWrapper::getRow(int y, unsigned char* row)
|
||||
{
|
||||
int width = getWidth();
|
||||
|
||||
if (row == NULL)
|
||||
{
|
||||
row = new unsigned char[width];
|
||||
pRow = row;
|
||||
}
|
||||
|
||||
for (int x = 0; x < width; x++)
|
||||
row[x] = getPixel(x,y);
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
unsigned char* CameraImageWrapper::getMatrix()
|
||||
{
|
||||
int width = getWidth();
|
||||
int height = getHeight();
|
||||
unsigned char* matrix = new unsigned char[width*height];
|
||||
unsigned char* m = matrix;
|
||||
|
||||
for(int y=0; y<height; y++)
|
||||
{
|
||||
unsigned char* tmpRow;
|
||||
memcpy(m, tmpRow = getRow(y, NULL), width);
|
||||
m += width * sizeof(unsigned char);
|
||||
|
||||
delete tmpRow;
|
||||
}
|
||||
|
||||
pMatrix = matrix;
|
||||
return matrix;
|
||||
}
|
||||
|
||||
void CameraImageWrapper::setSmoothTransformation(bool enable)
|
||||
{
|
||||
isSmoothTransformationEnabled = enable;
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
#ifndef CAMERAIMAGE_H
|
||||
#define CAMERAIMAGE_H
|
||||
|
||||
#include <QImage>
|
||||
#include <QString>
|
||||
#include <zxing/LuminanceSource.h>
|
||||
|
||||
using namespace zxing;
|
||||
|
||||
class CameraImageWrapper : public LuminanceSource
|
||||
{
|
||||
public:
|
||||
CameraImageWrapper();
|
||||
CameraImageWrapper(QImage& image);
|
||||
CameraImageWrapper(CameraImageWrapper& otherInstance);
|
||||
~CameraImageWrapper();
|
||||
|
||||
int getWidth() const;
|
||||
int getHeight() const;
|
||||
|
||||
unsigned char getPixel(int x, int y) const;
|
||||
unsigned char* copyMatrix() const;
|
||||
|
||||
/**
|
||||
* Set the source of the image. If it fails, returns false.
|
||||
*/
|
||||
bool setImage(QString fileName);
|
||||
bool setImage(QImage newImage);
|
||||
|
||||
QImage grayScaleImage(QImage::Format f);
|
||||
QImage getOriginalImage();
|
||||
|
||||
|
||||
// Callers take ownership of the returned memory and must call delete [] on it themselves.
|
||||
unsigned char* getRow(int y, unsigned char* row);
|
||||
unsigned char* getMatrix();
|
||||
|
||||
void setSmoothTransformation(bool enable);
|
||||
|
||||
private:
|
||||
QImage image;
|
||||
unsigned char* pRow;
|
||||
unsigned char* pMatrix;
|
||||
bool isSmoothTransformationEnabled;
|
||||
};
|
||||
|
||||
#endif //CAMERAIMAGE_H
|
|
@ -1,253 +0,0 @@
|
|||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2011-11-13T18:12:28
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT += core gui
|
||||
|
||||
VERSION = 1.2
|
||||
|
||||
greaterThan(QT_VERSION, 4.7): QT += declarative
|
||||
|
||||
TARGET = QZXing
|
||||
TEMPLATE = lib
|
||||
|
||||
# CONFIG += staticlib
|
||||
|
||||
DEFINES += QZXING_LIBRARY \
|
||||
ZXING_ICONV_CONST
|
||||
|
||||
INCLUDEPATH += ./
|
||||
|
||||
|
||||
HEADERS += QZXing_global.h \
|
||||
CameraImageWrapper.h \
|
||||
imagehandler.h \
|
||||
qzxing.h \
|
||||
zxing/ResultPointCallback.h \
|
||||
zxing/ResultPoint.h \
|
||||
zxing/Result.h \
|
||||
zxing/ReaderException.h \
|
||||
zxing/Reader.h \
|
||||
zxing/NotFoundException.h \
|
||||
zxing/MultiFormatReader.h \
|
||||
zxing/LuminanceSource.h \
|
||||
zxing/FormatException.h \
|
||||
zxing/Exception.h \
|
||||
zxing/DecodeHints.h \
|
||||
zxing/BinaryBitmap.h \
|
||||
zxing/Binarizer.h \
|
||||
zxing/BarcodeFormat.h \
|
||||
zxing/aztec/AztecReader.h \
|
||||
zxing/aztec/AztecDetectorResult.h \
|
||||
zxing/aztec/decoder/Decoder.h \
|
||||
zxing/aztec/detector/Detector.h \
|
||||
zxing/common/StringUtils.h \
|
||||
zxing/common/Str.h \
|
||||
zxing/common/Point.h \
|
||||
zxing/common/PerspectiveTransform.h \
|
||||
zxing/common/IllegalArgumentException.h \
|
||||
zxing/common/HybridBinarizer.h \
|
||||
zxing/common/GridSampler.h \
|
||||
zxing/common/GreyscaleRotatedLuminanceSource.h \
|
||||
zxing/common/GreyscaleLuminanceSource.h \
|
||||
zxing/common/GlobalHistogramBinarizer.h \
|
||||
zxing/common/EdgeDetector.h \
|
||||
zxing/common/DetectorResult.h \
|
||||
zxing/common/DecoderResult.h \
|
||||
zxing/common/Counted.h \
|
||||
zxing/common/CharacterSetECI.h \
|
||||
zxing/common/BitSource.h \
|
||||
zxing/common/BitMatrix.h \
|
||||
zxing/common/BitArray.h \
|
||||
zxing/common/Array.h \
|
||||
zxing/common/detector/WhiteRectangleDetector.h \
|
||||
zxing/common/detector/MonochromeRectangleDetector.h \
|
||||
zxing/common/reedsolomon/ReedSolomonException.h \
|
||||
zxing/common/reedsolomon/ReedSolomonDecoder.h \
|
||||
zxing/common/reedsolomon/GenericGFPoly.h \
|
||||
zxing/common/reedsolomon/GenericGF.h \
|
||||
zxing/datamatrix/Version.h \
|
||||
zxing/datamatrix/DataMatrixReader.h \
|
||||
zxing/datamatrix/decoder/Decoder.h \
|
||||
zxing/datamatrix/decoder/DecodedBitStreamParser.h \
|
||||
zxing/datamatrix/decoder/DataBlock.h \
|
||||
zxing/datamatrix/decoder/BitMatrixParser.h \
|
||||
zxing/datamatrix/detector/MonochromeRectangleDetector.h \
|
||||
zxing/datamatrix/detector/DetectorException.h \
|
||||
zxing/datamatrix/detector/Detector.h \
|
||||
zxing/datamatrix/detector/CornerPoint.h \
|
||||
zxing/oned/UPCEReader.h \
|
||||
zxing/oned/UPCEANReader.h \
|
||||
zxing/oned/UPCAReader.h \
|
||||
zxing/oned/OneDResultPoint.h \
|
||||
zxing/oned/OneDReader.h \
|
||||
zxing/oned/MultiFormatUPCEANReader.h \
|
||||
zxing/oned/MultiFormatOneDReader.h \
|
||||
zxing/oned/ITFReader.h \
|
||||
zxing/oned/EAN13Reader.h \
|
||||
zxing/oned/EAN8Reader.h \
|
||||
zxing/oned/Code128Reader.h \
|
||||
zxing/oned/Code39Reader.h \
|
||||
zxing/qrcode/Version.h \
|
||||
zxing/qrcode/QRCodeReader.h \
|
||||
zxing/qrcode/FormatInformation.h \
|
||||
zxing/qrcode/ErrorCorrectionLevel.h \
|
||||
zxing/qrcode/decoder/Mode.h \
|
||||
zxing/qrcode/decoder/Decoder.h \
|
||||
zxing/qrcode/decoder/DecodedBitStreamParser.h \
|
||||
zxing/qrcode/decoder/DataMask.h \
|
||||
zxing/qrcode/decoder/DataBlock.h \
|
||||
zxing/qrcode/decoder/BitMatrixParser.h \
|
||||
zxing/qrcode/detector/QREdgeDetector.h \
|
||||
zxing/qrcode/detector/FinderPatternInfo.h \
|
||||
zxing/qrcode/detector/FinderPatternFinder.h \
|
||||
zxing/qrcode/detector/FinderPattern.h \
|
||||
zxing/qrcode/detector/Detector.h \
|
||||
zxing/qrcode/detector/AlignmentPatternFinder.h \
|
||||
zxing/qrcode/detector/AlignmentPattern.h \
|
||||
zxing/multi/MultipleBarcodeReader.h \
|
||||
zxing/multi/GenericMultipleBarcodeReader.h \
|
||||
zxing/multi/ByQuadrantReader.h \
|
||||
zxing/multi/qrcode/QRCodeMultiReader.h \
|
||||
zxing/multi/qrcode/detector/MultiFinderPatternFinder.h \
|
||||
zxing/multi/qrcode/detector/MultiDetector.h
|
||||
|
||||
SOURCES += CameraImageWrapper.cpp \
|
||||
qzxing.cpp \
|
||||
imagehandler.cpp \
|
||||
zxing/ResultPointCallback.cpp \
|
||||
zxing/ResultPoint.cpp \
|
||||
zxing/Result.cpp \
|
||||
zxing/ReaderException.cpp \
|
||||
zxing/Reader.cpp \
|
||||
zxing/NotFoundException.cpp \
|
||||
zxing/MultiFormatReader.cpp \
|
||||
zxing/LuminanceSource.cpp \
|
||||
zxing/FormatException.cpp \
|
||||
zxing/Exception.cpp \
|
||||
zxing/DecodeHints.cpp \
|
||||
zxing/BinaryBitmap.cpp \
|
||||
zxing/Binarizer.cpp \
|
||||
zxing/BarcodeFormat.cpp \
|
||||
zxing/aztec/AztecReader.cpp \
|
||||
zxing/aztec/AztecDetectorResult.cpp \
|
||||
zxing/common/StringUtils.cpp \
|
||||
zxing/common/Str.cpp \
|
||||
zxing/common/PerspectiveTransform.cpp \
|
||||
zxing/common/IllegalArgumentException.cpp \
|
||||
zxing/common/HybridBinarizer.cpp \
|
||||
zxing/common/GridSampler.cpp \
|
||||
zxing/common/GreyscaleRotatedLuminanceSource.cpp \
|
||||
zxing/common/GreyscaleLuminanceSource.cpp \
|
||||
zxing/common/GlobalHistogramBinarizer.cpp \
|
||||
zxing/common/EdgeDetector.cpp \
|
||||
zxing/common/DetectorResult.cpp \
|
||||
zxing/common/DecoderResult.cpp \
|
||||
zxing/common/Counted.cpp \
|
||||
zxing/common/CharacterSetECI.cpp \
|
||||
zxing/common/BitSource.cpp \
|
||||
zxing/common/BitMatrix.cpp \
|
||||
zxing/common/BitArray.cpp \
|
||||
zxing/common/Array.cpp \
|
||||
zxing/common/detector/WhiteRectangleDetector.cpp \
|
||||
zxing/common/detector/MonochromeRectangleDetector.cpp \
|
||||
zxing/common/reedsolomon/ReedSolomonException.cpp \
|
||||
zxing/common/reedsolomon/ReedSolomonDecoder.cpp \
|
||||
zxing/common/reedsolomon/GenericGFPoly.cpp \
|
||||
zxing/common/reedsolomon/GenericGF.cpp \
|
||||
zxing/datamatrix/DataMatrixReader.cpp \
|
||||
zxing/oned/UPCEReader.cpp \
|
||||
zxing/oned/UPCEANReader.cpp \
|
||||
zxing/oned/UPCAReader.cpp \
|
||||
zxing/oned/OneDResultPoint.cpp \
|
||||
zxing/oned/OneDReader.cpp \
|
||||
zxing/oned/MultiFormatUPCEANReader.cpp \
|
||||
zxing/oned/MultiFormatOneDReader.cpp \
|
||||
zxing/oned/ITFReader.cpp \
|
||||
zxing/oned/EAN13Reader.cpp \
|
||||
zxing/oned/EAN8Reader.cpp \
|
||||
zxing/oned/Code128Reader.cpp \
|
||||
zxing/oned/Code39Reader.cpp \
|
||||
zxing/qrcode/QRCodeReader.cpp \
|
||||
zxing/qrcode/detector/QREdgeDetector.cpp \
|
||||
zxing/multi/MultipleBarcodeReader.cpp \
|
||||
zxing/multi/GenericMultipleBarcodeReader.cpp \
|
||||
zxing/multi/ByQuadrantReader.cpp \
|
||||
zxing/multi/qrcode/QRCodeMultiReader.cpp \
|
||||
zxing/multi/qrcode/detector/MultiFinderPatternFinder.cpp \
|
||||
zxing/multi/qrcode/detector/MultiDetector.cpp \
|
||||
zxing/aztec/decoder/AztecDecoder.cpp \
|
||||
zxing/aztec/detector/AztecDetector.cpp \
|
||||
zxing/datamatrix/DataMatrixVersion.cpp \
|
||||
zxing/datamatrix/decoder/DataMatrixDecoder.cpp \
|
||||
zxing/datamatrix/decoder/DataMatrixBitMatrixParser.cpp \
|
||||
zxing/datamatrix/decoder/DataMatrixDataBlock.cpp \
|
||||
zxing/datamatrix/decoder/DataMatrixDecodedBitStreamParser.cpp \
|
||||
zxing/datamatrix/detector/DataMatrixCornerPoint.cpp \
|
||||
zxing/datamatrix/detector/DataMatrixDetector.cpp \
|
||||
zxing/datamatrix/detector/DataMatrixDetectorException.cpp \
|
||||
zxing/datamatrix/detector/DataMatrixMonochromeRectangleDetector.cpp \
|
||||
zxing/qrcode/decoder/QRBitMatrixParser.cpp \
|
||||
zxing/qrcode/decoder/QRDataBlock.cpp \
|
||||
zxing/qrcode/decoder/QRDataMask.cpp \
|
||||
zxing/qrcode/decoder/QRDecodedBitStreamParser.cpp \
|
||||
zxing/qrcode/decoder/QRDecoder.cpp \
|
||||
zxing/qrcode/decoder/QRMode.cpp \
|
||||
zxing/qrcode/detector/QRAlignmentPattern.cpp \
|
||||
zxing/qrcode/detector/QRAlignmentPatternFinder.cpp \
|
||||
zxing/qrcode/detector/QRDetector.cpp \
|
||||
zxing/qrcode/detector/QRFinderPattern.cpp \
|
||||
zxing/qrcode/detector/QRFinderPatternFinder.cpp \
|
||||
zxing/qrcode/detector/QRFinderPatternInfo.cpp \
|
||||
zxing/qrcode/QRVersion.cpp \
|
||||
zxing/qrcode/QRFormatInformation.cpp \
|
||||
zxing/qrcode/QRErrorCorrectionLevel.cpp
|
||||
|
||||
symbian {
|
||||
TARGET.UID3 = 0xE618743C
|
||||
TARGET.EPOCALLOWDLLDATA = 1
|
||||
addFiles.sources = QZXing.dll
|
||||
addFiles.path = !:/sys/bin
|
||||
DEPLOYMENT += addFiles
|
||||
TARGET.CAPABILITY = All -TCB -AllFiles -DRM
|
||||
# TARGET.CAPABILITY += NetworkServices \
|
||||
# ReadUserData \
|
||||
# WriteUserData \
|
||||
# LocalServices \
|
||||
# UserEnvironment \
|
||||
# Location
|
||||
}
|
||||
|
||||
unix:!symbian {
|
||||
maemo5 {
|
||||
target.path = /opt/usr/lib
|
||||
} else {
|
||||
target.path = /usr/lib
|
||||
}
|
||||
|
||||
DEFINES += NOFMAXL
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
win32{
|
||||
DEFINES += NO_ICONV
|
||||
}
|
||||
|
||||
OTHER_FILES += \
|
||||
qtc_packaging/debian_fremantle/rules \
|
||||
qtc_packaging/debian_fremantle/README \
|
||||
qtc_packaging/debian_fremantle/copyright \
|
||||
qtc_packaging/debian_fremantle/control \
|
||||
qtc_packaging/debian_fremantle/compat \
|
||||
qtc_packaging/debian_fremantle/changelog \
|
||||
qtc_packaging/debian_harmattan/rules \
|
||||
qtc_packaging/debian_harmattan/README \
|
||||
qtc_packaging/debian_harmattan/manifest.aegis \
|
||||
qtc_packaging/debian_harmattan/copyright \
|
||||
qtc_packaging/debian_harmattan/control \
|
||||
qtc_packaging/debian_harmattan/compat \
|
||||
qtc_packaging/debian_harmattan/changelog
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef QZXING_GLOBAL_H
|
||||
#define QZXING_GLOBAL_H
|
||||
|
||||
#include <QtCore>
|
||||
#include <qglobal.h>
|
||||
|
||||
#if defined(QZXING_LIBRARY)
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define QZXINGSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif //QZXING_GLOBAL_H
|
|
@ -1,118 +0,0 @@
|
|||
EXPORTS
|
||||
_ZN6QZXing10setDecoderEj @ 1 NONAME
|
||||
_ZN6QZXing11decodeImageE6QImage @ 2 NONAME
|
||||
_ZN6QZXing11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
|
||||
_ZN6QZXing11qt_metacastEPKc @ 4 NONAME
|
||||
_ZN6QZXing14decodeImageQMLEP7QObject @ 5 NONAME
|
||||
_ZN6QZXing15decodingStartedEv @ 6 NONAME
|
||||
_ZN6QZXing16decodingFinishedEb @ 7 NONAME
|
||||
_ZN6QZXing16staticMetaObjectE @ 8 NONAME DATA 16
|
||||
_ZN6QZXing17decodeSubImageQMLEP7QObjectdddd @ 9 NONAME
|
||||
_ZN6QZXing19getStaticMetaObjectEv @ 10 NONAME
|
||||
_ZN6QZXing8tagFoundE7QString @ 11 NONAME
|
||||
_ZN6QZXingC1EP7QObject @ 12 NONAME
|
||||
_ZN6QZXingC2EP7QObject @ 13 NONAME
|
||||
_ZNK6QZXing10metaObjectEv @ 14 NONAME
|
||||
_ZTI12ImageHandler @ 15 NONAME
|
||||
_ZTI18CameraImageWrapper @ 16 NONAME
|
||||
_ZTI6QZXing @ 17 NONAME
|
||||
_ZTIN5zxing10datamatrix16DataMatrixReaderE @ 18 NONAME
|
||||
_ZTIN5zxing10datamatrix17DetectorExceptionE @ 19 NONAME
|
||||
_ZTIN5zxing10datamatrix7VersionE @ 20 NONAME
|
||||
_ZTIN5zxing10datamatrix8DetectorE @ 21 NONAME
|
||||
_ZTIN5zxing11ResultPointE @ 22 NONAME
|
||||
_ZTIN5zxing12BinaryBitmapE @ 23 NONAME
|
||||
_ZTIN5zxing15FormatExceptionE @ 24 NONAME
|
||||
_ZTIN5zxing15HybridBinarizerE @ 25 NONAME
|
||||
_ZTIN5zxing15LuminanceSourceE @ 26 NONAME
|
||||
_ZTIN5zxing15ReaderExceptionE @ 27 NONAME
|
||||
_ZTIN5zxing17MultiFormatReaderE @ 28 NONAME
|
||||
_ZTIN5zxing17NotFoundExceptionE @ 29 NONAME
|
||||
_ZTIN5zxing19ResultPointCallbackE @ 30 NONAME
|
||||
_ZTIN5zxing20ReedSolomonExceptionE @ 31 NONAME
|
||||
_ZTIN5zxing24GlobalHistogramBinarizerE @ 32 NONAME
|
||||
_ZTIN5zxing24GreyscaleLuminanceSourceE @ 33 NONAME
|
||||
_ZTIN5zxing24IllegalArgumentExceptionE @ 34 NONAME
|
||||
_ZTIN5zxing31GreyscaleRotatedLuminanceSourceE @ 35 NONAME
|
||||
_ZTIN5zxing4oned10EAN8ReaderE @ 36 NONAME
|
||||
_ZTIN5zxing4oned10OneDReaderE @ 37 NONAME
|
||||
_ZTIN5zxing4oned10UPCAReaderE @ 38 NONAME
|
||||
_ZTIN5zxing4oned10UPCEReaderE @ 39 NONAME
|
||||
_ZTIN5zxing4oned11EAN13ReaderE @ 40 NONAME
|
||||
_ZTIN5zxing4oned12Code39ReaderE @ 41 NONAME
|
||||
_ZTIN5zxing4oned12UPCEANReaderE @ 42 NONAME
|
||||
_ZTIN5zxing4oned13Code128ReaderE @ 43 NONAME
|
||||
_ZTIN5zxing4oned21MultiFormatOneDReaderE @ 44 NONAME
|
||||
_ZTIN5zxing4oned23MultiFormatUPCEANReaderE @ 45 NONAME
|
||||
_ZTIN5zxing4oned9ITFReaderE @ 46 NONAME
|
||||
_ZTIN5zxing5aztec11AztecReaderE @ 47 NONAME
|
||||
_ZTIN5zxing5multi13MultiDetectorE @ 48 NONAME
|
||||
_ZTIN5zxing5multi16ByQuadrantReaderE @ 49 NONAME
|
||||
_ZTIN5zxing5multi17QRCodeMultiReaderE @ 50 NONAME
|
||||
_ZTIN5zxing5multi21MultipleBarcodeReaderE @ 51 NONAME
|
||||
_ZTIN5zxing5multi24MultiFinderPatternFinderE @ 52 NONAME
|
||||
_ZTIN5zxing5multi28GenericMultipleBarcodeReaderE @ 53 NONAME
|
||||
_ZTIN5zxing6ReaderE @ 54 NONAME
|
||||
_ZTIN5zxing6ResultE @ 55 NONAME
|
||||
_ZTIN5zxing6qrcode12QRCodeReaderE @ 56 NONAME
|
||||
_ZTIN5zxing6qrcode14QREdgeDetectorE @ 57 NONAME
|
||||
_ZTIN5zxing6qrcode22AlignmentPatternFinderE @ 58 NONAME
|
||||
_ZTIN5zxing6qrcode7VersionE @ 59 NONAME
|
||||
_ZTIN5zxing6qrcode8DataMaskE @ 60 NONAME
|
||||
_ZTIN5zxing6qrcode8DetectorE @ 61 NONAME
|
||||
_ZTIN5zxing8BitArrayE @ 62 NONAME
|
||||
_ZTIN5zxing9BinarizerE @ 63 NONAME
|
||||
_ZTIN5zxing9BitMatrixE @ 64 NONAME
|
||||
_ZTIN5zxing9ExceptionE @ 65 NONAME
|
||||
_ZTV12ImageHandler @ 66 NONAME
|
||||
_ZTV18CameraImageWrapper @ 67 NONAME
|
||||
_ZTV6QZXing @ 68 NONAME
|
||||
_ZTVN5zxing10datamatrix16DataMatrixReaderE @ 69 NONAME
|
||||
_ZTVN5zxing10datamatrix17DetectorExceptionE @ 70 NONAME
|
||||
_ZTVN5zxing10datamatrix7VersionE @ 71 NONAME
|
||||
_ZTVN5zxing10datamatrix8DetectorE @ 72 NONAME
|
||||
_ZTVN5zxing11ResultPointE @ 73 NONAME
|
||||
_ZTVN5zxing12BinaryBitmapE @ 74 NONAME
|
||||
_ZTVN5zxing15FormatExceptionE @ 75 NONAME
|
||||
_ZTVN5zxing15HybridBinarizerE @ 76 NONAME
|
||||
_ZTVN5zxing15LuminanceSourceE @ 77 NONAME
|
||||
_ZTVN5zxing15ReaderExceptionE @ 78 NONAME
|
||||
_ZTVN5zxing17MultiFormatReaderE @ 79 NONAME
|
||||
_ZTVN5zxing17NotFoundExceptionE @ 80 NONAME
|
||||
_ZTVN5zxing19ResultPointCallbackE @ 81 NONAME
|
||||
_ZTVN5zxing20ReedSolomonExceptionE @ 82 NONAME
|
||||
_ZTVN5zxing24GlobalHistogramBinarizerE @ 83 NONAME
|
||||
_ZTVN5zxing24GreyscaleLuminanceSourceE @ 84 NONAME
|
||||
_ZTVN5zxing24IllegalArgumentExceptionE @ 85 NONAME
|
||||
_ZTVN5zxing31GreyscaleRotatedLuminanceSourceE @ 86 NONAME
|
||||
_ZTVN5zxing4oned10EAN8ReaderE @ 87 NONAME
|
||||
_ZTVN5zxing4oned10OneDReaderE @ 88 NONAME
|
||||
_ZTVN5zxing4oned10UPCAReaderE @ 89 NONAME
|
||||
_ZTVN5zxing4oned10UPCEReaderE @ 90 NONAME
|
||||
_ZTVN5zxing4oned11EAN13ReaderE @ 91 NONAME
|
||||
_ZTVN5zxing4oned12Code39ReaderE @ 92 NONAME
|
||||
_ZTVN5zxing4oned12UPCEANReaderE @ 93 NONAME
|
||||
_ZTVN5zxing4oned13Code128ReaderE @ 94 NONAME
|
||||
_ZTVN5zxing4oned21MultiFormatOneDReaderE @ 95 NONAME
|
||||
_ZTVN5zxing4oned23MultiFormatUPCEANReaderE @ 96 NONAME
|
||||
_ZTVN5zxing4oned9ITFReaderE @ 97 NONAME
|
||||
_ZTVN5zxing5aztec11AztecReaderE @ 98 NONAME
|
||||
_ZTVN5zxing5multi13MultiDetectorE @ 99 NONAME
|
||||
_ZTVN5zxing5multi16ByQuadrantReaderE @ 100 NONAME
|
||||
_ZTVN5zxing5multi17QRCodeMultiReaderE @ 101 NONAME
|
||||
_ZTVN5zxing5multi21MultipleBarcodeReaderE @ 102 NONAME
|
||||
_ZTVN5zxing5multi24MultiFinderPatternFinderE @ 103 NONAME
|
||||
_ZTVN5zxing5multi28GenericMultipleBarcodeReaderE @ 104 NONAME
|
||||
_ZTVN5zxing6ReaderE @ 105 NONAME
|
||||
_ZTVN5zxing6ResultE @ 106 NONAME
|
||||
_ZTVN5zxing6qrcode12QRCodeReaderE @ 107 NONAME
|
||||
_ZTVN5zxing6qrcode14QREdgeDetectorE @ 108 NONAME
|
||||
_ZTVN5zxing6qrcode22AlignmentPatternFinderE @ 109 NONAME
|
||||
_ZTVN5zxing6qrcode7VersionE @ 110 NONAME
|
||||
_ZTVN5zxing6qrcode8DataMaskE @ 111 NONAME
|
||||
_ZTVN5zxing6qrcode8DetectorE @ 112 NONAME
|
||||
_ZTVN5zxing8BitArrayE @ 113 NONAME
|
||||
_ZTVN5zxing9BinarizerE @ 114 NONAME
|
||||
_ZTVN5zxing9BitMatrixE @ 115 NONAME
|
||||
_ZTVN5zxing9ExceptionE @ 116 NONAME
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
#include "imagehandler.h"
|
||||
#include <QGraphicsObject>
|
||||
#include <QImage>
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionGraphicsItem>
|
||||
#include <QDebug>
|
||||
|
||||
ImageHandler::ImageHandler(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QImage ImageHandler::extractQImage(QObject *imageObj,
|
||||
const double offsetX, const double offsetY,
|
||||
const double width, const double height)
|
||||
{
|
||||
QGraphicsObject *item = qobject_cast<QGraphicsObject*>(imageObj);
|
||||
|
||||
if (!item) {
|
||||
qDebug() << "Item is NULL";
|
||||
return QImage();
|
||||
}
|
||||
|
||||
QImage img(item->boundingRect().size().toSize(), QImage::Format_RGB32);
|
||||
img.fill(QColor(255, 255, 255).rgb());
|
||||
QPainter painter(&img);
|
||||
QStyleOptionGraphicsItem styleOption;
|
||||
item->paint(&painter, &styleOption);
|
||||
|
||||
if(offsetX == 0 && offsetY == 0 && width == 0 && height == 0)
|
||||
return img;
|
||||
else
|
||||
{
|
||||
return img.copy(offsetX, offsetY, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
void ImageHandler::save(QObject *imageObj, const QString &path,
|
||||
const double offsetX, const double offsetY,
|
||||
const double width, const double height)
|
||||
{
|
||||
QImage img = extractQImage(imageObj, offsetX, offsetY, width, height);
|
||||
img.save(path);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef IMAGEHANDLER_H
|
||||
#define IMAGEHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
class ImageHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ImageHandler(QObject *parent = 0);
|
||||
|
||||
QImage extractQImage(QObject *imageObj,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
public slots:
|
||||
void save(QObject *item, const QString &path,
|
||||
const double offsetX = 0, const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
};
|
||||
|
||||
#endif // IMAGEHANDLER_H
|
|
@ -1,6 +0,0 @@
|
|||
The Debian Package qzxing
|
||||
----------------------------
|
||||
|
||||
Comments regarding the Package
|
||||
|
||||
-- unknown <> Wed, 16 Nov 2011 18:02:57 +0200
|
|
@ -1,5 +0,0 @@
|
|||
qzxing (0.0.1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- unknown <> Wed, 16 Nov 2011 18:02:57 +0200
|
|
@ -1 +0,0 @@
|
|||
7
|
|
@ -1,15 +0,0 @@
|
|||
Source: qzxing
|
||||
Section: user/hidden
|
||||
Priority: optional
|
||||
Maintainer: unknown <>
|
||||
Build-Depends: debhelper (>= 5), libqt4-dev
|
||||
Standards-Version: 3.7.3
|
||||
Homepage: <insert the upstream URL, if relevant>
|
||||
|
||||
Package: qzxing
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: <insert up to 60 chars description>
|
||||
<insert long description, indented with spaces>
|
||||
XB-Maemo-Display-Name: QZXing
|
||||
XB-Maemo-Icon-26:
|
|
@ -1,40 +0,0 @@
|
|||
This package was debianized by unknown <> on
|
||||
Wed, 16 Nov 2011 18:02:57 +0200.
|
||||
|
||||
It was downloaded from <url://example.com>
|
||||
|
||||
Upstream Author(s):
|
||||
|
||||
<put author's name and email here>
|
||||
<likewise for another author>
|
||||
|
||||
Copyright:
|
||||
|
||||
<Copyright (C) YYYY Name OfAuthor>
|
||||
<likewise for another author>
|
||||
|
||||
License:
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
The Debian packaging is (C) 2011, unknown <> and
|
||||
is licensed under the GPL, see above.
|
||||
|
||||
|
||||
# Please also look if there are files or directories which have a
|
||||
# different copyright/license attached and list them here.
|
|
@ -1,91 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
# $(MAKE) # Uncomment this line for use without Qt Creator
|
||||
#docbook-to-man debian/qzxing.sgml > qzxing.1
|
||||
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
$(MAKE) clean
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/qzxing.
|
||||
$(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qzxing install
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
# dh_install
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
# dh_shlibdeps # Uncomment this line for use without Qt Creator
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
|
@ -1,6 +0,0 @@
|
|||
The Debian Package qzxing
|
||||
----------------------------
|
||||
|
||||
Comments regarding the Package
|
||||
|
||||
-- unknown <> Mon, 14 May 2012 15:23:23 +0300
|
|
@ -1,5 +0,0 @@
|
|||
qzxing (0.0.1) unstable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
-- unknown <> Mon, 14 May 2012 15:23:23 +0300
|
|
@ -1 +0,0 @@
|
|||
7
|
|
@ -1,14 +0,0 @@
|
|||
Source: qzxing
|
||||
Section: user/other
|
||||
Priority: optional
|
||||
Maintainer: unknown <>
|
||||
Build-Depends: debhelper (>= 5), libqt4-dev
|
||||
Standards-Version: 3.7.3
|
||||
Homepage: <insert the upstream URL, if relevant>
|
||||
|
||||
Package: qzxing
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: <insert up to 60 chars description>
|
||||
<insert long description, indented with spaces>
|
||||
XSBC-Maemo-Display-Name: QZXing
|
|
@ -1,40 +0,0 @@
|
|||
This package was debianized by unknown <> on
|
||||
Mon, 14 May 2012 15:23:23 +0300.
|
||||
|
||||
It was downloaded from <url://example.com>
|
||||
|
||||
Upstream Author(s):
|
||||
|
||||
<put author's name and email here>
|
||||
<likewise for another author>
|
||||
|
||||
Copyright:
|
||||
|
||||
<Copyright (C) YYYY Name OfAuthor>
|
||||
<likewise for another author>
|
||||
|
||||
License:
|
||||
|
||||
This package is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this package; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License can be found in `/usr/share/common-licenses/GPL'.
|
||||
|
||||
The Debian packaging is (C) 2012, unknown <> and
|
||||
is licensed under the GPL, see above.
|
||||
|
||||
|
||||
# Please also look if there are files or directories which have a
|
||||
# different copyright/license attached and list them here.
|
|
@ -1,70 +0,0 @@
|
|||
AutoGenerateAegisFile
|
||||
<!-- Aegis manifest declares the security credentials required by an
|
||||
application to run correctly. By default, a manifest file will be
|
||||
created or updated automatically as a part of build.
|
||||
|
||||
The detection of required credentials is based on static scan of
|
||||
application binaries. In some cases, the scan may not be able to
|
||||
detect the correct set of permissions. If this is the case, you must
|
||||
declare the credentials required by your application in this file.
|
||||
|
||||
To create a manifest file automatically as a part of build (DEFAULT):
|
||||
|
||||
* Make sure this file starts with the string "AutoGenerateAegisFile" (without quotes).
|
||||
* Alternatively, it can also be completely empty.
|
||||
|
||||
To provide a manifest yourself:
|
||||
|
||||
* List the correct credentials for the application in this file.
|
||||
* Some commented-out examples of often required tokens are provided.
|
||||
* Ensure the path to your application binary given in
|
||||
'<for path="/path/to/app" />' is correct.
|
||||
* Please do not request more credentials than what your application
|
||||
actually requires.
|
||||
|
||||
To disable manifest file:
|
||||
|
||||
* Replace this file with a file starting with the string "NoAegisFile" (without quotes).
|
||||
* Final application package will not contain a manifest.
|
||||
|
||||
-->
|
||||
<aegis>
|
||||
<request policy="add">
|
||||
|
||||
<!-- Make a GSM call, send text messages (SMS). -->
|
||||
<!--
|
||||
<credential name="Cellular" />
|
||||
-->
|
||||
|
||||
<!-- Access Facebook social data. -->
|
||||
<!--
|
||||
<credential name="FacebookSocial" />
|
||||
-->
|
||||
|
||||
<!-- Read access to data stored in tracker. -->
|
||||
<!--
|
||||
<credential name="TrackerReadAccess" />
|
||||
-->
|
||||
|
||||
<!-- Read and write access to data stored in tracker. -->
|
||||
<!--
|
||||
<credential name="TrackerWriteAccess" />
|
||||
-->
|
||||
|
||||
<!-- Read Location information. -->
|
||||
<!--
|
||||
<credential name="Location" />
|
||||
-->
|
||||
|
||||
<!-- Access to Audio, Multimedia and Camera. -->
|
||||
<!--
|
||||
<credential name="GRP::pulse-access" />
|
||||
<credential name="GRP::video" />
|
||||
<credential name="GRP::audio" />
|
||||
-->
|
||||
|
||||
</request>
|
||||
|
||||
<for path="/opt/QZXing/bin/QZXing" />
|
||||
<for path="applauncherd-launcher::/usr/bin/applauncherd.bin" id="" />
|
||||
</aegis>
|
|
@ -1,91 +0,0 @@
|
|||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
# qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
|
||||
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
build: build-stamp
|
||||
|
||||
build-stamp: configure-stamp
|
||||
dh_testdir
|
||||
|
||||
# Add here commands to compile the package.
|
||||
# $(MAKE) # Uncomment this line for use without Qt Creator
|
||||
#docbook-to-man debian/qzxing.sgml > qzxing.1
|
||||
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
rm -f build-stamp configure-stamp
|
||||
|
||||
# Add here commands to clean up after the build process.
|
||||
$(MAKE) clean
|
||||
|
||||
dh_clean
|
||||
|
||||
install: build
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -k
|
||||
dh_installdirs
|
||||
|
||||
# Add here commands to install the package into debian/qzxing.
|
||||
$(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/qzxing install
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installchangelogs
|
||||
dh_installdocs
|
||||
dh_installexamples
|
||||
# dh_install
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
# dh_installemacsen
|
||||
# dh_installpam
|
||||
# dh_installmime
|
||||
# dh_python
|
||||
# dh_installinit
|
||||
# dh_installcron
|
||||
# dh_installinfo
|
||||
dh_installman
|
||||
dh_link
|
||||
dh_strip
|
||||
dh_compress
|
||||
dh_fixperms
|
||||
# dh_perl
|
||||
# dh_makeshlibs
|
||||
dh_installdeb
|
||||
# dh_shlibdeps # Uncomment this line for use without Qt Creator
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
|
@ -1,114 +0,0 @@
|
|||
#include "qzxing.h"
|
||||
|
||||
#include <zxing/common/GlobalHistogramBinarizer.h>
|
||||
#include <zxing/Binarizer.h>
|
||||
#include <zxing/BinaryBitmap.h>
|
||||
#include <zxing/MultiFormatReader.h>
|
||||
#include <zxing/DecodeHints.h>
|
||||
#include "CameraImageWrapper.h"
|
||||
#include "imagehandler.h"
|
||||
|
||||
using namespace zxing;
|
||||
|
||||
QZXing::QZXing(QObject *parent) : QObject(parent)
|
||||
{
|
||||
decoder = new MultiFormatReader();
|
||||
setDecoder(DecoderFormat_QR_CODE |
|
||||
DecoderFormat_DATA_MATRIX |
|
||||
DecoderFormat_UPC_E |
|
||||
DecoderFormat_UPC_A |
|
||||
DecoderFormat_EAN_8 |
|
||||
DecoderFormat_EAN_13 |
|
||||
DecoderFormat_CODE_128 |
|
||||
DecoderFormat_CODE_39 |
|
||||
DecoderFormat_ITF |
|
||||
DecoderFormat_Aztec);
|
||||
imageHandler = new ImageHandler();
|
||||
}
|
||||
|
||||
void QZXing::setDecoder(DecoderFormatType hint)
|
||||
{
|
||||
DecodeHints newHints;
|
||||
|
||||
if(hint & DecoderFormat_QR_CODE)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_QR_CODE);
|
||||
|
||||
if(hint & DecoderFormat_DATA_MATRIX)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_DATA_MATRIX);
|
||||
|
||||
if(hint & DecoderFormat_UPC_E)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_E);
|
||||
|
||||
if(hint & DecoderFormat_UPC_A)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_UPC_A);
|
||||
|
||||
if(hint & DecoderFormat_EAN_8)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_8);
|
||||
|
||||
if(hint & DecoderFormat_EAN_13)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_EAN_13);
|
||||
|
||||
if(hint & DecoderFormat_CODE_128)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_128);
|
||||
|
||||
if(hint & DecoderFormat_CODE_39)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_CODE_39);
|
||||
|
||||
if(hint & DecoderFormat_ITF)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_ITF);
|
||||
|
||||
if(hint & DecoderFormat_Aztec)
|
||||
newHints.addFormat((BarcodeFormat)BarcodeFormat_AZTEC);
|
||||
|
||||
supportedFormats = newHints.getCurrentHint();
|
||||
}
|
||||
|
||||
QString QZXing::decodeImage(QImage image)
|
||||
{
|
||||
Ref<Result> res;
|
||||
emit decodingStarted();
|
||||
|
||||
try{
|
||||
Ref<LuminanceSource> imageRef(new CameraImageWrapper(image));
|
||||
GlobalHistogramBinarizer* binz = new GlobalHistogramBinarizer(imageRef);
|
||||
|
||||
Ref<Binarizer> bz (binz);
|
||||
BinaryBitmap* bb = new BinaryBitmap(bz);
|
||||
|
||||
Ref<BinaryBitmap> ref(bb);
|
||||
|
||||
res = ((MultiFormatReader*)decoder)->decode(ref, DecodeHints((int)supportedFormats));
|
||||
|
||||
QString string = QString(res->getText()->getText().c_str());
|
||||
emit tagFound(string);
|
||||
emit decodingFinished(true);
|
||||
return string;
|
||||
}
|
||||
catch(zxing::Exception& e)
|
||||
{
|
||||
emit decodingFinished(false);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
QString QZXing::decodeImageQML(QObject *item)
|
||||
{
|
||||
return decodeSubImageQML(item);
|
||||
}
|
||||
|
||||
QString QZXing::decodeSubImageQML(QObject* item,
|
||||
const double offsetX, const double offsetY,
|
||||
const double width, const double height)
|
||||
{
|
||||
if(item == NULL)
|
||||
{
|
||||
emit decodingFinished(false);
|
||||
return "";
|
||||
}
|
||||
|
||||
QImage img = ((ImageHandler*)imageHandler)->extractQImage(item, offsetX, offsetY, width, height);
|
||||
|
||||
return decodeImage(img);
|
||||
}
|
||||
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
#ifndef QZXING_H
|
||||
#define QZXING_H
|
||||
|
||||
#include "QZXing_global.h"
|
||||
#include <QObject>
|
||||
#include <QImage>
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
#include <QtDeclarative>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A class containing a very very small subset of the ZXing library.
|
||||
* Created for ease of use.
|
||||
*
|
||||
* Anyone interested in using more technical stuff
|
||||
* from the ZXing library is welcomed to add/edit on free will.
|
||||
*
|
||||
* Regarding DecoderFormat, by default all of those are enabled (except DataMatrix will is still not supported)
|
||||
*/
|
||||
class QZXINGSHARED_EXPORT QZXing : public QObject{
|
||||
Q_OBJECT
|
||||
Q_ENUMS(DecoderFormat)
|
||||
public:
|
||||
enum DecoderFormat {
|
||||
DecoderFormat_None = 0,
|
||||
DecoderFormat_QR_CODE = 1,
|
||||
DecoderFormat_DATA_MATRIX = 2,
|
||||
DecoderFormat_UPC_E = 4,
|
||||
DecoderFormat_UPC_A = 8,
|
||||
DecoderFormat_EAN_8 = 16,
|
||||
DecoderFormat_EAN_13 = 32,
|
||||
DecoderFormat_CODE_128 = 64,
|
||||
DecoderFormat_CODE_39 = 128,
|
||||
DecoderFormat_ITF = 256,
|
||||
DecoderFormat_Aztec = 512
|
||||
} ;
|
||||
typedef unsigned int DecoderFormatType;
|
||||
|
||||
public:
|
||||
QZXing(QObject *parent = NULL);
|
||||
|
||||
/**
|
||||
* Set the enabled decoders.
|
||||
* As argument it is possible to pass conjuction of decoders by using logic OR.
|
||||
* e.x. setDecoder ( DecoderFormat_QR_CODE | DecoderFormat_EAN_13 | DecoderFormat_CODE_39 )
|
||||
*/
|
||||
void setDecoder(DecoderFormatType hint);
|
||||
|
||||
#if QT_VERSION >= 0x040700
|
||||
static void registerQMLTypes()
|
||||
{
|
||||
qmlRegisterType<QZXing>("QZXing", 1, 2, "QZXing");
|
||||
}
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* The decoding function. Will try to decode the given image based on the enabled decoders.
|
||||
*
|
||||
*/
|
||||
QString decodeImage(QImage image);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML
|
||||
*/
|
||||
QString decodeImageQML(QObject *item);
|
||||
|
||||
/**
|
||||
* The decoding function accessible from QML. Able to set the decoding
|
||||
* of a portion of the image.
|
||||
*/
|
||||
QString decodeSubImageQML(QObject* item,
|
||||
const double offsetX = 0 , const double offsetY = 0,
|
||||
const double width = 0, const double height = 0);
|
||||
|
||||
signals:
|
||||
void decodingStarted();
|
||||
void decodingFinished(bool succeeded);
|
||||
void tagFound(QString tag);
|
||||
|
||||
private:
|
||||
void* decoder;
|
||||
DecoderFormatType supportedFormats;
|
||||
QObject* imageHandler;
|
||||
};
|
||||
|
||||
#endif // QZXING_H
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
|
||||
/*
|
||||
* Created by Christian Brunschen on 13/05/2008.
|
||||
* Copyright 2008 ZXing authors All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <zxing/BarcodeFormat.h>
|
||||
|
||||
namespace zxing {
|
||||
|
||||
const char *barcodeFormatNames[] = {
|
||||
"None",
|
||||
"QR_CODE",
|
||||
"DATA_MATRIX",
|
||||
"UPC_E",
|
||||
"UPC_A",
|
||||
"EAN_8",
|
||||
"EAN_13",
|
||||
"CODE_128",
|
||||
"CODE_39",
|
||||
"ITF",
|
||||
"AZTEC"
|
||||
};
|
||||
|
||||
}
|