Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Qt Windows Extra for Qt 6 and later #5654

Merged
merged 1 commit into from
Dec 17, 2021
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
9 changes: 6 additions & 3 deletions UI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ find_package(Threads REQUIRED)
find_package(Qt5Network ${FIND_MODE})
find_package(Qt5Widgets ${FIND_MODE})
find_package(Qt5Svg ${FIND_MODE})
if(WIN32)
if(WIN32 AND (Qt5Widgets_VERSION VERSION_LESS 6.0.0))
find_package(Qt5WinExtras ${FIND_MODE})
endif()
find_package(Qt5Xml ${FIND_MODE})
Expand Down Expand Up @@ -452,8 +452,11 @@ if(WIN32)
set_target_properties(obs
PROPERTIES
OUTPUT_NAME "obs${_output_suffix}")
target_link_libraries(obs
Qt5::WinExtras)

if(Qt5Widgets_VERSION VERSION_LESS 6.0.0)
target_link_libraries(obs
Qt5::WinExtras)
endif()
endif()

target_link_libraries(obs
Expand Down
14 changes: 7 additions & 7 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ void OBSBasic::OBSInit()
SystemTray(true);
#endif

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setWindow(windowHandle());
#endif

Expand Down Expand Up @@ -6650,7 +6650,7 @@ inline void OBSBasic::OnActivate(bool force)
App()->IncrementSleepInhibition();
UpdateProcessPriority();

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-active", QIcon(":/res/images/active.png")));
#endif
Expand Down Expand Up @@ -6681,7 +6681,7 @@ inline void OBSBasic::OnDeactivate()
App()->DecrementSleepInhibition();
ClearProcessPriority();

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->clearOverlayIcon();
#endif
if (trayIcon && trayIcon->isVisible()) {
Expand All @@ -6708,7 +6708,7 @@ inline void OBSBasic::OnDeactivate()
#endif
trayIcon->setIcon(QIcon::fromTheme("obs-tray-paused",
trayIconFile));
#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-paused",
QIcon(":/res/images/paused.png")));
Expand All @@ -6724,7 +6724,7 @@ inline void OBSBasic::OnDeactivate()
#endif
trayIcon->setIcon(QIcon::fromTheme("obs-tray-active",
trayIconFile));
#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-active",
QIcon(":/res/images/active.png")));
Expand Down Expand Up @@ -9697,7 +9697,7 @@ void OBSBasic::PauseRecording()

ui->statusbar->RecordingPaused();

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-paused", QIcon(":/res/images/paused.png")));
#endif
Expand Down Expand Up @@ -9741,7 +9741,7 @@ void OBSBasic::UnpauseRecording()

ui->statusbar->RecordingUnpaused();

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-active", QIcon(":/res/images/active.png")));
#endif
Expand Down
4 changes: 2 additions & 2 deletions UI/window-basic-main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <QThread>
#include <QWidgetAction>
#include <QSystemTrayIcon>
#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QWinTaskbarButton>
#endif
#include <QStyledItemDelegate>
Expand Down Expand Up @@ -317,7 +317,7 @@ class OBSBasic : public OBSMainWindow {
QPointer<QAction> renameScene;
QPointer<QAction> renameSource;

#ifdef _WIN32
#if defined(_WIN32) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWinTaskbarButton *taskBtn = new QWinTaskbarButton(this);
#endif

Expand Down