Home > Mobile > For custom controls the custom shortcuts
For custom controls the custom shortcuts
Time:10-03
Requirement description: Control is inherits QWidget, through the draw button, now need to increase the shortcut key function (user customizable) Said the first mouse operations: The mouse to press the peace talks, will happen one or two operations, it is assumed that as A and B operation (according to the given mode) 1) the mouse press have A operational 2) the mouse to press A operation, B operation in the aftermath of the delay3) the press in operation, the mouse pop-up happened B operation
I once considered implementation ways, here to talk about their problems: (1) in accordance with the Qt button is implemented (after the actual test) The problem: can the normal access to the shortcut key event, but not achieve the 3) that the point, when the shortcut keys to cancel I can't get the message to invoke the operation B (2) the reload button presses the button up event and The problem: because shortcuts are user defined, unpredictable, key number and value judgments difficulties, Also not clear how to realize the capture range, scope of official shortcut keys can be set to grab: for example, the application level, the level of window, level of parts such as
(3) to carry a QAction custom controls, only need to connect the QAction signal The problem: in accordance with (1) the problems in the
Now very embarrassed subsidence here Want to ask next everybody have a great god solve the appeal three ways of any kind of problems existing in the method? Or provide a new solution, very grateful,
Here heavily for!!!!!!!!!! Oh, no, redistribution of solving
CodePudding user response:
PushButton binding shortcuts, can trigger the Button pressed and released the signal,
CodePudding user response:
Your own picture button, need to customize the signals, if your button is not from QPushButton or QAbstractButton inheritance, then you have to from QWidget inheritance, you then need to rewrite some of the key related to the event. When key events occur the position in your picture button emit conceal you click signal of the custom