diff --git a/src/external-macro-modules/opencv/macro-condition-video.cpp b/src/external-macro-modules/opencv/macro-condition-video.cpp index 7602e300..16b2ec6f 100644 --- a/src/external-macro-modules/opencv/macro-condition-video.cpp +++ b/src/external-macro-modules/opencv/macro-condition-video.cpp @@ -9,6 +9,7 @@ #include #include #include +#include const std::string MacroConditionVideo::id = "video"; @@ -542,12 +543,23 @@ void MacroConditionVideoEdit::ImageBrowseButtonClicked() "AdvSceneSwitcher.condition.video.askFileAction"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + msgBox.setButtonText( + QMessageBox::Yes, + obs_module_text( + "AdvSceneSwitcher.condition.video.askFileAction.file")); + msgBox.setButtonText( + QMessageBox::No, + obs_module_text( + "AdvSceneSwitcher.condition.video.askFileAction.screenshot")); +#else auto yes = msgBox.button(QMessageBox::StandardButton::Yes); yes->setText(obs_module_text( "AdvSceneSwitcher.condition.video.askFileAction.file")); auto no = msgBox.button(QMessageBox::StandardButton::No); no->setText(obs_module_text( "AdvSceneSwitcher.condition.video.askFileAction.screenshot")); +#endif msgBox.setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint); const auto result = msgBox.exec(); diff --git a/src/macro-segment-list.cpp b/src/macro-segment-list.cpp index ba9099bb..e6b9c0b4 100644 --- a/src/macro-segment-list.cpp +++ b/src/macro-segment-list.cpp @@ -8,6 +8,7 @@ #include #include #include +#include MacroSegmentList::MacroSegmentList(QWidget *parent) : QScrollArea(parent), @@ -155,7 +156,11 @@ bool MacroSegmentList::eventFilter(QObject *object, QEvent *event) void MacroSegmentList::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + _dragPosition = GetDragIndex(event->globalPos()); +#else _dragPosition = GetDragIndex(event->globalPosition().toPoint()); +#endif emit SelectionChagned(_dragPosition); } else { _dragPosition = -1; @@ -263,7 +268,11 @@ void MacroSegmentList::dragMoveEvent(QDragMoveEvent *event) return; } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + _dragCursorPos = (mapToGlobal(event->pos())); +#else _dragCursorPos = (mapToGlobal(event->position().toPoint())); +#endif CheckDropLine(_dragCursorPos); } @@ -409,6 +418,16 @@ void MacroSegmentList::dropEvent(QDropEvent *event) { HideLastDropLine(); auto widget = qobject_cast(event->source()); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + if (widget && !widget->geometry().contains(event->pos()) && + widgetIsInLayout(widget, _contentLayout)) { + int dropPosition = GetDropIndex(mapToGlobal(event->pos())); + if (dropPosition == -1) { + return; + } + emit Reorder(dropPosition, _dragPosition); + } +#else if (widget && !widget->geometry().contains(event->position().toPoint()) && widgetIsInLayout(widget, _contentLayout)) { @@ -419,5 +438,6 @@ void MacroSegmentList::dropEvent(QDropEvent *event) } emit Reorder(dropPosition, _dragPosition); } +#endif _dragPosition = -1; } diff --git a/src/switch-file.cpp b/src/switch-file.cpp index f6a42d40..55eeb025 100644 --- a/src/switch-file.cpp +++ b/src/switch-file.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -114,7 +115,11 @@ void SwitcherData::writeToStatusFile(const QString &msg) QFile file(QString::fromStdString(fileIO.writePath)); if (file.open(QIODevice::ReadWrite)) { QTextStream stream(&file); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + stream << msg << endl; +#else stream << msg << Qt::endl; +#endif } file.close(); }