Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Window contents flicker when resizing
Qt 6.11 is out! See what's new in the release blog

Window contents flicker when resizing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 2.1k Views 2 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I've made a custom border for my Qt Quick application which moves and resizes the window based on the mouse position.
    The problem I have with it is that the contents of the window jump around a few frames late as I resize it.

    0_1559579967512_window-resize-gif.gif

    Using WA_TranslucentBackground, X11BypassWindowManagerHint or BypassWindowManagerHint as a flag fixes this problem, but causes more problems by making the window sometimes disappear completely (especially when moving it to the right side of the screen for some reason): 0_1559581229708_window-resize2-gif.gif I tried some other flags that were suggested which didn't help.

    I'm changing the window size by making a QObject pointer QObject *mainWindow = engine.rootObjects().first(); and setting the positions, width, and height individually with window->setProperty("width", width); . I'm not sure if that's part of the problem.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      Found the proper way to resize the window. I had to use QWindow *mainWindow = app.topLevelWindows().first(); to get the window and then I just used the QWindow functions to do the job.
      It works way faster now with a bit less graphical issues.
      0_1559726379099_window-resize3-gif.gif
      Looks like this now. I changed it so there's only one resize call for every position change event. It resizes smoothly but the contents of the window still jump around a bit. I also added qApp->processEvents(); which seems to help a little bit.

      1 Reply Last reply
      2

      • Login

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