Questions tagged [qkeyevent]

The QKeyEvent class, part of the Qt framework, describes a key event.

Documentation can be found here (Qt4) and here (Qt5).

73 questions
1
vote
1 answer

How to make a Qt dialog to deal with key event instead of all its child widget?

I have a dialog inherits QDialog. the dialog has many widgets including Qbuttons, QLabel, QGraphicsView, etc. Many widgets such as button can process SPACE key pressing event when they get focus. Now I don't want any of the child widgets to deal…
Royt
  • 199
  • 4
  • 14
0
votes
1 answer

controling selected item with keyboard in a QCombobox with QTreeView

Using Qt 6.2.4, Ubuntu environment, I derived from QComboBox to set a QTreeView as its view. It contains a tree (folders and files) with multiple parents and children, several levels of folders is possible. All is working fine and behaves as I…
0
votes
1 answer

QML propagate key events from ListView delegates

main.qml import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") onActiveFocusItemChanged: console.log(activeFocusItem) Item { …
Fausto01
  • 171
  • 14
0
votes
0 answers

How to communicate between two different applications (Web Application and Console Application) using Ctr+c , Ctr+v , Entre

I have two application one is a web application and the onther one is a console application, the Console application generates a Data and that Data must be transfered to the webapplication, i tried to use the APIs to communicate between them but I…
Med Aymen
  • 114
  • 1
  • 8
0
votes
1 answer

What is different QKeyEvent modifiers in Qt4 and Qt5

When I enter the number pad side of the keyboard in qt4, I want to receive QEvent::KeyPress and process it. However, if I check the modifiers() of the event, KeypadModifier should come in, but NoModifier is entered in the first time. After that, get…
0
votes
1 answer

QT: only one widget response the key press event when there is two widgets

I have two widgets in my application, and I want to do something in the widget when the key is pressed. However, I find only one widget response the key press event even the other one has the focus. The code to reproduce my problem is: from…
Qiang Zhang
  • 820
  • 8
  • 32
0
votes
1 answer

QT Detecting if the return keyis pressed and released or if it is long pressed

I am using QT on Windows 10. I am using a QDialog where I want to push the QPushButtons also with the return key. However, I want that the user has to push the return key and release it again. Long pressing the return key should work only once and…
Quizard
  • 71
  • 1
  • 5
0
votes
1 answer

PyQt5 - Double press same keyboard key

I am handling multiple key presses by subclassing QMainWindow and overriding the keyPressEvent and keyReleaseEvent functions, and then updating a dictionary if the key is down or not... def keyPressEvent(self,event): …
SamG101
  • 488
  • 1
  • 7
  • 18
0
votes
0 answers

Text Input from QKeyEvent not working with Russian letters in QTextDocument

I have a strange problem with Text Input and Qt. I have a Widget that takes Key Press events, extracts the text and appends the text to a string variable and then creates a QTextDocument in the paint event and paints the text, so far so good, works…
Damir Porobic
  • 681
  • 1
  • 8
  • 21
0
votes
1 answer

KeyPress with multiple modifiers not working in QWidget

I have added an override for my main widget's keyPressEvent: void MainWindow::keyPressEvent(QKeyEvent* e) { if (e->key() == Qt::Key_F11) { if (e->modifiers() & Qt::AltModifier && e->modifiers() & Qt::ControlModifier) { …
Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
0
votes
1 answer

can't handle QKeyEvent in Qt C++ when digit and number keys are pressed

I want to do some specific things when user user presses keyboard key .for that I have following code in my program which uses qt and C++ :- //reimplemented keyPressEvent // MyWindow inherits from QWidgets void MyWindow::keyPressEvent(QKeyEvent…
orayan
  • 165
  • 2
  • 9
0
votes
1 answer

Qt simulate key press to control SimpleScreenRecorder application in Linux

I want (in Linux) to control desktop recording by activating SimpleScreenRecorder with emulating key press CTRL+SHIFT+R. SimpleScreenRecorder image I tried this code: QKeyEvent * eve1 = new QKeyEvent…
Vlado
  • 1
  • 1
0
votes
0 answers

How to send lowercase keys to Qt widget

I have a QWebView that loads a certain website. Now, I want to emulate a person that is typing something in a html input field. I set the focus on the input field and then go: QKeyEvent *event = new…
AudioGuy
  • 413
  • 5
  • 18
0
votes
1 answer

How to send a key event to a qwidget in a QDialog

I am trying to create a dialog that returns a double, similar to a QInputDialog, but with numeric buttons included in the dialog. It is for an embedded system with no keyboard. The problem is that the QDoubleSpinBox never reacts to key…
M. Frantz
  • 31
  • 1
  • 6
0
votes
0 answers

Not genering some keys [QKeyEvent]

I design an application where I will not have access to the system keyboard (writing under Debian). It is for this key panel monitor connected via RS232. The buttons have to emit the keys Tab, Backtab, arrows and Enter. In the class of the main…