Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QStackedLayout in StackAll mode breaks widget tab ordering
Forum Updated to NodeBB v4.3 + New Features

QStackedLayout in StackAll mode breaks widget tab ordering

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 477 Views 1 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.
  • T Offline
    T Offline
    Terry Barnaby
    wrote on last edited by
    #1

    I am using Qt 5.15.2 under Fedora 35. I am using QStackedLayout to show a set of application "pages" with the stackingMode set to StackAll. I have to use StackAll as one of the Stacked widgets is using a Video physical Wayland surface and the normal StackOne causes problems as this surface gets deleted/re-created when switching between the stacked widgets.
    Generally this is working, but the Widget tabbing order within the stacked widgets gets messed up when I use StackAll rather than StackOne. With the StackAll setting when I TAB through the widgets on the selected "page" widget the focus no longer circles around this widget's focus children, it goes off to somewhere else after the last widget.
    Any ideas on what is happening and how to fix this ?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Terry Barnaby
      wrote on last edited by
      #2

      Some feedback.
      Looking through the Qt source code it looks like the QT TAB focus navigation system is pretty crude in QT 5.15.2 and uses QWidget visibility status to work out if the next widget in the TAB sequence should loop back to the first in a parent widget.
      If you use a QStackedLayout in StackAll mode QWidgets are raised and lowered not shown and hidden (no visibility change) and so the TAB sequence continues through other widgets which are lowered after the raised one in the QWidgets "shown" in the QStackedLayout.
      So basically the QT TAB system does not work properly if you use a QStackedLayout in StackAll mode. It looks like I may be able to override focusNextPrevChild() on my top level QWidgets under the QStackedLayout and get that function to move the focus to first widget in its own list of widgets when TABing beyond the last widget (and handle the previous TAB sequence as well). Might also be able to use some pseudo QWidgets at the start/end of my top level QWidgets children and use the Proxy Focus system somehow.
      A bit ugly but it should work for those that need to use a QStackedLayout in StackAll mode.

      1 Reply Last reply
      1

      • Login

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