Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6 QMainWindow move() not working on Ubuntu 22.04
Forum Updated to NodeBB v4.3 + New Features

PySide6 QMainWindow move() not working on Ubuntu 22.04

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 3 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Erriez
    wrote on 8 Jan 2023, 17:58 last edited by Erriez 1 Aug 2023, 18:13
    #1

    The following example with PySide6 6.1.4 installed with PIP does not move the window to a fixed screen location on Ubuntu 22.04, but works on Windows 10:

    # Example does not move window on Ubuntu 22.04
    from PySide6.QtWidgets import QApplication, QMainWindow
    import sys
    
    app = QApplication(sys.argv)
    mainwindow = QMainWindow()
    mainwindow.show()
    
    # Move not working on Ubuntu 22.04, works on Windows 10:
    mainwindow.move(1000, 800)
    
    app.exec()
    

    What could be the reason for a difference between Windows and Linux?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      friedemannkleint
      wrote on 9 Jan 2023, 09:48 last edited by
      #2

      The code works fine on Ubuntu 22.04/KDE / X11. Are you using Wayland?

      E 1 Reply Last reply 9 Jan 2023, 17:13
      0
      • F friedemannkleint
        9 Jan 2023, 09:48

        The code works fine on Ubuntu 22.04/KDE / X11. Are you using Wayland?

        E Offline
        E Offline
        Erriez
        wrote on 9 Jan 2023, 17:13 last edited by
        #3

        @friedemannkleint Thanks for your answer. Yes, I'm using:

        • Ubuntu 22.04.1 LTS 64-bit (Running in VirtualBox)
        • All updates installed.
        • GNOME Version 42.5.
        • Windowing System: Wayland.

        The window opens in the upper left corner and not at position x=1000, y=800.

        Do you have a suggestion how to analyze this?

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Erriez
          wrote on 10 Jan 2023, 21:05 last edited by
          #4

          Reproducible with PySide2 on Ubuntu 22.04.1. Any suggestions?

          J 1 Reply Last reply 10 Jan 2023, 21:19
          0
          • E Erriez
            10 Jan 2023, 21:05

            Reproducible with PySide2 on Ubuntu 22.04.1. Any suggestions?

            J Offline
            J Offline
            JonB
            wrote on 10 Jan 2023, 21:19 last edited by
            #5

            @Erriez Are you able to verify that is does work if you use Xorg?

            E 1 Reply Last reply 11 Jan 2023, 18:49
            0
            • J JonB
              10 Jan 2023, 21:19

              @Erriez Are you able to verify that is does work if you use Xorg?

              E Offline
              E Offline
              Erriez
              wrote on 11 Jan 2023, 18:49 last edited by Erriez 1 Nov 2023, 18:58
              #6

              @JonB I confirm the following with the test example in the first comment:

              • Ubuntu on Wayland: Does not work
              • Ubuntu X11: Works
              • LXDE: Works
              • Openbox: Works
              • MATE 22.10: Works
              • Xfce: Works
              • XUbuntu: Works
              • Windows 10: Works

              Ubuntu Wayland is our default development platform and commonly used by our customers. Is there some special configuration needed for Wayland?

              Jira bug report: PYSIDE-2190

              E 1 Reply Last reply 11 Jan 2023, 21:26
              1
              • E Erriez
                11 Jan 2023, 18:49

                @JonB I confirm the following with the test example in the first comment:

                • Ubuntu on Wayland: Does not work
                • Ubuntu X11: Works
                • LXDE: Works
                • Openbox: Works
                • MATE 22.10: Works
                • Xfce: Works
                • XUbuntu: Works
                • Windows 10: Works

                Ubuntu Wayland is our default development platform and commonly used by our customers. Is there some special configuration needed for Wayland?

                Jira bug report: PYSIDE-2190

                E Offline
                E Offline
                Erriez
                wrote on 11 Jan 2023, 21:26 last edited by Erriez
                #7

                @Erriez An unexpected answer in PYSIDE-2190:

                This is a platform-specific issue of the underlying Qt library unrelated to the Python bindings for Qt which this project tracks. Please contact Qt support or report it under the QTBUG project along with a minimal C++ example ( see https://wiki.qt.io/Reporting_Bugs ).

                The related issue QTBUG-86780 states that this is apparently not possible.

                See my comment in PYSIDE-2190 which demonstrates a TKinter application which can move a window with a few lines of code on all platforms, including Ubuntu Wayland.

                Conclusion:

                • Moving the application window is not supported in Qt / PySide 6.4.1.
                • Known issue QTBUG-86780, but still not documented in qtforpython-6.
                • Confirmed in QTBUG-110119.

                The reason why the quality of the Qt documentation is below our expectation is that the Qt developers confirmed this issue on Wayland and are ignoring the request to update the documentation.

                1 Reply Last reply
                0

                1/7

                8 Jan 2023, 17:58

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved