mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-04 13:07:26 -04:00
Make QtMultimedia dependency optional
This commit is contained in:
@@ -37,14 +37,12 @@ QrCodeScanner::QrCodeScanner(QObject *parent)
|
||||
, m_processInterval(750)
|
||||
, m_enabled(true)
|
||||
{
|
||||
#ifdef WITH_SCANNER
|
||||
m_probe = new QVideoProbe(this);
|
||||
m_thread = new QrScanThread(this);
|
||||
m_thread->start();
|
||||
QObject::connect(m_thread, SIGNAL(decoded(int,QString)), this, SLOT(processCode(int,QString)));
|
||||
QObject::connect(m_thread, SIGNAL(notifyError(const QString &, bool)), this, SIGNAL(notifyError(const QString &, bool)));
|
||||
connect(m_probe, SIGNAL(videoFrameProbed(QVideoFrame)), this, SLOT(processFrame(QVideoFrame)));
|
||||
#endif
|
||||
}
|
||||
void QrCodeScanner::setSource(QCamera *camera)
|
||||
{
|
||||
@@ -97,12 +95,10 @@ void QrCodeScanner::setEnabled(bool enabled)
|
||||
}
|
||||
emit enabledChanged();
|
||||
}
|
||||
#ifdef WITH_SCANNER
|
||||
void QrCodeScanner::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
if( (event->timerId() == m_processTimerId) ){
|
||||
m_thread->addFrame(m_curFrame);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -31,9 +31,7 @@
|
||||
|
||||
#include <QImage>
|
||||
#include <QVideoFrame>
|
||||
#ifdef WITH_SCANNER
|
||||
#include "QrScanThread.h"
|
||||
#endif
|
||||
|
||||
class QVideoProbe;
|
||||
class QCamera;
|
||||
@@ -64,10 +62,8 @@ Q_SIGNALS:
|
||||
void notifyError(const QString &error, bool warning = false);
|
||||
|
||||
protected:
|
||||
#ifdef WITH_SCANNER
|
||||
void timerEvent(QTimerEvent *);
|
||||
QrScanThread *m_thread;
|
||||
#endif
|
||||
int m_processTimerId;
|
||||
int m_processInterval;
|
||||
int m_enabled;
|
||||
|
||||
Reference in New Issue
Block a user