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
1
vote
2 answers

Qt Prevent QDialog from hiding

In my application windows all have a QDialog context menu for settings etc, accessible with a right mouse click. In one of these dialog boxes we want to display a popup (QMessageBox) warning the user of an action, but Qt only allows on dialog box at…
MikeS159
  • 1,884
  • 3
  • 29
  • 54
1
vote
1 answer

eventFilter(QObject *obj, QEvent *e) does not detect right object

I expect my program to print "mouse on label name" when my mouse is located on the labelname (a QLabel), and to print"mouse not on label name" when my mouse is not located on the labelname. Even though I put my mouse on labelname, my program prints…
lll
  • 302
  • 3
  • 13
1
vote
2 answers

re-send an event to a newly enabled child widget

NOTE: below is in edit with a more complete example I want to implement the following in Qt (specifically PyQt, but I believe that the solution will be similar in both python and C++): I want a widget to have an internal widget that is disabled by…
bentheiii
  • 451
  • 3
  • 15
1
vote
0 answers

The old QWidget::event() return value question?

Long years past a user asked this question on the Qt centre forum and it was left unanswered. It is still relevant, in particular in relation to QWheelEvent. In my experience, the QWheelEvent must be either accept()ed or ignore()d by an event…
user1095108
  • 14,119
  • 9
  • 58
  • 116
1
vote
1 answer

How to consume QEvent::WindowBlocked so that specific window is always active?

I created myself simple window for debugging purposes. It's completely separate QMainWindow, so that I can put it on the other monitor when testing the app. But when there's a dialog in my application, I cannot access the window. Right now, this is…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
1 answer

Which event belongs to window focus changing in qt c++?

I want to save the focused window's title, i made this part but i dont know is there any QEvent which catches all (non-application) focusChanged event? Like switching from Chrome to Qt Creator. I made an alternative solution that checks in every…
Dephott
  • 45
  • 4
1
vote
3 answers

How to discard an QEvent instead of just ignoring it

I have two widgets ParentWidget and ChildWidget both being derived from QWidget and both overriding void dragEnterEvent(QDragEnterEvent *event). Now ChildWidget is contained in the ParentWidget. Now assume that a certain QDragEvent* called event…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
1
vote
1 answer

QTableView doesn't send expected FocusIn / FocusOut events to eventFilter

I have a QTableWidget with floats or complex entries that need a lot of horizontal space. Displaying the values with reduced number of digits via string formatting works fine, but obviously I loose precision when editing and storing entries in the…
Chipmuenk
  • 607
  • 1
  • 7
  • 22
1
vote
2 answers

Learn about occurred events from other class

I have two classes: typedef std::shared_ptr window_ptr; class WindowManager { public: ... private: std::stack m_windowsStack; } and class AdaptedWidget: public QWidget { Q_OBJECT public: …
Tipok
  • 675
  • 8
  • 26
1
vote
1 answer

Can I delay/bundle reactions to QPlainTextEditor.textChanged events?

I have a small IDE for a modeling language I wrote, implemented in PyQt/PySide, and am trying to implement a code navigator that let's you jump to different sections in the file being edited. The current implementation is: (1) connect to…
Michael Clerx
  • 2,928
  • 2
  • 33
  • 47
1
vote
0 answers

QEventDispatcher: Failed to create QEventDispatcherWin32 internal window: 1407

We've a web app that runs wkhtmltopdf.exe in its own process to convert an html string to a pdf file. On the live server it fails to complete and when the process is killed off reports the error: QEventDispatcher: Failed to create…
Chris C.
  • 908
  • 1
  • 10
  • 19
1
vote
1 answer

How to handle keypress event for all child widgets, in Qt?

I want to handle keypress event for all the child widgets, for which I am trying something like below: Widget::Widget(QWidget *parent):QWidget(parent) { QGroupBox *gBox = new QGroupBox(this); QPushButton *button1 = new QPushButton("1"); …
Nikhil Singh
  • 81
  • 10
1
vote
1 answer

Qt: Pass QGraphicsSceneContextMenuEvent from QGraphicsView

I have derived from both QGraphicsView and QGraphicsRectItem. I overloaded the contextMenuEvent on both classes to provide popup menus. I want the QGraphicsView context menu when you click on white space the the QGraphicsItem popup menu when you…
cagem12
  • 43
  • 5
1
vote
3 answers

Qt event when anything changed on the window/screen + Screenshot

I'm thinking of extending a QT4 application with some debug possibilities, to make it easier analyzing customer issues. The application already has a "Debug" mode, when this is enabled, a lot of log entries generated, which is hard to read. What I…
1
vote
1 answer

Qt5.5 How to override MousePress event coordinates at Application level

I'm developing an application on a small Embedding Linux device with Qt5.5. I need to be able to modify the mouse press coordinates received from Linux ( tslib ) in my application. I've tried implementing an event filter in my main view that…
PhilBot
  • 748
  • 18
  • 85
  • 173