mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-24 23:15:41 -04:00
Removed deprecated QDesktopWidget for Qt 6
This commit is contained in:
parent
f53a30a0e4
commit
f321ffe8fd
12 changed files with 44 additions and 17 deletions
|
@ -31,9 +31,9 @@
|
|||
#include "util/QtVersion.h"
|
||||
#include "util/DateTime.h"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QMenu>
|
||||
#include <QToolButton>
|
||||
#include <QScreen>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -192,8 +192,11 @@ void GroupTreeWidget::addToolButton(QToolButton *toolButton)
|
|||
|
||||
/* Initialize button */
|
||||
int i = qt_defaultDpi();
|
||||
auto desktopWidget = QApplication::desktop();
|
||||
auto y = desktopWidget->logicalDpiY();
|
||||
QScreen *primaryScreen = QGuiApplication::primaryScreen();
|
||||
int y = i;
|
||||
if (primaryScreen) {
|
||||
y = primaryScreen->logicalDotsPerInchY();
|
||||
}
|
||||
|
||||
toolButton->setAutoRaise(true);
|
||||
toolButton->setIconSize(QSize(24*y/i,24*y/i));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue