zbar::QZBar Class Reference

barcode reader Qt4 widget. More...

List of all members.

Public Slots

void setVideoDevice (const QString &videoDevice)
 open a new video device.
void setVideoEnabled (bool videoEnabled=true)
 enable/disable video scanning.
void scanImage (const QImage &image)
 scan for barcodes in a QImage.

Signals

void videoOpened (bool videoOpened)
 emitted when when a video device is opened or closed.
void decoded (int type, const QString &data)
 emitted when a barcode is decoded from an image.
void decodedText (const QString &text)
 emitted when a barcode is decoded from an image.

Public Member Functions

 QZBar (QWidget *parent=NULL)
 constructs a barcode reader widget with the given parent
QString videoDevice () const
 retrieve the currently opened video device.
bool isVideoEnabled () const
 retrieve the current video enabled state.
bool isVideoOpened () const
 retrieve the current video opened state.

Properties

QString videoDevice
 the currently opened video device.
bool videoEnabled
 video device streaming state.
bool videoOpened
 video device opened state.
QSize sizeHint () const
int heightForWidth (int) const
QPaintEngine * paintEngine () const
void attach ()
void showEvent (QShowEvent *)
void paintEvent (QPaintEvent *)
void resizeEvent (QResizeEvent *)
void changeEvent (QEvent *)
void dragEnterEvent (QDragEnterEvent *)
void dropEvent (QDropEvent *)
void sizeChange ()


Detailed Description

barcode reader Qt4 widget.

embeds a barcode reader directly into a Qt4 based GUI. the widget can process barcodes from a video source (using the QZBar::videoDevice and QZBar::videoEnabled properties) or from individual QImages supplied to the QZBar::scanImage() slot

Since:
1.5

Member Function Documentation

QString zbar::QZBar::videoDevice (  )  const

retrieve the currently opened video device.

Returns:
the current video device or the empty string if no device is opened

bool zbar::QZBar::isVideoEnabled (  )  const

retrieve the current video enabled state.

Returns:
true if video scanning is currently enabled, false otherwise

bool zbar::QZBar::isVideoOpened (  )  const

retrieve the current video opened state.

Returns:
true if video device is currently opened, false otherwise

void zbar::QZBar::setVideoDevice ( const QString &  videoDevice  )  [slot]

open a new video device.

use an empty string to close a currently opened device.

Note:
since opening a device may take some time, this call will return immediately and the device will be opened asynchronously

void zbar::QZBar::setVideoEnabled ( bool  videoEnabled = true  )  [slot]

enable/disable video scanning.

has no effect unless a video device is opened

void zbar::QZBar::videoOpened ( bool  videoOpened  )  [signal]

emitted when when a video device is opened or closed.

(re)setting QZBar::videoDevice should eventually cause it to be opened or closed. any errors while streaming/scanning will also cause the device to be closed

void zbar::QZBar::decoded ( int  type,
const QString &  data 
) [signal]

emitted when a barcode is decoded from an image.

the symbol type and contained data are provided as separate parameters.

void zbar::QZBar::decodedText ( const QString &  text  )  [signal]

emitted when a barcode is decoded from an image.

the symbol type name is prefixed to the data, separated by a colon


Property Documentation

QString zbar::QZBar::videoDevice [read, write]

the currently opened video device.

setting a new device opens it and automatically sets QZBar::videoEnabled

See also:
videoDevice(), setVideoDevice()

bool zbar::QZBar::videoEnabled [read, write]

video device streaming state.

use to pause/resume video scanning.

See also:
isVideoEnabled(), setVideoEnabled()

bool zbar::QZBar::videoOpened [read]

video device opened state.

(re)setting QZBar::videoDevice should eventually cause it to be opened or closed. any errors while streaming/scanning will also cause the device to be closed

See also:
isVideoOpened()


The documentation for this class was generated from the following file:

SourceForge.net Logo
spadix@users.sourceforge.net

Copyright 2008-2010 (c) Jeff Brown

This documentation is part of the ZBar Barcode Reader; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.