UI: Remove Qt 5 ifdef guards and code
This commit is contained in:
parent
a44d1b2dce
commit
a4834efde9
@ -12,11 +12,7 @@ void FocusList::focusInEvent(QFocusEvent *event)
|
|||||||
|
|
||||||
void FocusList::dragMoveEvent(QDragMoveEvent *event)
|
void FocusList::dragMoveEvent(QDragMoveEvent *event)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QPoint pos = event->position().toPoint();
|
QPoint pos = event->position().toPoint();
|
||||||
#else
|
|
||||||
QPoint pos = event->pos();
|
|
||||||
#endif
|
|
||||||
int itemRow = row(itemAt(pos));
|
int itemRow = row(itemAt(pos));
|
||||||
|
|
||||||
if ((itemRow == currentRow() + 1) ||
|
if ((itemRow == currentRow() + 1) ||
|
||||||
|
@ -439,11 +439,7 @@ static inline void updateStyle(QWidget *widget)
|
|||||||
widget->update();
|
widget->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void OBSHotkeyWidget::enterEvent(QEnterEvent *event)
|
void OBSHotkeyWidget::enterEvent(QEnterEvent *event)
|
||||||
#else
|
|
||||||
void OBSHotkeyWidget::enterEvent(QEvent *event)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!label)
|
if (!label)
|
||||||
return;
|
return;
|
||||||
@ -472,11 +468,7 @@ void OBSHotkeyLabel::highlightPair(bool highlight)
|
|||||||
updateStyle(this);
|
updateStyle(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void OBSHotkeyLabel::enterEvent(QEnterEvent *event)
|
void OBSHotkeyLabel::enterEvent(QEnterEvent *event)
|
||||||
#else
|
|
||||||
void OBSHotkeyLabel::enterEvent(QEvent *event)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!pairPartner)
|
if (!pairPartner)
|
||||||
|
@ -49,11 +49,7 @@ public:
|
|||||||
QPointer<OBSHotkeyLabel> pairPartner;
|
QPointer<OBSHotkeyLabel> pairPartner;
|
||||||
QPointer<OBSHotkeyWidget> widget;
|
QPointer<OBSHotkeyWidget> widget;
|
||||||
void highlightPair(bool highlight);
|
void highlightPair(bool highlight);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void enterEvent(QEnterEvent *event) override;
|
void enterEvent(QEnterEvent *event) override;
|
||||||
#else
|
|
||||||
void enterEvent(QEvent *event) override;
|
|
||||||
#endif
|
|
||||||
void leaveEvent(QEvent *event) override;
|
void leaveEvent(QEvent *event) override;
|
||||||
void setToolTip(const QString &toolTip);
|
void setToolTip(const QString &toolTip);
|
||||||
};
|
};
|
||||||
@ -172,11 +168,7 @@ public:
|
|||||||
void Save();
|
void Save();
|
||||||
void Save(std::vector<obs_key_combination_t> &combinations);
|
void Save(std::vector<obs_key_combination_t> &combinations);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void enterEvent(QEnterEvent *event) override;
|
void enterEvent(QEnterEvent *event) override;
|
||||||
#else
|
|
||||||
void enterEvent(QEvent *event) override;
|
|
||||||
#endif
|
|
||||||
void leaveEvent(QEvent *event) override;
|
void leaveEvent(QEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -66,9 +66,6 @@ void OBSLogViewer::InitLog()
|
|||||||
|
|
||||||
if (file.open(QIODevice::ReadOnly)) {
|
if (file.open(QIODevice::ReadOnly)) {
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
in.setCodec("UTF-8");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QTextDocument *doc = ui->textArea->document();
|
QTextDocument *doc = ui->textArea->document();
|
||||||
QTextCursor cursor(doc);
|
QTextCursor cursor(doc);
|
||||||
|
@ -98,9 +98,6 @@ bool opt_start_virtualcam = false;
|
|||||||
bool opt_minimize_tray = false;
|
bool opt_minimize_tray = false;
|
||||||
bool opt_allow_opengl = false;
|
bool opt_allow_opengl = false;
|
||||||
bool opt_always_on_top = 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_updater = false;
|
||||||
bool opt_disable_missing_files_check = false;
|
bool opt_disable_missing_files_check = false;
|
||||||
string opt_starting_collection;
|
string opt_starting_collection;
|
||||||
@ -1659,10 +1656,6 @@ bool OBSApp::OBSInit()
|
|||||||
{
|
{
|
||||||
ProfileScope("OBSApp::OBSInit");
|
ProfileScope("OBSApp::OBSInit");
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
qRegisterMetaType<VoidFunc>("VoidFunc");
|
qRegisterMetaType<VoidFunc>("VoidFunc");
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||||
@ -2319,13 +2312,7 @@ static int run_program(fstream &logFile, int argc, char *argv[])
|
|||||||
|
|
||||||
ScopeProfiler prof{run_program_init};
|
ScopeProfiler prof{run_program_init};
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) && \
|
#ifdef _WIN32
|
||||||
(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)
|
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
|
||||||
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
#endif
|
#endif
|
||||||
@ -3344,11 +3331,6 @@ int main(int argc, char *argv[])
|
|||||||
} else if (arg_is(argv[i], "--steam", nullptr)) {
|
} else if (arg_is(argv[i], "--steam", nullptr)) {
|
||||||
steam = true;
|
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")) {
|
} else if (arg_is(argv[i], "--help", "-h")) {
|
||||||
std::string help =
|
std::string help =
|
||||||
"--help, -h: Get list of available commands.\n\n"
|
"--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"
|
"--always-on-top: Start in 'always on top' mode.\n\n"
|
||||||
"--unfiltered_log: Make log unfiltered.\n\n"
|
"--unfiltered_log: Make log unfiltered.\n\n"
|
||||||
"--disable-updater: Disable built-in updater (Windows/Mac only)\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"
|
"--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
|
|
||||||
;
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MessageBoxA(NULL, help.c_str(), "Help",
|
MessageBoxA(NULL, help.c_str(), "Help",
|
||||||
|
@ -276,9 +276,6 @@ extern bool opt_minimize_tray;
|
|||||||
extern bool opt_studio_mode;
|
extern bool opt_studio_mode;
|
||||||
extern bool opt_allow_opengl;
|
extern bool opt_allow_opengl;
|
||||||
extern bool opt_always_on_top;
|
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 std::string opt_starting_scene;
|
||||||
extern bool restart;
|
extern bool restart;
|
||||||
|
|
||||||
|
@ -195,11 +195,7 @@ void OBSQTDisplay::moveEvent(QMoveEvent *event)
|
|||||||
OnMove();
|
OnMove();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
bool OBSQTDisplay::nativeEvent(const QByteArray &, void *message, qintptr *)
|
bool OBSQTDisplay::nativeEvent(const QByteArray &, void *message, qintptr *)
|
||||||
#else
|
|
||||||
bool OBSQTDisplay::nativeEvent(const QByteArray &, void *message, long *)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const MSG &msg = *static_cast<MSG *>(message);
|
const MSG &msg = *static_cast<MSG *>(message);
|
||||||
|
@ -16,13 +16,8 @@ class OBSQTDisplay : public QWidget {
|
|||||||
virtual void paintEvent(QPaintEvent *event) override;
|
virtual void paintEvent(QPaintEvent *event) override;
|
||||||
virtual void moveEvent(QMoveEvent *event) override;
|
virtual void moveEvent(QMoveEvent *event) override;
|
||||||
virtual void resizeEvent(QResizeEvent *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,
|
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
qintptr *result) override;
|
qintptr *result) override;
|
||||||
#else
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
|
||||||
long *result) override;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void DisplayCreated(OBSQTDisplay *window);
|
void DisplayCreated(OBSQTDisplay *window);
|
||||||
|
@ -125,11 +125,7 @@ void SceneTree::dropEvent(QDropEvent *event)
|
|||||||
|
|
||||||
float wid = contentsRect().width() - scrollWid - 1;
|
float wid = contentsRect().width() - scrollWid - 1;
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QPoint point = event->position().toPoint();
|
QPoint point = event->position().toPoint();
|
||||||
#else
|
|
||||||
QPoint point = event->pos();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int x = (float)point.x() / wid * std::ceil(wid / maxWidth);
|
int x = (float)point.x() / wid * std::ceil(wid / maxWidth);
|
||||||
int y = (point.y() + firstItemY) / itemHeight;
|
int y = (point.y() + firstItemY) / itemHeight;
|
||||||
@ -170,11 +166,7 @@ void SceneTree::RepositionGrid(QDragMoveEvent *event)
|
|||||||
float wid = contentsRect().width() - scrollWid - 1;
|
float wid = contentsRect().width() - scrollWid - 1;
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QPoint point = event->position().toPoint();
|
QPoint point = event->position().toPoint();
|
||||||
#else
|
|
||||||
QPoint point = event->pos();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int x = (float)point.x() / wid * std::ceil(wid / maxWidth);
|
int x = (float)point.x() / wid * std::ceil(wid / maxWidth);
|
||||||
int y = (point.y() + firstItemY) / itemHeight;
|
int y = (point.y() + firstItemY) / itemHeight;
|
||||||
|
@ -101,17 +101,7 @@ void SliderIgnoreClick::mousePressEvent(QMouseEvent *event)
|
|||||||
initStyleOption(&styleOption);
|
initStyleOption(&styleOption);
|
||||||
QRect handle = style()->subControlRect(QStyle::CC_Slider, &styleOption,
|
QRect handle = style()->subControlRect(QStyle::CC_Slider, &styleOption,
|
||||||
QStyle::SC_SliderHandle, this);
|
QStyle::SC_SliderHandle, this);
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
if (handle.contains(event->position().toPoint())) {
|
||||||
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
|
|
||||||
)) {
|
|
||||||
SliderIgnoreScroll::mousePressEvent(event);
|
SliderIgnoreScroll::mousePressEvent(event);
|
||||||
dragging = true;
|
dragging = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -335,11 +335,7 @@ void SourceTreeItem::mouseDoubleClickEvent(QMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void SourceTreeItem::enterEvent(QEnterEvent *event)
|
void SourceTreeItem::enterEvent(QEnterEvent *event)
|
||||||
#else
|
|
||||||
void SourceTreeItem::enterEvent(QEvent *event)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
QWidget::enterEvent(event);
|
QWidget::enterEvent(event);
|
||||||
|
|
||||||
@ -1186,14 +1182,7 @@ void SourceTree::dropEvent(QDropEvent *event)
|
|||||||
QModelIndexList indices = selectedIndexes();
|
QModelIndexList indices = selectedIndexes();
|
||||||
|
|
||||||
DropIndicatorPosition indicator = dropIndicatorPosition();
|
DropIndicatorPosition indicator = dropIndicatorPosition();
|
||||||
int row = indexAt(
|
int row = indexAt(event->position().toPoint()).row();
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
event->position().toPoint()
|
|
||||||
#else
|
|
||||||
event->pos()
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
.row();
|
|
||||||
bool emptyDrop = row == -1;
|
bool emptyDrop = row == -1;
|
||||||
|
|
||||||
if (emptyDrop) {
|
if (emptyDrop) {
|
||||||
|
@ -33,11 +33,7 @@ class SourceTreeItem : public QFrame {
|
|||||||
friend class SourceTreeModel;
|
friend class SourceTreeModel;
|
||||||
|
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
void enterEvent(QEnterEvent *event) override;
|
void enterEvent(QEnterEvent *event) override;
|
||||||
#else
|
|
||||||
void enterEvent(QEvent *event) override;
|
|
||||||
#endif
|
|
||||||
void leaveEvent(QEvent *event) override;
|
void leaveEvent(QEvent *event) override;
|
||||||
|
|
||||||
virtual bool eventFilter(QObject *object, QEvent *event) override;
|
virtual bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
|
@ -682,11 +682,7 @@ void OBSBasicFilters::closeEvent(QCloseEvent *event)
|
|||||||
main->SaveProject();
|
main->SaveProject();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
bool OBSBasicFilters::nativeEvent(const QByteArray &, void *message, qintptr *)
|
bool OBSBasicFilters::nativeEvent(const QByteArray &, void *message, qintptr *)
|
||||||
#else
|
|
||||||
bool OBSBasicFilters::nativeEvent(const QByteArray &, void *message, long *)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const MSG &msg = *static_cast<MSG *>(message);
|
const MSG &msg = *static_cast<MSG *>(message);
|
||||||
|
@ -139,11 +139,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
qintptr *result) override;
|
qintptr *result) override;
|
||||||
#else
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
|
||||||
long *result) override;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
@ -176,12 +176,8 @@ void OBSBasicInteraction::closeEvent(QCloseEvent *event)
|
|||||||
this);
|
this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
bool OBSBasicInteraction::nativeEvent(const QByteArray &, void *message,
|
bool OBSBasicInteraction::nativeEvent(const QByteArray &, void *message,
|
||||||
qintptr *)
|
qintptr *)
|
||||||
#else
|
|
||||||
bool OBSBasicInteraction::nativeEvent(const QByteArray &, void *message, long *)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const MSG &msg = *static_cast<MSG *>(message);
|
const MSG &msg = *static_cast<MSG *>(message);
|
||||||
@ -366,14 +362,9 @@ bool OBSBasicInteraction::HandleMouseWheelEvent(QWheelEvent *event)
|
|||||||
yDelta = angleDelta.y();
|
yDelta = angleDelta.y();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
const QPointF position = event->position();
|
const QPointF position = event->position();
|
||||||
const int x = position.x();
|
const int x = position.x();
|
||||||
const int y = position.y();
|
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)) {
|
if (GetSourceRelativeXY(x, y, mouseEvent.x, mouseEvent.y)) {
|
||||||
obs_source_send_mouse_wheel(source, &mouseEvent, xDelta,
|
obs_source_send_mouse_wheel(source, &mouseEvent, xDelta,
|
||||||
|
@ -65,13 +65,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
qintptr *result) override;
|
qintptr *result) override;
|
||||||
#else
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
|
||||||
long *result) override;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::function<bool(QObject *, QEvent *)> EventFilterFunc;
|
typedef std::function<bool(QObject *, QEvent *)> EventFilterFunc;
|
||||||
|
@ -271,11 +271,7 @@ void setupDockAction(QDockWidget *dock)
|
|||||||
dock->connect(action, &QAction::triggered, newToggleView);
|
dock->connect(action, &QAction::triggered, newToggleView);
|
||||||
|
|
||||||
// Make the action unable to be disabled
|
// 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);
|
action->connect(action, &QAction::enabledChanged, neverDisable);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void RegisterTwitchAuth();
|
extern void RegisterTwitchAuth();
|
||||||
@ -287,11 +283,6 @@ extern void RegisterYoutubeAuth();
|
|||||||
OBSBasic::OBSBasic(QWidget *parent)
|
OBSBasic::OBSBasic(QWidget *parent)
|
||||||
: OBSMainWindow(parent), undo_s(ui), ui(new Ui::OBSBasic)
|
: OBSMainWindow(parent), undo_s(ui), ui(new Ui::OBSBasic)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
qRegisterMetaTypeStreamOperators<SignalContainer<OBSScene>>(
|
|
||||||
"SignalContainer<OBSScene>");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
setAttribute(Qt::WA_NativeWindow);
|
setAttribute(Qt::WA_NativeWindow);
|
||||||
|
|
||||||
#ifdef TWITCH_ENABLED
|
#ifdef TWITCH_ENABLED
|
||||||
@ -340,13 +331,6 @@ OBSBasic::OBSBasic(QWidget *parent)
|
|||||||
qRegisterMetaType<obs_hotkey_id>("obs_hotkey_id");
|
qRegisterMetaType<obs_hotkey_id>("obs_hotkey_id");
|
||||||
qRegisterMetaType<SavedProjectorInfo *>("SavedProjectorInfo *");
|
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<OBSSource>("OBSSource");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
|
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
ui->sources->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
|
/* hack to prevent elgato from loading its own QtNetwork that it tries
|
||||||
* to ship with */
|
* to ship with */
|
||||||
#if defined(_WIN32) && !defined(_DEBUG)
|
#if defined(_WIN32) && !defined(_DEBUG)
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
LoadLibraryW(L"Qt5Network");
|
|
||||||
#else
|
|
||||||
LoadLibraryW(L"Qt6Network");
|
LoadLibraryW(L"Qt6Network");
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
struct obs_module_failure_info mfi;
|
struct obs_module_failure_info mfi;
|
||||||
|
|
||||||
@ -5094,11 +5074,7 @@ void OBSBasic::closeEvent(QCloseEvent *event)
|
|||||||
QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(App(), "quit", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
bool OBSBasic::nativeEvent(const QByteArray &, void *message, qintptr *)
|
bool OBSBasic::nativeEvent(const QByteArray &, void *message, qintptr *)
|
||||||
#else
|
|
||||||
bool OBSBasic::nativeEvent(const QByteArray &, void *message, long *)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const MSG &msg = *static_cast<MSG *>(message);
|
const MSG &msg = *static_cast<MSG *>(message);
|
||||||
|
@ -1020,13 +1020,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
qintptr *result) override;
|
qintptr *result) override;
|
||||||
#else
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
|
||||||
long *result) override;
|
|
||||||
#endif
|
|
||||||
virtual void changeEvent(QEvent *event) override;
|
virtual void changeEvent(QEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -573,11 +573,7 @@ void OBSBasicPreview::wheelEvent(QWheelEvent *event)
|
|||||||
|
|
||||||
void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QPointF pos = event->position();
|
QPointF pos = event->position();
|
||||||
#else
|
|
||||||
QPointF pos = event->localPos();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (scrollMode && IsFixedScaling() &&
|
if (scrollMode && IsFixedScaling() &&
|
||||||
event->button() == Qt::LeftButton) {
|
event->button() == Qt::LeftButton) {
|
||||||
@ -1595,11 +1591,7 @@ void OBSBasicPreview::mouseMoveEvent(QMouseEvent *event)
|
|||||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
QPointF qtPos = event->position();
|
QPointF qtPos = event->position();
|
||||||
#else
|
|
||||||
QPointF qtPos = event->localPos();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float pixelRatio = main->GetDevicePixelRatio();
|
float pixelRatio = main->GetDevicePixelRatio();
|
||||||
|
|
||||||
|
@ -490,12 +490,8 @@ void OBSBasicProperties::closeEvent(QCloseEvent *event)
|
|||||||
Cleanup();
|
Cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message,
|
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message,
|
||||||
qintptr *)
|
qintptr *)
|
||||||
#else
|
|
||||||
bool OBSBasicProperties::nativeEvent(const QByteArray &, void *message, long *)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const MSG &msg = *static_cast<MSG *>(message);
|
const MSG &msg = *static_cast<MSG *>(message);
|
||||||
|
@ -74,12 +74,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
qintptr *result) override;
|
qintptr *result) override;
|
||||||
#else
|
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
|
||||||
long *result) override;
|
|
||||||
#endif
|
|
||||||
virtual void reject() override;
|
virtual void reject() override;
|
||||||
};
|
};
|
||||||
|
@ -974,7 +974,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||||||
connect(ui->advOutRecFormat, SIGNAL(currentIndexChanged(int)), this,
|
connect(ui->advOutRecFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||||
SLOT(AdvOutRecCheckCodecs()));
|
SLOT(AdvOutRecCheckCodecs()));
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
|
||||||
// Set placeholder used when selection was reset due to incompatibilities
|
// Set placeholder used when selection was reset due to incompatibilities
|
||||||
ui->advOutRecEncoder->setPlaceholderText(
|
ui->advOutRecEncoder->setPlaceholderText(
|
||||||
QTStr("CodecCompat.CodecPlaceholder"));
|
QTStr("CodecCompat.CodecPlaceholder"));
|
||||||
@ -986,7 +985,6 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||||||
QTStr("CodecCompat.CodecPlaceholder"));
|
QTStr("CodecCompat.CodecPlaceholder"));
|
||||||
ui->simpleOutRecFormat->setPlaceholderText(
|
ui->simpleOutRecFormat->setPlaceholderText(
|
||||||
QTStr("CodecCompat.ContainerPlaceholder"));
|
QTStr("CodecCompat.ContainerPlaceholder"));
|
||||||
#endif
|
|
||||||
|
|
||||||
SimpleRecordingQualityChanged();
|
SimpleRecordingQualityChanged();
|
||||||
AdvOutSplitFileChanged();
|
AdvOutSplitFileChanged();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user