mapToGlobal, wrong values with Linux
Unsolved
Qt 6
-
So I created a simple stupid program that creates a main window and prints out the mapToGlobal values, the MainWindow snipit:
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_testPushButton_clicked() { qDebug() << "MainWindow mapToGlobal" << this->mapToGlobal(QPoint(0,0)); }
On Windows and macOS this works perfectly. On a fresh install of Ubuntu 22.04 I move the window around the screen and get values like:
14:48:08: Debugging /home/user/projects/test/build/test ... MainWindow mapToGlobal QPoint(12,120) MainWindow mapToGlobal QPoint(180,1800) MainWindow mapToGlobal QPoint(552,5520) MainWindow mapToGlobal QPoint(654,6540) MainWindow mapToGlobal QPoint(831,8310) MainWindow mapToGlobal QPoint(900,9000) MainWindow mapToGlobal QPoint(1002,10020)
Just so you know, the display resolution is 2048x1280.
Has anyone else experienced this ?
-
-
Right, I'd like to see what
pos()
shows in those cases when themapToGlobal()
is showing those crazy y values. His single example above shows reasonable values for bothmapToGlobal()
andpos()
(depending on where the window actual is, I guess). -
-
@Asperamanca said in mapToGlobal, wrong values with Linux:
Yup that looks like it.