Added a background worker using QThread for device screening and integrated Tesseract OCR for text recognition from images. Refactored project structure, updated CMakeLists for Tesseract support, and adjusted .gitignore for build files.
20 lines
470 B
C++
20 lines
470 B
C++
#include "device_screener.h"
|
|
#include <QDebug>
|
|
#include <QThread>
|
|
|
|
DeviceScreener::DeviceScreener(QObject* parent) : QObject(parent) {}
|
|
|
|
DeviceScreener::~DeviceScreener() = default;
|
|
|
|
void DeviceScreener::start() {
|
|
qDebug() << "Worker started in thread:" << QThread::currentThread();
|
|
while (m_running) {
|
|
qDebug() << "Running in background...";
|
|
QThread::sleep(2);
|
|
}
|
|
emit finished();
|
|
}
|
|
|
|
void DeviceScreener::stop() {
|
|
m_running = false;
|
|
} |