mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Qt6: deal with changes to window and layout geometry APIs
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e29ecf2c9a
commit
e61509b032
3 changed files with 15 additions and 1 deletions
|
@ -20,7 +20,9 @@
|
|||
#include <QItemSelectionModel>
|
||||
#include <qmessagebox.h>
|
||||
#include <cstdlib>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QDesktopWidget>
|
||||
#endif
|
||||
#include <QFileDialog>
|
||||
#include <QScrollBar>
|
||||
|
||||
|
@ -587,7 +589,11 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
|
|||
|
||||
void DiveLocationLineEdit::fixPopupPosition()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
const QRect screen = this->screen()->availableGeometry();
|
||||
#else
|
||||
const QRect screen = QApplication::desktop()->availableGeometry(this);
|
||||
#endif
|
||||
const int maxVisibleItems = 5;
|
||||
QPoint pos;
|
||||
int rh, w;
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
#include <QDesktopWidget>
|
||||
#endif
|
||||
#include <QSettings>
|
||||
#include <QShortcut>
|
||||
#include <QStatusBar>
|
||||
|
@ -807,9 +809,13 @@ void MainWindow::restoreSplitterSizes()
|
|||
topSplitter->restoreState(settings.value("topSplitter").toByteArray());
|
||||
bottomSplitter->restoreState(settings.value("bottomSplitter").toByteArray());
|
||||
} else {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
const int appH = qApp->desktop()->size().height();
|
||||
const int appW = qApp->desktop()->size().width();
|
||||
|
||||
#else
|
||||
const int appH = screen()->size().height();
|
||||
const int appW = screen()->size().width();
|
||||
#endif
|
||||
ui.mainSplitter->setSizes({ appH * 3 / 5, appH * 2 / 5 });
|
||||
topSplitter->setSizes({ appW / 2, appW / 2 });
|
||||
bottomSplitter->setSizes({ appW * 3 / 5, appW * 2 / 5 });
|
||||
|
|
|
@ -81,7 +81,9 @@ ProfileWidget::ProfileWidget()
|
|||
|
||||
QHBoxLayout *layout = new QHBoxLayout(this);
|
||||
layout->setSpacing(0);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
layout->setMargin(0);
|
||||
#endif
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->addWidget(toolBar);
|
||||
layout->addWidget(stack);
|
||||
|
|
Loading…
Add table
Reference in a new issue