diff --git a/Software/src/GrabWidget.cpp b/Software/src/GrabWidget.cpp index e2587098c..542097fdc 100644 --- a/Software/src/GrabWidget.cpp +++ b/Software/src/GrabWidget.cpp @@ -344,7 +344,7 @@ QRect GrabWidget::resizeAccordingly(QMouseEvent *pe) { } bool GrabWidget::snapEdgeToScreenOrClosestFellow( - QRect& newRect, + QRect& newRect, const QRect& screen, std::function setter, std::function getter, @@ -384,8 +384,8 @@ void GrabWidget::mouseMoveEvent(QMouseEvent *pe) DEBUG_HIGH_LEVEL << Q_FUNC_INFO << "pe->pos() =" << pe->pos(); QRect screen = QApplication::desktop()->screenGeometry(this); - - + + if (cmd == NOP ){ checkAndSetCursors(pe); } else if (cmd == MOVE) { @@ -455,7 +455,7 @@ void GrabWidget::mouseMoveEvent(QMouseEvent *pe) [](const QRect& r) { return r.bottom(); }, [](const QRect& r) { return r.top() - 1; }); } - + if (newRect.size() != geometry().size()) { resize(newRect.size()); } @@ -705,7 +705,11 @@ void GrabWidget::onBlueCoef_ValueChanged(double value) void GrabWidget::setBackgroundColor(QColor color) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) DEBUG_MID_LEVEL << Q_FUNC_INFO << Qt::hex << color.rgb(); +#else + DEBUG_MID_LEVEL << Q_FUNC_INFO << hex << color.rgb(); +#endif m_backgroundColor = color; @@ -723,7 +727,11 @@ void GrabWidget::setBackgroundColor(QColor color) void GrabWidget::setTextColor(QColor color) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) DEBUG_MID_LEVEL << Q_FUNC_INFO << Qt::hex << color.rgb(); +#else + DEBUG_MID_LEVEL << Q_FUNC_INFO << hex << color.rgb(); +#endif setOpenConfigButtonBackground(color); diff --git a/Software/src/LedDeviceLightpack.cpp b/Software/src/LedDeviceLightpack.cpp index 9f9cad2f5..44d8669fa 100644 --- a/Software/src/LedDeviceLightpack.cpp +++ b/Software/src/LedDeviceLightpack.cpp @@ -65,7 +65,12 @@ LedDeviceLightpack::~LedDeviceLightpack() void LedDeviceLightpack::setColors(const QList & colors) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) DEBUG_MID_LEVEL << Q_FUNC_INFO << Qt::hex << (colors.isEmpty() ? -1 : colors.first()); +#else + DEBUG_MID_LEVEL << Q_FUNC_INFO << hex << (colors.isEmpty() ? -1 : colors.first()); +#endif + #if 0 DEBUG_LOW_LEVEL << Q_FUNC_INFO << "thread id: " << this->thread()->currentThreadId(); #endif @@ -355,7 +360,7 @@ bool LedDeviceLightpack::readDataFromDevice() } bool LedDeviceLightpack::writeBufferToDevice(int command, hid_device *phid_device) -{ +{ DEBUG_MID_LEVEL << Q_FUNC_INFO << command; #if 0 DEBUG_LOW_LEVEL << Q_FUNC_INFO << "thread id: " << this->thread()->currentThreadId(); diff --git a/Software/src/LogWriter.cpp b/Software/src/LogWriter.cpp index a05bca6e2..fd109a761 100644 --- a/Software/src/LogWriter.cpp +++ b/Software/src/LogWriter.cpp @@ -29,15 +29,15 @@ int LogWriter::initWith(const QString& logsDirPath) QDir logsDir(logsDirPath); if (logsDir.exists() == false) { - cout << "mkdir " << logsDirPath.toStdString() << endl; + std::cout << "mkdir " << logsDirPath.toStdString() << std::endl; if (logsDir.mkdir(logsDirPath) == false) { - cerr << "Failed mkdir '" << logsDirPath.toStdString() << "' for logs. Exit." << endl; + std::cerr << "Failed mkdir '" << logsDirPath.toStdString() << "' for logs. Exit." << std::endl; return LightpackApplication::LogsDirecroryCreationFail_ErrorCode; } } if (rotateLogFiles(logsDir) == false) - cerr << "Failed to rotate old log files." << endl; + std::cerr << "Failed to rotate old log files." << std::endl; const QString logFilePath = logsDirPath + "/Prismatik.0.log"; QScopedPointer logFile(new QFile(logFilePath)); @@ -45,17 +45,26 @@ int LogWriter::initWith(const QString& logsDirPath) QMutexLocker locker(&m_mutex); m_logStream.setDevice(logFile.take()); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) m_logStream << Qt::endl; +#else + m_logStream << endl; +#endif const QDateTime currentDateTime(QDateTime::currentDateTime()); m_logStream << currentDateTime.date().toString("yyyy_MM_dd") << " "; - m_logStream << currentDateTime.time().toString("hh:mm:ss:zzz") << " Prismatik " << VERSION_STR << Qt::endl; + m_logStream << currentDateTime.time().toString("hh:mm:ss:zzz") << " Prismatik " << VERSION_STR; +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + m_logStream << Qt::endl; +#else + m_logStream << endl; +#endif // write the cached log m_logStream << m_startupLogStore; m_startupLogStore.clear(); } else { - cerr << "Failed to open logs file: '" << logFilePath.toStdString() << "'. Exit." << endl; + std::cerr << "Failed to open logs file: '" << logFilePath.toStdString() << "'. Exit." << std::endl; return LightpackApplication::OpenLogsFail_ErrorCode; }