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. Programming Keyboard Focus!
Qt 6.11 is out! See what's new in the release blog

Programming Keyboard Focus!

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.0k 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.
  • W Offline
    W Offline
    winspear
    wrote on last edited by
    #1

    I have a tabbed interface and I can move between the tabs by using two push buttons named next and back. I want to control the keyboard focus to be on different buttons on different tabs.

    How do I do this?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Iktwo
      wrote on last edited by
      #2

      I don't know if this is what you want, but I have a tabbed interface and an add button in my pages, I can press "Ctrl" + "+" and only the active tab respond

      @add=new QAction(this);
      connect(add, SIGNAL(triggered()), this, SLOT(slotAdd()));
      add->setShortcut(QKeySequence(tr("Ctrl++")));
      this->addAction(add);@

      Edit: I'm so sorry I misunderstand the question, you can set focus with
      @setFocus()@
      and a QTabWidget has a signal called @currentChanged@

      so you just have to acess a child of your new Widget and set the focus to it..

      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