Commit aa7fc379 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix some compile error when building against qt6

parent 28724687
Pipeline #174479 passed with stage
in 2 minutes and 41 seconds
......@@ -57,6 +57,7 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Core Widget
find_package(Qt${QT_MAJOR_VERSION}DBus ${QT_MIN_VERSION} CONFIG QUIET)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6SvgWidgets)
find_package(Qt6OpenGLWidgets)
endif()
set(HAVE_QTDBUS ${Qt${QT_MAJOR_VERSION}DBus_FOUND})
......
......@@ -252,6 +252,9 @@ target_link_libraries(gwenviewlib
${LCMS2_LIBRARIES}
Phonon::phonon4qt${QT_MAJOR_VERSION}
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(gwenviewlib Qt6::OpenGLWidgets)
endif()
if(HAVE_QTDBUS)
target_link_libraries(gwenviewlib Qt::DBus)
......@@ -273,7 +276,7 @@ if (HAVE_X11)
if (QT_MAJOR_VERSION STREQUAL "5")
target_link_libraries(gwenviewlib Qt5::X11Extras)
else()
MESSAGE(STATUS "need to replace Qt5::X11Extras in qt6")
target_link_libraries(gwenviewlib Qt6::GuiPrivate) # Gui/private/qtx11extras_p.h
endif()
endif()
......
......@@ -51,6 +51,8 @@ extern "C" {
#include <fixx11h.h>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtX11Extras/QX11Info>
#else
#include <private/qtx11extras_p.h>
#endif
#endif
......
......@@ -35,8 +35,11 @@ class DisabledActionShortcutMonitorPrivate
public:
QShortcut *mShortcut = nullptr;
};
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
DisabledActionShortcutMonitor::DisabledActionShortcutMonitor(QAction *action, QWidget *parent)
#else
DisabledActionShortcutMonitor::DisabledActionShortcutMonitor(QAction *action, QObject *parent)
#endif
: QObject(parent)
, d(new DisabledActionShortcutMonitorPrivate)
{
......
......@@ -44,7 +44,11 @@ public:
/**
* parent must be a widget because we need to create a QShortcut
*/
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
DisabledActionShortcutMonitor(QAction *action, QWidget *parent);
#else
DisabledActionShortcutMonitor(QAction *action, QObject *parent);
#endif
~DisabledActionShortcutMonitor() override;
Q_SIGNALS:
......
......@@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <QAction>
#include <QApplication>
#include <QBitmap>
#include <QDesktopWidget>
#include <QEvent>
#include <QLayout>
#include <QMouseEvent>
......
......@@ -50,8 +50,13 @@ LockScreenWatcher::LockScreenWatcher(QObject *parent)
connect(watcher, &DBusBoolReplyWatcher::finished, this, &LockScreenWatcher::onServiceRegisteredQueried);
connect(watcher, &DBusBoolReplyWatcher::canceled, watcher, &DBusBoolReplyWatcher::deleteLater);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
watcher->setFuture(
QtConcurrent::run(QDBusConnection::sessionBus().interface(), &QDBusConnectionInterface::isServiceRegistered, screenSaverServiceName()));
#else
watcher->setFuture(
QtConcurrent::run(&QDBusConnectionInterface::isServiceRegistered, QDBusConnection::sessionBus().interface(), screenSaverServiceName()));
#endif
}
}
......@@ -101,8 +106,13 @@ void LockScreenWatcher::onServiceRegisteredQueried()
auto ownerWatcher = new DBusStringReplyWatcher(this);
connect(ownerWatcher, &DBusStringReplyWatcher::finished, this, &LockScreenWatcher::onServiceOwnerQueried);
connect(ownerWatcher, &DBusStringReplyWatcher::canceled, ownerWatcher, &DBusStringReplyWatcher::deleteLater);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
ownerWatcher->setFuture(
QtConcurrent::run(QDBusConnection::sessionBus().interface(), &QDBusConnectionInterface::serviceOwner, screenSaverServiceName()));
#else
ownerWatcher->setFuture(
QtConcurrent::run(&QDBusConnectionInterface::serviceOwner, QDBusConnection::sessionBus().interface(), screenSaverServiceName()));
#endif
}
watcher->deleteLater();
......
......@@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// Qt
#include <QAction>
#include <QActionGroup>
#include <QHBoxLayout>
#include <QSlider>
#include <QToolButton>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment