Qt World Summit: Submit your Presentation

QT Rectangle Wrap Around

  • I'm working on a fullscreen project and I'd have two questions :

    1. Is it possible to display my window in fullscreen on a multi-screen setup?

    2. I need to make a rectangle wrap around my window, I mean that if it goes beyond the right edge, the exceeding part would be displayed on the left edge of my window, do you know how I could do that ?

  • @Calvin-Richerd

    1. On OS I'm familiar with, the OS's notion of "fullscreen" means "full screen" and not "full desktop". However you can fudge a multi-window full-desktop window by digging into desktop geometry via http://doc.qt.io/qt-5/qdesktopwidget.html and creating a sufficiently large borderless window. Not sure how things work these days but it used to be that even if the screens had their own GPUs, all of an application's rendering would be done by one screen's GPU, and then that would be copied to the other screens. If performance is important it maybe better to create a multi-window application with a window on each screen.

    2. Couple of ways of doing this:
      a. Render the window to some offscreen framebuffer, then do 2 copies of the rectangles on either side of the wrap line to the appropriate parts of the actual screen. ie if your framebuffer contains [ABCDEF] but it's rotated 2 characters then you'd copy [CDEF] to the left of the screen and [AB] to the right to get [CDEFAB].
      b. Create an application which actually has content [ABCDEFABCDEF] and then just display the right subregion so it looks like its wrapped if you display [CDEFAB]. If the user goes off one end or the other just completely jump to the other end.

    Not sure how applicable these ideas are to QML apps though. You can do quite a bit of messing with rendering using ShaderEffect, but that doesn't help route mouse events to the right place in a displaced "underlying" layout.