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. Key_Space event problem
Forum Updated to NodeBB v4.3 + New Features

Key_Space event problem

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k 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.
  • M Offline
    M Offline
    Minz
    wrote on 7 May 2013, 22:57 last edited by
    #1

    Hi everyone, i'm developing a typing tutor application, on one of my widgets i have a QTextBrowser and some QPushbuttons for the keyboard layout. I implement keyPressEvent such that when a user types the text browser is updated, however when i push the space button one of the QPushbuttons on the keyboard layout is catching the event. I've tried @setFocusPolicy@ but it doesnt seem to work. Help would be much appreciated.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 8 May 2013, 01:18 last edited by
      #2

      You need to put the focus somewhere other than a QPushbutton or pressing space (maybe enter) will trigger it. Normally users would type into a QTextEdit and it would have the focus but you seem to be avoiding that. If you cannot place the focus elsewhere then you should be able to install an event filter on the QPushButtons (either from outside or by subclassing) and block Qt::Key_Space keyboard events for that button.

      1 Reply Last reply
      0

      1/2

      7 May 2013, 22:57

      • Login

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