Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2305

QMainWindow.setGeometry not work in Linux

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.5.0
    • PySide
    • None
    • Linux/Wayland

      I created a Qmainwindow and set it's geometery using setGeometery(x, y, width, height).

       

      width and height parameter works well but x and y. I tried to show the window in my screen center, but the x and y patameter DID NOT work in setGeometery function. 

       

      I also tried "move(x, y)", but this function did not work, too.

       

      my code is here:

      # PySide6.__version__
      # '6.5.0'
      
      # Ubuntu 22.04 Wayland
      # Gnome 42.5
      
      import sys
      from PySide6.QtWidgets import QApplication, QMainWindow
      
      if __name__ == "__main__":
          app = QApplication(sys.argv)
          win = QMainWindow()
          win.setGeometry(1902,123,421,123)
          win.show()
          win.move(999,6666)
          sys.exit(app.exec_())

       

      I also tried to drag the window with mouse, and connect the move signal to a function to show geometery. However, the x and y value dose not change even I drange the window to other location. the values are (0,0) forever. This bug does not exist in PyQt5 but PySide6. 

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            masterchief Mo Q
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes