Home > other >  On the QT KeyPressEvent () event
On the QT KeyPressEvent () event

Time:09-27

1. Recently done a small demand: define shortcuts & lt; - & gt; And number keys 0 1 2 3 4 to locate a group of child controls in the MainWindow but found rewrite the MainWindow of KeyPressEvent () if its not in focus state, the key is invalid must put focus on the to respond to the keys, then want to approach are: (1) to monitor all child controls in the Event of discovery is defined by the shortcut to the MainWindow treatment but it's so trouble every time a new child controls need installFilter QAxWidget () and I found the child controls will not be forwarding events (2) want to rewrite all child controls KeyPressEvent () will get the Event () sent to the parent is also very troublesome 2. Then use the function of the perfect realization of the Win32 keyboard hook but I want to know the key processing in QT true is trouble?

CodePudding user response:

Top, also have the same question,
The topic of the answer?
  • Related