mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
QDesktopWidget is not required in Qt5, the Qt6 code works
This commit is contained in:
parent
9156843ec2
commit
e2e1fd6ea9
@ -89,9 +89,6 @@
|
||||
#include <QByteArray>
|
||||
#include <QBitmap>
|
||||
#include <QDateTime>
|
||||
#if QT_VERSION < 0x060000
|
||||
#include <QDesktopWidget>
|
||||
#endif
|
||||
#include <QEvent>
|
||||
#include <QFileOpenEvent>
|
||||
#include <QFileInfo>
|
||||
@ -2638,11 +2635,7 @@ void GuiApplication::createView(QString const & geometry_arg, bool autoShow,
|
||||
// Negative displacements must be interpreted as distances
|
||||
// from the right or bottom screen borders.
|
||||
if (sx == '-' || sy == '-') {
|
||||
#if QT_VERSION < 0x060000
|
||||
QRect rec = QApplication::desktop()->screenGeometry();
|
||||
#else
|
||||
QRect rec = QGuiApplication::primaryScreen()->geometry();
|
||||
#endif
|
||||
if (sx == '-')
|
||||
x += rec.width() - w - framewidth;
|
||||
if (sy == '-')
|
||||
|
@ -19,17 +19,13 @@
|
||||
#include <QToolTip>
|
||||
#include <QToolBar>
|
||||
#include <QApplication>
|
||||
#if QT_VERSION < 0x060000
|
||||
#include <QDesktopWidget>
|
||||
#endif
|
||||
#include <QPainter>
|
||||
#include <QScreen>
|
||||
#include <QStyle>
|
||||
#include <QStyleOptionFrame>
|
||||
#include <QMouseEvent>
|
||||
#include <QVBoxLayout>
|
||||
#if QT_VERSION >= 0x060000
|
||||
#include <QWindow>
|
||||
#endif
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
@ -181,11 +177,7 @@ void IconPalette::showEvent(QShowEvent * /*event*/)
|
||||
voffset -= parheight;
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x060000
|
||||
QRect const screen = qApp->desktop()->availableGeometry(this);
|
||||
#else
|
||||
QRect const screen = window()->windowHandle()->screen()->availableGeometry();
|
||||
#endif
|
||||
QPoint const gpos = parentWidget()->mapToGlobal(
|
||||
parentWidget()->geometry().bottomLeft());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user