From 08763cea9c817c51cedac198899e109e558ceda2 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Tue, 29 Sep 2026 15:17:34 -0400 Subject: [PATCH 1/2] frontend: Remove Qt<6.10 code Qt 6.10 is the minimum supported Qt version now. --- frontend/OBSApp.cpp | 13 ------- frontend/cmake/os-freebsd.cmake | 4 --- frontend/cmake/os-linux.cmake | 4 --- frontend/components/SceneTree.cpp | 10 ------ frontend/components/SceneTree.hpp | 3 -- frontend/dialogs/OBSBasicTransform.cpp | 4 --- frontend/dialogs/OBSYoutubeActions.cpp | 45 ++++++++++-------------- frontend/oauth/YoutubeAuth.cpp | 9 +---- frontend/settings/OBSBasicSettings.cpp | 42 ---------------------- frontend/settings/OBSBasicSettings.hpp | 4 --- frontend/utility/item-widget-helpers.cpp | 9 ----- frontend/widgets/OBSQTDisplay.cpp | 8 ----- 12 files changed, 20 insertions(+), 135 deletions(-) diff --git a/frontend/OBSApp.cpp b/frontend/OBSApp.cpp index 4e0d8fb4c71135..080e9d6402646c 100644 --- a/frontend/OBSApp.cpp +++ b/frontend/OBSApp.cpp @@ -30,9 +30,6 @@ #if !defined(_WIN32) && !defined(__APPLE__) #include -#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) -#include -#endif #endif #include @@ -128,9 +125,7 @@ UncleanLaunchAction handleUncleanShutdown(bool enableCrashUpload) QMessageBox crashWarning; crashWarning.setIcon(QMessageBox::Warning); -#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) crashWarning.setOption(QMessageBox::Option::DontUseNativeDialog); -#endif crashWarning.setWindowTitle(QTStr("CrashHandling.Dialog.Title")); crashWarning.setText(QTStr("CrashHandling.Labels.Text")); @@ -1284,11 +1279,9 @@ bool OBSApp::OBSInit() #if !defined(_WIN32) && !defined(__APPLE__) if (QApplication::platformName() == "xcb") { -#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) auto native = qGuiApp->nativeInterface(); obs_set_nix_platform_display(native->display()); -#endif obs_set_nix_platform(OBS_NIX_PLATFORM_X11_EGL); @@ -1297,11 +1290,9 @@ bool OBSApp::OBSInit() #ifdef ENABLE_WAYLAND if (QApplication::platformName().contains("wayland")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) auto native = qGuiApp->nativeInterface(); obs_set_nix_platform_display(native->display()); -#endif obs_set_nix_platform(OBS_NIX_PLATFORM_WAYLAND); setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); @@ -1310,10 +1301,6 @@ bool OBSApp::OBSInit() } #endif -#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0) - QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - obs_set_nix_platform_display(native->nativeResourceForIntegration("display")); -#endif #endif #ifdef __APPLE__ diff --git a/frontend/cmake/os-freebsd.cmake b/frontend/cmake/os-freebsd.cmake index 3cc6403c4323ae..a95e7dfcfb3b88 100644 --- a/frontend/cmake/os-freebsd.cmake +++ b/frontend/cmake/os-freebsd.cmake @@ -9,10 +9,6 @@ target_sources( target_compile_definitions(obs-studio PRIVATE OBS_INSTALL_PREFIX="${OBS_INSTALL_PREFIX}") target_link_libraries(obs-studio PRIVATE Qt::DBus procstat) -if(Qt6_VERSION AND Qt6_VERSION VERSION_LESS "6.9.0") - target_link_libraries(obs-studio PRIVATE Qt::GuiPrivate) -endif() - find_package(Libpci REQUIRED) target_link_libraries(obs-studio PRIVATE Libpci::pci) diff --git a/frontend/cmake/os-linux.cmake b/frontend/cmake/os-linux.cmake index d146e7297e1e49..b644ea024929af 100644 --- a/frontend/cmake/os-linux.cmake +++ b/frontend/cmake/os-linux.cmake @@ -12,10 +12,6 @@ target_compile_definitions( ) target_link_libraries(obs-studio PRIVATE Qt::DBus) -if(Qt6_VERSION AND Qt6_VERSION VERSION_LESS "6.9.0") - target_link_libraries(obs-studio PRIVATE Qt::GuiPrivate) -endif() - find_package(Libpci REQUIRED) target_link_libraries(obs-studio PRIVATE Libpci::pci) diff --git a/frontend/components/SceneTree.cpp b/frontend/components/SceneTree.cpp index a5d9a7f2967d77..b0b17dfe4e5802 100644 --- a/frontend/components/SceneTree.cpp +++ b/frontend/components/SceneTree.cpp @@ -235,13 +235,3 @@ void SceneTree::rowsInserted(const QModelIndex &parent, int start, int end) QListWidget::rowsInserted(parent, start, end); } - -#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) -// Workaround for QTBUG-105870. Remove once that is solved upstream. -void SceneTree::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) -{ - if (selected.count() == 0 && deselected.count() > 0 && !property("clearing").toBool()) { - setCurrentRow(deselected.indexes().front().row()); - } -} -#endif diff --git a/frontend/components/SceneTree.hpp b/frontend/components/SceneTree.hpp index b4fb7dc6706b8f..608906df8d0f71 100644 --- a/frontend/components/SceneTree.hpp +++ b/frontend/components/SceneTree.hpp @@ -36,9 +36,6 @@ class SceneTree : public QListWidget { virtual void dragMoveEvent(QDragMoveEvent *event) override; virtual void dragLeaveEvent(QDragLeaveEvent *event) override; virtual void rowsInserted(const QModelIndex &parent, int start, int end) override; -#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) - virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override; -#endif signals: void scenesReordered(); diff --git a/frontend/dialogs/OBSBasicTransform.cpp b/frontend/dialogs/OBSBasicTransform.cpp index 2d84fb4f0aa0a9..49a36866ddd541 100644 --- a/frontend/dialogs/OBSBasicTransform.cpp +++ b/frontend/dialogs/OBSBasicTransform.cpp @@ -92,11 +92,7 @@ OBSBasicTransform::OBSBasicTransform(OBSSceneItem item, OBSBasic *parent) hookWidget(ui->cropRight, ISCROLL_CHANGED, &OBSBasicTransform::onCropChanged); hookWidget(ui->cropTop, ISCROLL_CHANGED, &OBSBasicTransform::onCropChanged); hookWidget(ui->cropBottom, ISCROLL_CHANGED, &OBSBasicTransform::onCropChanged); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) hookWidget(ui->cropToBounds, &QCheckBox::checkStateChanged, &OBSBasicTransform::onControlChanged); -#else - hookWidget(ui->cropToBounds, &QCheckBox::stateChanged, &OBSBasicTransform::onControlChanged); -#endif ui->buttonBox->button(QDialogButtonBox::Close)->setDefault(true); connect(ui->buttonBox->button(QDialogButtonBox::Reset), &QPushButton::clicked, main, diff --git a/frontend/dialogs/OBSYoutubeActions.cpp b/frontend/dialogs/OBSYoutubeActions.cpp index 3a031a09e1e232..0b4006fb424915 100644 --- a/frontend/dialogs/OBSYoutubeActions.cpp +++ b/frontend/dialogs/OBSYoutubeActions.cpp @@ -53,33 +53,26 @@ OBSYoutubeActions::OBSYoutubeActions(QWidget *parent, Auth *auth, bool broadcast [](const QString &link) { QDesktopServices::openUrl(QUrl(link)); }); ui->scheduledTime->setVisible(false); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) - connect(ui->checkScheduledLater, &QCheckBox::checkStateChanged, this, - [&](Qt::CheckState state) -#else - connect(ui->checkScheduledLater, &QCheckBox::stateChanged, this, - [&](int state) -#endif - { - const bool checked = (state == Qt::Checked); - ui->scheduledTime->setVisible(checked); - if (checked) { - ui->checkAutoStart->setVisible(true); - ui->checkAutoStop->setVisible(true); - ui->helpAutoStartStop->setVisible(true); - - ui->checkAutoStart->setChecked(false); - ui->checkAutoStop->setChecked(false); - } else { - ui->checkAutoStart->setVisible(false); - ui->checkAutoStop->setVisible(false); - ui->helpAutoStartStop->setVisible(false); + connect(ui->checkScheduledLater, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) { + const bool checked = (state == Qt::Checked); + ui->scheduledTime->setVisible(checked); + if (checked) { + ui->checkAutoStart->setVisible(true); + ui->checkAutoStop->setVisible(true); + ui->helpAutoStartStop->setVisible(true); + + ui->checkAutoStart->setChecked(false); + ui->checkAutoStop->setChecked(false); + } else { + ui->checkAutoStart->setVisible(false); + ui->checkAutoStop->setVisible(false); + ui->helpAutoStartStop->setVisible(false); - ui->checkAutoStart->setChecked(true); - ui->checkAutoStop->setChecked(true); - } - UpdateOkButtonStatus(); - }); + ui->checkAutoStart->setChecked(true); + ui->checkAutoStop->setChecked(true); + } + UpdateOkButtonStatus(); + }); ui->checkAutoStart->setVisible(false); ui->checkAutoStop->setVisible(false); diff --git a/frontend/oauth/YoutubeAuth.cpp b/frontend/oauth/YoutubeAuth.cpp index 2e02f3202a5210..415e5ad943e984 100644 --- a/frontend/oauth/YoutubeAuth.cpp +++ b/frontend/oauth/YoutubeAuth.cpp @@ -245,7 +245,7 @@ std::shared_ptr YoutubeAuth::Login(QWidget *owner, const std::string &serv dlg.setText(text); dlg.setTextFormat(Qt::RichText); dlg.setStandardButtons(QMessageBox::StandardButton::Cancel); -#if defined(__APPLE__) && QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) +#if defined(__APPLE__) /* We can't show clickable links with the native NSAlert, so let's * force the old non-native dialog instead. */ dlg.setOption(QMessageBox::Option::DontUseNativeDialog); @@ -280,14 +280,7 @@ std::shared_ptr YoutubeAuth::Login(QWidget *owner, const std::string &serv QScopedPointer thread(CreateQThread(open_external_browser)); thread->start(); -#if defined(__APPLE__) && QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && QT_VERSION < QT_VERSION_CHECK(6, 6, 0) - const bool nativeDialogs = qApp->testAttribute(Qt::AA_DontUseNativeDialogs); - App()->setAttribute(Qt::AA_DontUseNativeDialogs, true); dlg.exec(); - App()->setAttribute(Qt::AA_DontUseNativeDialogs, nativeDialogs); -#else - dlg.exec(); -#endif if (dlg.result() == QMessageBox::Cancel || dlg.result() == QDialog::Rejected) { return nullptr; diff --git a/frontend/settings/OBSBasicSettings.cpp b/frontend/settings/OBSBasicSettings.cpp index 43a82d417a3c9f..1a485143cdeb60 100644 --- a/frontend/settings/OBSBasicSettings.cpp +++ b/frontend/settings/OBSBasicSettings.cpp @@ -776,11 +776,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent) connect(ui->simpleOutputABitrate, &QComboBox::currentIndexChanged, this, &OBSBasicSettings::SimpleReplayBufferChanged); connect(ui->simpleRBSecMax, &QSpinBox::valueChanged, this, &OBSBasicSettings::SimpleReplayBufferChanged); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) connect(ui->advOutSplitFile, &QCheckBox::checkStateChanged, this, &OBSBasicSettings::AdvOutSplitFileChanged); -#else - connect(ui->advOutSplitFile, &QCheckBox::stateChanged, this, &OBSBasicSettings::AdvOutSplitFileChanged); -#endif connect(ui->advOutSplitFileType, &QComboBox::currentIndexChanged, this, &OBSBasicSettings::AdvOutSplitFileChanged); connect(ui->advReplayBuf, &QCheckBox::toggled, this, &OBSBasicSettings::AdvReplayBufferChanged); @@ -1298,13 +1294,8 @@ void OBSBasicSettings::LoadGeneralSettings() config_get_bool(App()->GetUserConfig(), "BasicWindow", "HideOBSWindowsFromCapture"); ui->hideOBSFromCapture->setChecked(hideWindowFromCapture); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) connect(ui->hideOBSFromCapture, &QCheckBox::checkStateChanged, this, &OBSBasicSettings::HideOBSWindowWarning); -#else - connect(ui->hideOBSFromCapture, &QCheckBox::stateChanged, this, - &OBSBasicSettings::HideOBSWindowWarning); -#endif } #endif @@ -4396,11 +4387,7 @@ void OBSBasicSettings::SpeakerLayoutChanged(int idx) UpdateAudioWarnings(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) void OBSBasicSettings::HideOBSWindowWarning(Qt::CheckState state) -#else -void OBSBasicSettings::HideOBSWindowWarning(int state) -#endif { if (loading || state == Qt::Unchecked) { return; @@ -4768,29 +4755,6 @@ void OBSBasicSettings::AdvOutRecCheckCodecs() } } -#if defined(__APPLE__) && QT_VERSION < QT_VERSION_CHECK(6, 5, 1) -// Workaround for QTBUG-56064 on macOS -static void ResetInvalidSelection(QComboBox *cbox) -{ - int idx = cbox->currentIndex(); - if (idx < 0) { - return; - } - - QStandardItemModel *model = dynamic_cast(cbox->model()); - QStandardItem *item = model->item(idx); - - if (item->isEnabled()) { - return; - } - - // Reset to "invalid" state if item was disabled - cbox->blockSignals(true); - cbox->setCurrentIndex(-1); - cbox->blockSignals(false); -} -#endif - void OBSBasicSettings::AdvOutRecCheckWarnings() { auto Checked = [](QCheckBox *box) { @@ -4834,12 +4798,6 @@ void OBSBasicSettings::AdvOutRecCheckWarnings() ui->autoRemux->setText(QTStr("Basic.Settings.Advanced.AutoRemux").arg("mp4")); } -#if defined(__APPLE__) && QT_VERSION < QT_VERSION_CHECK(6, 5, 1) - // Workaround for QTBUG-56064 on macOS - ResetInvalidSelection(ui->advOutRecEncoder); - ResetInvalidSelection(ui->advOutRecAEncoder); -#endif - // Show warning if codec selection was reset to an invalid state if (ui->advOutRecEncoder->currentIndex() == -1 || ui->advOutRecAEncoder->currentIndex() == -1) { if (!warningMsg.isEmpty()) { diff --git a/frontend/settings/OBSBasicSettings.hpp b/frontend/settings/OBSBasicSettings.hpp index 38412505398bf6..092288030b9fd9 100644 --- a/frontend/settings/OBSBasicSettings.hpp +++ b/frontend/settings/OBSBasicSettings.hpp @@ -388,11 +388,7 @@ private slots: void GeneralChanged(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) void HideOBSWindowWarning(Qt::CheckState state); -#else - void HideOBSWindowWarning(int state); -#endif void AudioChanged(); void AudioChangedRestart(); void ReloadAudioSources(); diff --git a/frontend/utility/item-widget-helpers.cpp b/frontend/utility/item-widget-helpers.cpp index bb0088bd79124a..1ab2ee84f3c138 100644 --- a/frontend/utility/item-widget-helpers.cpp +++ b/frontend/utility/item-widget-helpers.cpp @@ -40,11 +40,6 @@ void DeleteListItem(QListWidget *widget, QListWidgetItem *item) void ClearListItems(QListWidget *widget) { -#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) - // Workaround for the SceneTree workaround for QTBUG-105870 - widget->setProperty("clearing", true); -#endif - widget->setCurrentItem(nullptr, QItemSelectionModel::Clear); for (int i = 0; i < widget->count(); i++) { @@ -52,8 +47,4 @@ void ClearListItems(QListWidget *widget) } widget->clear(); -#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3) - // Workaround for the SceneTree workaround for QTBUG-105870 - widget->setProperty("clearing", false); -#endif } diff --git a/frontend/widgets/OBSQTDisplay.cpp b/frontend/widgets/OBSQTDisplay.cpp index 9e65f4dfb3624f..ab00b9629e7d61 100644 --- a/frontend/widgets/OBSQTDisplay.cpp +++ b/frontend/widgets/OBSQTDisplay.cpp @@ -10,9 +10,6 @@ #include #ifdef ENABLE_WAYLAND #include -#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0) -#include -#endif #endif #ifdef _WIN32 @@ -52,12 +49,7 @@ static bool QTToGSWindow(QWindow *window, gs_window &gswindow) break; #ifdef ENABLE_WAYLAND case OBS_NIX_PLATFORM_WAYLAND: { -#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0) - QPlatformNativeInterface *native = QGuiApplication::platformNativeInterface(); - gswindow.display = native->nativeResourceForWindow("surface", window); -#else gswindow.display = (void *)window->winId(); -#endif success = gswindow.display != nullptr; break; } From 63c042981432e8fd766b5a0140e55ee257fb43f6 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Tue, 29 Sep 2026 15:18:10 -0400 Subject: [PATCH 2/2] shared: Remove Qt<6.10 code Qt 6.10 is the minimum supported Qt version now. --- shared/properties-view/properties-view.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/shared/properties-view/properties-view.cpp b/shared/properties-view/properties-view.cpp index 1757abe6ec9a93..c41fc798126794 100644 --- a/shared/properties-view/properties-view.cpp +++ b/shared/properties-view/properties-view.cpp @@ -275,11 +275,7 @@ QWidget *OBSPropertiesView::AddCheckbox(obs_property_t *prop) QCheckBox *checkbox = new QCheckBox(QT_UTF8(desc)); checkbox->setCheckState(val ? Qt::Checked : Qt::Unchecked); -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) QWidget *widget = NewWidget(prop, checkbox, &QCheckBox::checkStateChanged); -#else - QWidget *widget = NewWidget(prop, checkbox, &QCheckBox::stateChanged); -#endif if (!long_desc) { return widget;