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

Fix against qt6

parent a94386c7
......@@ -11,7 +11,7 @@
#include <QAction>
#include <QApplication>
#include <QBrush>
#include <QDesktopWidget>
#include <QScreen>
#include <QInputDialog>
#include <QMenu>
#include <QMouseEvent>
......@@ -35,7 +35,11 @@
#include "krulerconfig.h"
#ifdef KRULER_HAVE_X11
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QX11Info>
#else
#include <private/qtx11extras_p.h>
#endif
#include <netwm.h>
#endif
......@@ -294,7 +298,7 @@ void KLineal::setHorizontal( bool horizontal )
QPoint newTopLeft = QPoint( center.x() - height() / 2, center.y() - width() / 2 );
r.moveTo(newTopLeft);
QRect desktop = QApplication::desktop()->screenGeometry( this );
QRect desktop = QGuiApplication::primaryScreen()->geometry();
if ( r.width() > desktop.width() ) {
r.setWidth( desktop.width() );
......
......@@ -18,12 +18,16 @@
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication app( argc, argv );
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator migrate(QStringLiteral("kruler"));
migrate.setConfigFiles(QStringList() << QStringLiteral("krulerrc") << QStringLiteral("kruler.notifyrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("krulerui.rc"));
migrate.migrate();
#endif
KAboutData aboutData( QStringLiteral("kruler"), i18n( "KDE Screen Ruler" ),
QStringLiteral(KRULER_VERSION_STRING),
......
Markdown is supported
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