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. Lags on window resize with PySide6 and QML (linux)

Lags on window resize with PySide6 and QML (linux)

Scheduled Pinned Locked Moved Unsolved Qt for Python
pysideqt for python
1 Posts 1 Posters 777 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.
  • J Offline
    J Offline
    jiku
    wrote on last edited by
    #1

    Hi, I really want to use QML together with python, but for some reason I can't get window resizing to work properly. Every time a window is resized the content lags behind a bit and after un-maximizing the window the whole geometry seems to get stuck in that maximized state until the window is resized manually. In applications based on widgets this does not happen.

    I use KDE wayland, but have tried to replicate this with: the application running on xwayland, KDE X11 and gnome (both with the application running on xwayland and natively again). In every case the issue was not as bad as on KDE with wayland, but it still persisted – instead of the content exiting the main window there is a black frame.

    Any idea how to fix this?

    I'm running python 3.10.4 in a miniconda environment with PySide version 6.3.1. My os is a rather fresh installation of archlinux with, as mentioned, KDE as my desktop environment. Haven't tried this on any other os or linux distribution.

    The program I wrote is pretty basic.

    main.py

    import sys
    
    from PySide6.QtCore import Qt
    from PySide6.QtQml import QQmlApplicationEngine
    from PySide6.QtWidgets import QApplication
    
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
    
        engine = QQmlApplicationEngine()
        engine.quit.connect(app.quit)
        engine.load("main.qml")
    
        sys.exit(app.exec())
    

    main.qml

    import QtQuick
    import QtQuick.Controls
    
    ApplicationWindow {
        id: root
    
        visible: true
        minimumWidth: 600
        minimumHeight: 400
        color: "#363642"
    
        Item {
            anchors.fill: parent
    
            Rectangle {
                x: 0
                y: 0
                width: parent.width
                height: 90
    
                color: "#2a2a35"
            }
    
            Rectangle {
                x: 0
                y: 72
                width: parent.width
                height: 36
                radius: 18
    
                color: "#363642"
            }
        }
    }
    
    1 Reply Last reply
    0

    • Login

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