mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-06-07 23:35:47 -04:00
UI: Cleanup Qt for Qt6
This changes cleans up some deprecated functions that were removed in Qt6. Some are placed behind version ifdefs and others are replaced for their non-deprecated Qt5 version.
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include <QShowEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
#include <QColorDialog>
|
||||
#include <QSizePolicy>
|
||||
@@ -73,7 +72,6 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#include <QScreen>
|
||||
#include <QWindow>
|
||||
|
||||
#include <json11.hpp>
|
||||
@@ -207,8 +205,10 @@ extern void RegisterRestreamAuth();
|
||||
OBSBasic::OBSBasic(QWidget *parent)
|
||||
: OBSMainWindow(parent), ui(new Ui::OBSBasic)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<SignalContainer<OBSScene>>(
|
||||
"SignalContainer<OBSScene>");
|
||||
#endif
|
||||
|
||||
setAttribute(Qt::WA_NativeWindow);
|
||||
|
||||
@@ -263,10 +263,12 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
qRegisterMetaType<obs_hotkey_id>("obs_hotkey_id");
|
||||
qRegisterMetaType<SavedProjectorInfo *>("SavedProjectorInfo *");
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<std::vector<std::shared_ptr<OBSSignal>>>(
|
||||
"std::vector<std::shared_ptr<OBSSignal>>");
|
||||
qRegisterMetaTypeStreamOperators<OBSScene>("OBSScene");
|
||||
qRegisterMetaTypeStreamOperators<OBSSceneItem>("OBSSceneItem");
|
||||
#endif
|
||||
|
||||
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
@@ -384,7 +386,8 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
|
||||
QRect windowGeometry = normalGeometry();
|
||||
if (!WindowPositionValid(windowGeometry)) {
|
||||
QRect rect = App()->desktop()->geometry();
|
||||
QRect rect =
|
||||
QGuiApplication::primaryScreen()->geometry();
|
||||
setGeometry(QStyle::alignedRect(Qt::LeftToRight,
|
||||
Qt::AlignCenter, size(),
|
||||
rect));
|
||||
@@ -7286,7 +7289,8 @@ void OBSBasic::OpenSavedProjector(SavedProjectorInfo *info)
|
||||
projector->restoreGeometry(byteArray);
|
||||
|
||||
if (!WindowPositionValid(projector->normalGeometry())) {
|
||||
QRect rect = App()->desktop()->geometry();
|
||||
QRect rect = QGuiApplication::primaryScreen()
|
||||
->geometry();
|
||||
projector->setGeometry(QStyle::alignedRect(
|
||||
Qt::LeftToRight, Qt::AlignCenter,
|
||||
size(), rect));
|
||||
|
||||
Reference in New Issue
Block a user