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. Tab order does not work in Qt

Tab order does not work in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 427 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
    Ekta
    wrote on last edited by
    #1

    Hello Qt experts
    I really need a help on below issue in Qt.

    I have a class say, MainWidget which has HeadWidget and TabWidget.

    In Qt designer, the component is headWidget of type HeadWidget. The tab order here works fine. It should go from all the components in the HeadWidget (it is set using setTabOrder) to TabWidget.

    I wanted to add qml HeadWidget when a Boolean is true so I did following changes. (If bool is true => show new Qml HeadView else show default Qt View)

    1. In designer, changed headWidget is type QWidget.
    2. Instantiated in the constructor as follows
    const auto layout = new QVBoxLayout(mUi->headWidget);
        mUi->headWidget->setLayout(layout);
    
       if (showQtView)
        {        
                mHeadView = new HeadView(this);
                layout->addWidget(mHeadView);
        }
    else 
    { 
    	showQmlView()
    }
    

    Now, tab order is not working as expected. After the last element in the HeadWidget, it does not go to TabView in the MainWidget.

    I tried explicitly setTabOrder => does not work
    setFocusProxy does not work
    and it has setFocusPolicy also set.

    Could someone guide me a way to fix this issue

    Christian EhrlicherC 1 Reply Last reply
    0
    • E Ekta

      Hello Qt experts
      I really need a help on below issue in Qt.

      I have a class say, MainWidget which has HeadWidget and TabWidget.

      In Qt designer, the component is headWidget of type HeadWidget. The tab order here works fine. It should go from all the components in the HeadWidget (it is set using setTabOrder) to TabWidget.

      I wanted to add qml HeadWidget when a Boolean is true so I did following changes. (If bool is true => show new Qml HeadView else show default Qt View)

      1. In designer, changed headWidget is type QWidget.
      2. Instantiated in the constructor as follows
      const auto layout = new QVBoxLayout(mUi->headWidget);
          mUi->headWidget->setLayout(layout);
      
         if (showQtView)
          {        
                  mHeadView = new HeadView(this);
                  layout->addWidget(mHeadView);
          }
      else 
      { 
      	showQmlView()
      }
      

      Now, tab order is not working as expected. After the last element in the HeadWidget, it does not go to TabView in the MainWidget.

      I tried explicitly setTabOrder => does not work
      setFocusProxy does not work
      and it has setFocusPolicy also set.

      Could someone guide me a way to fix this issue

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Please provide a minimal, compilable example of your problem. No designer stuff needed to reproduce this issue.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • JKSHJ JKSH moved this topic from Qt for MCUs

      • Login

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