Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105560

mapToGlobal, wrong values with Linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 6.3.1
    • Widgets: Main Window
    • None
    • Ubuntu 22.04.1 LTS
    • Linux/Wayland

    Description

      Trying to map the global point for the MainWindow, the values are good on Windows and macOS but are bad on Linux

      Example code:
       

      #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));
      }
      

      and I get this when the window is moved around on a 2048x1280 display

      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)
      

      Attachments

        1. test_project.zip
          2.75 MB
        2. sysinfo.png
          sysinfo.png
          13 kB

        Activity

          People

            inho Inho Lee
            gmat Alan Krzywicki
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: