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. Focus issue in Multiple Widget in Layout.
Forum Updated to NodeBB v4.3 + New Features

Focus issue in Multiple Widget in Layout.

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 858 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.
  • S Offline
    S Offline
    Sebastian
    wrote on last edited by
    #1

    Dear Friends,
    I am having QWidget(A) which holds another Qwidget(B) .Now QWidget(B) holds another ModuleMessageBox that have 3 buttons yes,No And Cancel. My aim is only that focus should be always on cyclcic between yes no and cancel. Currently I have implemented like in the parent widget event filter i check for the focus out event and there i set for ModuleMessagebox . And in the parent constructor(A) i set the setfocuspolicy(Qt::StrongFocus)

    if(o == parent(A) && e->type() == QEvent::FocusOut)
        {
            if(ModuleMessagebox)
            ModuleMessagebox->setFocus(Qt::TabFocusReason);
        }
    

    Now I am facing the problem like on the key tab if i am changing the focus .is is going on yes then No and then Cancel.After that I have to press 2 times more for getting again the focus on yes button.I want it should be cyclic.
    I have tried a lot of things but not successful.

    Any hints will be appreciated.
    TIA

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you using a QDialogButtonBox ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sebastian
        wrote on last edited by Sebastian
        #3

        @SGaist : Hi,
        yes it is QDialogButtonBox and we have Standard button as enum(Yes ,No,cancel). My one Problem is solved that cyclic one.Now I have only one problem that the when we start the ModuleMessageBox the focus should always be on Yes button.currently i am trying to do that i know its very simple thing but some how its not working.When i press the tab key then only focus comes on Yes button.
        Please advise

        1 Reply Last reply
        0
        • S Offline
          S Offline
          Sebastian
          wrote on last edited by
          #4

          @SGaist : Thanks for your input.I fixed the issue by setFocus in ShowEvent().So i mark it as resolved.

          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