diff --git a/UI/focus-list.cpp b/UI/focus-list.cpp index 2894cfa8b..9a6e97a87 100644 --- a/UI/focus-list.cpp +++ b/UI/focus-list.cpp @@ -12,11 +12,7 @@ void FocusList::focusInEvent(QFocusEvent *event) void FocusList::dragMoveEvent(QDragMoveEvent *event) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QPoint pos = event->position().toPoint(); -#else - QPoint pos = event->pos(); -#endif int itemRow = row(itemAt(pos)); if ((itemRow == currentRow() + 1) || diff --git a/UI/hotkey-edit.cpp b/UI/hotkey-edit.cpp index 7e385a157..bcd049428 100644 --- a/UI/hotkey-edit.cpp +++ b/UI/hotkey-edit.cpp @@ -439,11 +439,7 @@ static inline void updateStyle(QWidget *widget) widget->update(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void OBSHotkeyWidget::enterEvent(QEnterEvent *event) -#else -void OBSHotkeyWidget::enterEvent(QEvent *event) -#endif { if (!label) return; @@ -472,11 +468,7 @@ void OBSHotkeyLabel::highlightPair(bool highlight) updateStyle(this); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void OBSHotkeyLabel::enterEvent(QEnterEvent *event) -#else -void OBSHotkeyLabel::enterEvent(QEvent *event) -#endif { if (!pairPartner) diff --git a/UI/hotkey-edit.hpp b/UI/hotkey-edit.hpp index cd1e6b2cd..518607e2d 100644 --- a/UI/hotkey-edit.hpp +++ b/UI/hotkey-edit.hpp @@ -49,11 +49,7 @@ public: QPointer pairPartner; QPointer widget; void highlightPair(bool highlight); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEnterEvent *event) override; -#else - void enterEvent(QEvent *event) override; -#endif void leaveEvent(QEvent *event) override; void setToolTip(const QString &toolTip); }; @@ -172,11 +168,7 @@ public: void Save(); void Save(std::vector &combinations); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEnterEvent *event) override; -#else - void enterEvent(QEvent *event) override; -#endif void leaveEvent(QEvent *event) override; private: diff --git a/UI/log-viewer.cpp b/UI/log-viewer.cpp index 25e19c12d..8f894de4a 100644 --- a/UI/log-viewer.cpp +++ b/UI/log-viewer.cpp @@ -66,9 +66,6 @@ void OBSLogViewer::InitLog() if (file.open(QIODevice::ReadOnly)) { QTextStream in(&file); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - in.setCodec("UTF-8"); -#endif QTextDocument *doc = ui->textArea->document(); QTextCursor cursor(doc); diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 48c4a3dfb..46ab14da0 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -98,9 +98,6 @@ bool opt_start_virtualcam = false; bool opt_minimize_tray = false; bool opt_allow_opengl = false; bool opt_always_on_top = false; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -bool opt_disable_high_dpi_scaling = false; -#endif bool opt_disable_updater = false; bool opt_disable_missing_files_check = false; string opt_starting_collection; @@ -1659,10 +1656,6 @@ bool OBSApp::OBSInit() { ProfileScope("OBSApp::OBSInit"); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif - qRegisterMetaType("VoidFunc"); #if !defined(_WIN32) && !defined(__APPLE__) @@ -2319,13 +2312,7 @@ static int run_program(fstream &logFile, int argc, char *argv[]) ScopeProfiler prof{run_program_init}; -#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) && \ - (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) - QGuiApplication::setAttribute(opt_disable_high_dpi_scaling - ? Qt::AA_DisableHighDpiScaling - : Qt::AA_EnableHighDpiScaling); -#endif -#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) && defined(_WIN32) +#ifdef _WIN32 QGuiApplication::setHighDpiScaleFactorRoundingPolicy( Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif @@ -3344,11 +3331,6 @@ int main(int argc, char *argv[]) } else if (arg_is(argv[i], "--steam", nullptr)) { steam = true; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - } else if (arg_is(argv[i], "--disable-high-dpi-scaling", - nullptr)) { - opt_disable_high_dpi_scaling = true; -#endif } else if (arg_is(argv[i], "--help", "-h")) { std::string help = "--help, -h: Get list of available commands.\n\n" @@ -3370,11 +3352,7 @@ int main(int argc, char *argv[]) "--always-on-top: Start in 'always on top' mode.\n\n" "--unfiltered_log: Make log unfiltered.\n\n" "--disable-updater: Disable built-in updater (Windows/Mac only)\n\n" - "--disable-missing-files-check: Disable the missing files dialog which can appear on startup.\n\n" -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - "--disable-high-dpi-scaling: Disable automatic high-DPI scaling\n\n" -#endif - ; + "--disable-missing-files-check: Disable the missing files dialog which can appear on startup.\n\n"; #ifdef _WIN32 MessageBoxA(NULL, help.c_str(), "Help", diff --git a/UI/obs-app.hpp b/UI/obs-app.hpp index 65e3d6471..b11c7895b 100644 --- a/UI/obs-app.hpp +++ b/UI/obs-app.hpp @@ -276,9 +276,6 @@ extern bool opt_minimize_tray; extern bool opt_studio_mode; extern bool opt_allow_opengl; extern bool opt_always_on_top; -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -extern bool opt_disable_high_dpi_scaling; -#endif extern std::string opt_starting_scene; extern bool restart; diff --git a/UI/qt-display.cpp b/UI/qt-display.cpp index c8fb28784..e74e162e0 100644 --- a/UI/qt-display.cpp +++ b/UI/qt-display.cpp @@ -195,11 +195,7 @@ void OBSQTDisplay::moveEvent(QMoveEvent *event) OnMove(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool OBSQTDisplay::nativeEvent(const QByteArray &, void *message, qintptr *) -#else -bool OBSQTDisplay::nativeEvent(const QByteArray &, void *message, long *) -#endif { #ifdef _WIN32 const MSG &msg = *static_cast(message); diff --git a/UI/qt-display.hpp b/UI/qt-display.hpp index 4c3b3c92b..10fe735ed 100644 --- a/UI/qt-display.hpp +++ b/UI/qt-display.hpp @@ -16,13 +16,8 @@ class OBSQTDisplay : public QWidget { virtual void paintEvent(QPaintEvent *event) override; virtual void moveEvent(QMoveEvent *event) override; virtual void resizeEvent(QResizeEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; -#endif signals: void DisplayCreated(OBSQTDisplay *window); diff --git a/UI/scene-tree.cpp b/UI/scene-tree.cpp index 91fb2a2ae..f5386e1e6 100644 --- a/UI/scene-tree.cpp +++ b/UI/scene-tree.cpp @@ -125,11 +125,7 @@ void SceneTree::dropEvent(QDropEvent *event) float wid = contentsRect().width() - scrollWid - 1; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QPoint point = event->position().toPoint(); -#else - QPoint point = event->pos(); -#endif int x = (float)point.x() / wid * std::ceil(wid / maxWidth); int y = (point.y() + firstItemY) / itemHeight; @@ -170,11 +166,7 @@ void SceneTree::RepositionGrid(QDragMoveEvent *event) float wid = contentsRect().width() - scrollWid - 1; if (event) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QPoint point = event->position().toPoint(); -#else - QPoint point = event->pos(); -#endif int x = (float)point.x() / wid * std::ceil(wid / maxWidth); int y = (point.y() + firstItemY) / itemHeight; diff --git a/UI/slider-ignorewheel.cpp b/UI/slider-ignorewheel.cpp index 5db4b0f45..8ce293f3c 100644 --- a/UI/slider-ignorewheel.cpp +++ b/UI/slider-ignorewheel.cpp @@ -101,17 +101,7 @@ void SliderIgnoreClick::mousePressEvent(QMouseEvent *event) initStyleOption(&styleOption); QRect handle = style()->subControlRect(QStyle::CC_Slider, &styleOption, QStyle::SC_SliderHandle, this); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - QPointF pointExact = event->position(); -#endif - if (handle.contains( -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - QPoint(pointExact.x(), pointExact.y()) -#else - // Ubuntu 20.04. Sigh. - QPoint(event->x(), event->y()) -#endif - )) { + if (handle.contains(event->position().toPoint())) { SliderIgnoreScroll::mousePressEvent(event); dragging = true; } else { diff --git a/UI/source-tree.cpp b/UI/source-tree.cpp index f83de1346..0ba15cb3b 100644 --- a/UI/source-tree.cpp +++ b/UI/source-tree.cpp @@ -335,11 +335,7 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event) } } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void SourceTreeItem::enterEvent(QEnterEvent *event) -#else -void SourceTreeItem::enterEvent(QEvent *event) -#endif { QWidget::enterEvent(event); @@ -1186,14 +1182,7 @@ void SourceTree::dropEvent(QDropEvent *event) QModelIndexList indices = selectedIndexes(); DropIndicatorPosition indicator = dropIndicatorPosition(); - int row = indexAt( -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - event->position().toPoint() -#else - event->pos() -#endif - ) - .row(); + int row = indexAt(event->position().toPoint()).row(); bool emptyDrop = row == -1; if (emptyDrop) { diff --git a/UI/source-tree.hpp b/UI/source-tree.hpp index 4067e6ab7..1e4139751 100644 --- a/UI/source-tree.hpp +++ b/UI/source-tree.hpp @@ -33,11 +33,7 @@ class SourceTreeItem : public QFrame { friend class SourceTreeModel; void mouseDoubleClickEvent(QMouseEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) void enterEvent(QEnterEvent *event) override; -#else - void enterEvent(QEvent *event) override; -#endif void leaveEvent(QEvent *event) override; virtual bool eventFilter(QObject *object, QEvent *event) override; diff --git a/UI/window-basic-filters.cpp b/UI/window-basic-filters.cpp index b00a3eff8..7cb061525 100644 --- a/UI/window-basic-filters.cpp +++ b/UI/window-basic-filters.cpp @@ -682,11 +682,7 @@ void OBSBasicFilters::closeEvent(QCloseEvent *event) main->SaveProject(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool OBSBasicFilters::nativeEvent(const QByteArray &, void *message, qintptr *) -#else -bool OBSBasicFilters::nativeEvent(const QByteArray &, void *message, long *) -#endif { #ifdef _WIN32 const MSG &msg = *static_cast(message); diff --git a/UI/window-basic-filters.hpp b/UI/window-basic-filters.hpp index 99ecc249f..a24962846 100644 --- a/UI/window-basic-filters.hpp +++ b/UI/window-basic-filters.hpp @@ -139,11 +139,6 @@ public: protected: virtual void closeEvent(QCloseEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; -#endif }; diff --git a/UI/window-basic-interaction.cpp b/UI/window-basic-interaction.cpp index 921ff8021..777da9365 100644 --- a/UI/window-basic-interaction.cpp +++ b/UI/window-basic-interaction.cpp @@ -176,12 +176,8 @@ void OBSBasicInteraction::closeEvent(QCloseEvent *event) this); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool OBSBasicInteraction::nativeEvent(const QByteArray &, void *message, qintptr *) -#else -bool OBSBasicInteraction::nativeEvent(const QByteArray &, void *message, long *) -#endif { #ifdef _WIN32 const MSG &msg = *static_cast(message); @@ -366,14 +362,9 @@ bool OBSBasicInteraction::HandleMouseWheelEvent(QWheelEvent *event) yDelta = angleDelta.y(); } -#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) const QPointF position = event->position(); const int x = position.x(); const int y = position.y(); -#else - const int x = event->x(); - const int y = event->y(); -#endif if (GetSourceRelativeXY(x, y, mouseEvent.x, mouseEvent.y)) { obs_source_send_mouse_wheel(source, &mouseEvent, xDelta, diff --git a/UI/window-basic-interaction.hpp b/UI/window-basic-interaction.hpp index 1f97af74f..029a5fe08 100644 --- a/UI/window-basic-interaction.hpp +++ b/UI/window-basic-interaction.hpp @@ -65,13 +65,8 @@ public: protected: virtual void closeEvent(QCloseEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; -#endif }; typedef std::function EventFilterFunc; diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 74b76a922..e3cc220be 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -271,11 +271,7 @@ void setupDockAction(QDockWidget *dock) dock->connect(action, &QAction::triggered, newToggleView); // Make the action unable to be disabled -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - action->connect(action, &QAction::changed, neverDisable); -#else action->connect(action, &QAction::enabledChanged, neverDisable); -#endif } extern void RegisterTwitchAuth(); @@ -287,11 +283,6 @@ extern void RegisterYoutubeAuth(); OBSBasic::OBSBasic(QWidget *parent) : OBSMainWindow(parent), undo_s(ui), ui(new Ui::OBSBasic) { -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - qRegisterMetaTypeStreamOperators>( - "SignalContainer"); -#endif - setAttribute(Qt::WA_NativeWindow); #ifdef TWITCH_ENABLED @@ -340,13 +331,6 @@ OBSBasic::OBSBasic(QWidget *parent) qRegisterMetaType("obs_hotkey_id"); qRegisterMetaType("SavedProjectorInfo *"); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - qRegisterMetaTypeStreamOperators>>( - "std::vector>"); - qRegisterMetaTypeStreamOperators("OBSScene"); - qRegisterMetaTypeStreamOperators("OBSSource"); -#endif - ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false); ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false); @@ -1971,11 +1955,7 @@ void OBSBasic::OBSInit() /* hack to prevent elgato from loading its own QtNetwork that it tries * to ship with */ #if defined(_WIN32) && !defined(_DEBUG) -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - LoadLibraryW(L"Qt5Network"); -#else LoadLibraryW(L"Qt6Network"); -#endif #endif struct obs_module_failure_info mfi; @@ -5094,11 +5074,7 @@ void OBSBasic::closeEvent(QCloseEvent *event) QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool OBSBasic::nativeEvent(const QByteArray &, void *message, qintptr *) -#else -bool OBSBasic::nativeEvent(const QByteArray &, void *message, long *) -#endif { #ifdef _WIN32 const MSG &msg = *static_cast(message); diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 5fe9f5439..be51ecc28 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -1020,13 +1020,8 @@ public: protected: virtual void closeEvent(QCloseEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; -#endif virtual void changeEvent(QEvent *event) override; private slots: diff --git a/UI/window-basic-preview.cpp b/UI/window-basic-preview.cpp index 6f43f9572..2f7fa9060 100644 --- a/UI/window-basic-preview.cpp +++ b/UI/window-basic-preview.cpp @@ -573,11 +573,7 @@ void OBSBasicPreview::wheelEvent(QWheelEvent *event) void OBSBasicPreview::mousePressEvent(QMouseEvent *event) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QPointF pos = event->position(); -#else - QPointF pos = event->localPos(); -#endif if (scrollMode && IsFixedScaling() && event->button() == Qt::LeftButton) { @@ -1595,11 +1591,7 @@ void OBSBasicPreview::mouseMoveEvent(QMouseEvent *event) OBSBasic *main = reinterpret_cast(App()->GetMainWindow()); changed = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QPointF qtPos = event->position(); -#else - QPointF qtPos = event->localPos(); -#endif float pixelRatio = main->GetDevicePixelRatio(); diff --git a/UI/window-basic-properties.cpp b/UI/window-basic-properties.cpp index 23edc1c36..06f2efb54 100644 --- a/UI/window-basic-properties.cpp +++ b/UI/window-basic-properties.cpp @@ -490,12 +490,8 @@ void OBSBasicProperties::closeEvent(QCloseEvent *event) Cleanup(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message, qintptr *) -#else -bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message, long *) -#endif { #ifdef _WIN32 const MSG &msg = *static_cast(message); diff --git a/UI/window-basic-properties.hpp b/UI/window-basic-properties.hpp index 7c03f3fa6..887e48e4b 100644 --- a/UI/window-basic-properties.hpp +++ b/UI/window-basic-properties.hpp @@ -74,12 +74,7 @@ public: protected: virtual void closeEvent(QCloseEvent *event) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; -#endif virtual void reject() override; }; diff --git a/UI/window-basic-settings.cpp b/UI/window-basic-settings.cpp index ccea353ee..12753be7b 100644 --- a/UI/window-basic-settings.cpp +++ b/UI/window-basic-settings.cpp @@ -974,7 +974,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) connect(ui->advOutRecFormat, SIGNAL(currentIndexChanged(int)), this, SLOT(AdvOutRecCheckCodecs())); -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) // Set placeholder used when selection was reset due to incompatibilities ui->advOutRecEncoder->setPlaceholderText( QTStr("CodecCompat.CodecPlaceholder")); @@ -986,7 +985,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) QTStr("CodecCompat.CodecPlaceholder")); ui->simpleOutRecFormat->setPlaceholderText( QTStr("CodecCompat.ContainerPlaceholder")); -#endif SimpleRecordingQualityChanged(); AdvOutSplitFileChanged();