Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions frontend/OBSApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@

#if !defined(_WIN32) && !defined(__APPLE__)
#include <obs-nix-platform.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
#include <qpa/qplatformnativeinterface.h>
#endif
#endif
#include <qt-wrappers.hpp>

Expand Down Expand Up @@ -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"));

Expand Down Expand Up @@ -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<QNativeInterface::QX11Application>();

obs_set_nix_platform_display(native->display());
#endif

obs_set_nix_platform(OBS_NIX_PLATFORM_X11_EGL);

Expand All @@ -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<QNativeInterface::QWaylandApplication>();

obs_set_nix_platform_display(native->display());
#endif

obs_set_nix_platform(OBS_NIX_PLATFORM_WAYLAND);
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
Expand All @@ -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__
Expand Down
4 changes: 0 additions & 4 deletions frontend/cmake/os-freebsd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions frontend/cmake/os-linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 0 additions & 10 deletions frontend/components/SceneTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions frontend/components/SceneTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 0 additions & 4 deletions frontend/dialogs/OBSBasicTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
45 changes: 19 additions & 26 deletions frontend/dialogs/OBSYoutubeActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 1 addition & 8 deletions frontend/oauth/YoutubeAuth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ std::shared_ptr<Auth> 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);
Expand Down Expand Up @@ -280,14 +280,7 @@ std::shared_ptr<Auth> YoutubeAuth::Login(QWidget *owner, const std::string &serv
QScopedPointer<QThread> 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;
Expand Down
42 changes: 0 additions & 42 deletions frontend/settings/OBSBasicSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<QStandardItemModel *>(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) {
Expand Down Expand Up @@ -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()) {
Expand Down
4 changes: 0 additions & 4 deletions frontend/settings/OBSBasicSettings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
9 changes: 0 additions & 9 deletions frontend/utility/item-widget-helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,11 @@ 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++) {
delete widget->itemWidget(widget->item(i));
}

widget->clear();
#if QT_VERSION < QT_VERSION_CHECK(6, 4, 3)
// Workaround for the SceneTree workaround for QTBUG-105870
widget->setProperty("clearing", false);
#endif
}
8 changes: 0 additions & 8 deletions frontend/widgets/OBSQTDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
#include <QWindow>
#ifdef ENABLE_WAYLAND
#include <QApplication>
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
#include <qpa/qplatformnativeinterface.h>
#endif
#endif

#ifdef _WIN32
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 0 additions & 4 deletions shared/properties-view/properties-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading