Questions tagged [qevent]

A QEvent is a class from the Qt toolkit which forms the base class of all other event classes.

QEvent objects act as containers for event parameters.

The Qt main event loop fetches native window system events from the event queue, translates them into QEvents, and sends the translated events to QObjects (which receive them via their event() function). It is also possible to manually create and send events.

Each subclass of QEvent contains additional parameters to describe that particular event type.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

120 questions
2
votes
1 answer

QWebEngineView, post KeyEvents inside the View

I have my own "Virtual Keyboard". I already got to transform buttons clicked into KeyEvents and deliver it to QTextEdit and so on. My problem now is that I want to do the same for writable areas inside a QWebEngineView. For example, I use my…
yurisnm
  • 1,630
  • 13
  • 29
2
votes
0 answers

pyqt mouse held down eventfilter

I am new to PyQt and I can't figure this out. I am trying to install an eventFilter so that when a QPushButton is pressed and held down, the system increments a value at a certain rate (This will probably be a QTimer). I have a second QPushButton on…
Rogg2468
  • 21
  • 1
2
votes
0 answers

QToolTip::showText disappears after mouse relese

Inside a mousePressEvent I do QToolTip::showText(evt->globalPos(), "Test", this, rect(), 1000); But the tooltip disappears after releasing the mouse button. If I don't release it, the tooltip disappears after that 1000 msecs.
iBent
  • 392
  • 1
  • 2
  • 18
2
votes
1 answer

Get visible area of QPainter

I have an owner-drawn QWidget inside a QScrollArea, so when painting, and I want to paint only the parts that are visible. To do so, I need to have the rectangle of the visible area of the QPainter. The only candidates were QPainter::viewport(),…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
2 answers

How to use focusInEvent and focusOutEvent

I am implementing an application in which i am having 3 QToolButton and when the focus is coming on any QToolButton it should resize. One of my friend has given me answer but i am unable to figure it out as i am inheriting QMainWindow class as well…
Suresh
  • 745
  • 4
  • 11
  • 25
2
votes
1 answer

create & post the customized Qevent

I have to create an 2 custom events. I followed this link & made my code :-- Is there a cleaner way to register Qt custom events? Is it the right way to create & post & pass some data(Qstring) to the customized event…
Katoch
  • 2,709
  • 9
  • 51
  • 84
2
votes
2 answers

Qt how to know the widget, in which elements user set focus last time

Qt. I have a form. There is 2 widgets on it, that contains other widgets, buttons, line edits etc. I need: When user sets focus, clicks by mouse, or does something with first widget or elements, that it contain - I need to set variable to 0. If he…
Sacha_D
  • 68
  • 1
  • 10
2
votes
0 answers

Flush mouse events to a disabled widget

I have a Dialog with few buttons. When I disable the dialog, and I click on a child button, nothing happens. But as soon as I enable the Dialog again, the mouse event for the button is handled. Does disabling a Dialog simply delays handling of any…
Lata Agrawal
  • 81
  • 1
  • 8
2
votes
1 answer

QApplication does not handle key event?

QApplication app(argc, 0); MyDialog * pDlg = new MyDialog(0, Qt::WindowTitleHint | Qt::CustomizeWindowHint); if (qApp) qApp->installEventFilter(pDlg); In main(), I just install a event filter for qApp. Then in MyDialog.cpp: bool…
Royt
  • 199
  • 4
  • 14
1
vote
1 answer

passing item properties to main window with events in qt

I have the qmainwindow which homes several qgraphicsitems(an inherited class from qgraphicsitems) within a qgraphicsview. These items contains their personal items which are inherited from qgraphicsitems also. These items listen to mouse press…
zapumal
  • 159
  • 1
  • 2
  • 12
1
vote
1 answer

PyQt5: how to reimplement close-event in event-filter

I have this Qt Designer made main-window: main.py: from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(364, 480) …
pippo1980
  • 2,181
  • 3
  • 14
  • 30
1
vote
1 answer

Show all QCompleter elements on click

There is QComboBox with QCompleter. It is necessary to show all complementer elements when clicking on the LineEdit combobox. There is this code: completer = new…
1
vote
1 answer

Qt: How to display a text consistently on the cursor, not depending on cursor position?

I want a text to be displayed persistently on the curser event when the cursor is moving, not depending on the cursor position. I used Qtooltip for this purpose. This is the code to show the text: Widget::Widget(QWidget *parent) :…
mahya
  • 51
  • 4
1
vote
1 answer

How Qt Handle Events and Signal in Same EventLoop

I couldn't understand how qt handle events (e.g timer event, socket event etc.) and signals in same event loop.As I understand,timer and socket events are handled via select system call(in Unix like OS). How an event loop handle signals while…
overlord
  • 489
  • 1
  • 7
  • 20
1
vote
1 answer

Detect Drag on Drop over all Child QWidgets

I'm trying to implement Drag and Drop behavior, across my whole application, I would like to execute some action when a drop occurs, no mater where in the MainWindow. The Problem that I'm facing is that in my MainWindow, I have a Widget which…
Damir Porobic
  • 681
  • 1
  • 8
  • 21