diff --git a/Software/src/GrabWidget.cpp b/Software/src/GrabWidget.cpp index 44f295cb1..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()); } @@ -490,8 +490,8 @@ void GrabWidget::wheelEvent(QWheelEvent *pe) return; } - if (pe->delta() > 0) m_colorIndex++; - if (pe->delta() < 0) m_colorIndex--; + if (pe->angleDelta().y() > 0) m_colorIndex++; + if (pe->angleDelta().y() < 0) m_colorIndex--; if (m_colorIndex >= ColorsCount) { @@ -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 13e0c075a..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 952733a95..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 << 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; } diff --git a/Software/src/Plugin.cpp b/Software/src/Plugin.cpp index cd4b84fba..21327e54d 100644 --- a/Software/src/Plugin.cpp +++ b/Software/src/Plugin.cpp @@ -107,7 +107,6 @@ void Plugin::Start() { DEBUG_LOW_LEVEL << Q_FUNC_INFO << _exec; - QString program = _exec; //QStringList arguments; //arguments << "-style" << "fusion"; @@ -119,7 +118,8 @@ void Plugin::Start() process->setEnvironment(QProcess::systemEnvironment()); // process->setProcessChannelMode(QProcess::ForwardedChannels); - process->start(program,NULL); + process->setProgram(_exec); + process->start(); } void Plugin::Stop() diff --git a/Software/src/SettingsWindow.cpp b/Software/src/SettingsWindow.cpp index 8f8acdd3a..9d4ee42f3 100644 --- a/Software/src/SettingsWindow.cpp +++ b/Software/src/SettingsWindow.cpp @@ -2249,16 +2249,13 @@ QString SettingsWindow::getPluginName(const Plugin *plugin) const void SettingsWindow::on_pbRunConfigurationWizard_clicked() { + const QStringList args("--wizard"); + QString cmdLine(QApplication::applicationFilePath()); #ifdef Q_OS_WIN - QString cmdLine; - cmdLine.append("\""); - cmdLine.append(QApplication::applicationFilePath()); - cmdLine.append("\""); - cmdLine.append(" --wizard"); - QProcess::startDetached(cmdLine); -#else - QProcess::startDetached(QApplication::applicationFilePath().append(" --wizard")); + cmdLine.prepend('"'); + cmdLine.append('"'); #endif + QProcess::startDetached(cmdLine, args); quit(); }