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
1 answer

QEvent Signal and Slot

I created a Qt Project and I added a QPushButton with a style I customized with QEvent and QMouseEvent. I added a slot to this button but it doesen't work. Here is a project like mine: Header 1: #ifndef MYQPUSHBUTTON_H #define…
1
vote
2 answers

Qt LanguageChange event - find out new language

When I have changeEvent(QEvent* event) with receive type event->type() == QEvent::LanguageChange, how can I get information about what the new language is in my app?
HelloThere
  • 35
  • 1
  • 5
1
vote
1 answer

QWidget do not trigger QEvent::MouseMove when entered with Pressed button

In Qt with C++, I created a window with a small QWidget inside. The small QWidget show a message every time QEvent::Enter, QEvent::Leave or QEvent::MouseMove is triggered. When any mouse button is pressed (and holded) outside of the small QWidget,…
Adrian Maire
  • 14,354
  • 9
  • 45
  • 85
1
vote
2 answers

Logging queued connections

I am using a complex state engine system build with Qt 5.4 (using custom state engine classes). Part of that code is logging of events, transitions, etc. It is very important for me to log all events the engine/state objects are receiving so I can…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
1
vote
0 answers

QMoveEvent continuously emitted

I am using the same Qt program (v5.2.1) on both windows 7 and Ubuntu. In both I have a QMainWindow that overrides the event function like so: bool MyMainWindow::event(QEvent *event) { switch(event->type()) { case QEvent::Move: // Do…
1
vote
3 answers

Pass Events Between QML Objects

I have a situation where I would like to pass a QML event to another QML item in the middle of the initial event handler. e.g. Item { id: item1 Keys.onPressed: { // Pre-process... passEventToObject(event, item2); //…
spbots
  • 1,513
  • 1
  • 15
  • 22
1
vote
1 answer

Qt - Signal send by a qt object invoked the event function overridden by receiver object

Qt problem: I am sending a signal from object A which is running on thread A to object B which is running on thread B. I am also handling custom events by overing virtual event function in Object B. Problem facing: When object A is emitting any…
1
vote
0 answers

QT emitting signal on screensaver (windows)

Is there a way in QT to detect when the system is entering screensaver (in windows)? keep in mind, that my process is a background process and isn't active all the time, so i can't use this as an Qevent... and i don't want to try and figure out if…
Gal Maman
  • 11
  • 3
1
vote
2 answers

Implementing a slot function if and only if a a text box has focus and "enter" is pressed?

Basically, I just want to clear a text field iff the user has "clicked" the text field and the enter/return key has been pressed. After some research I found that you must first set the focusPolicy for each widget. Done. …
sherrellbc
  • 4,650
  • 9
  • 48
  • 77
1
vote
1 answer

Qt Display tooltip after mouse hover on QGraphicsPixmapItem

I'm using QGraphicView to show game map that consist QGraphicsPixmapItems. I need to show tooltip on mouse hover at QGraphicsPixmapItem. For saving QGraphicsPixmapItem position I using MazeItem: #ifndef MAZEITEM_H #define MAZEITEM_H #include…
user3394087
1
vote
1 answer

qt multiple keys in keypressevent()

I'm trying to create a game on Qt where the player can go diagonally. So when I press W and D, the player can go to the upper right hand corner. However, when I press W first, then D, then release D, the player does not go in the W direction. In…
Jordan Huang
  • 25
  • 1
  • 8
1
vote
1 answer

Equivalent of QEvent ApplicationDeactivate

I use the events QEvent::ApplicationActivate and QEvent::ApplicationDeactivate to show/hide some part of my app when needed. But now, thoses events are flagged as deprecated : This enum has been deprecated. Use ApplicationStateChange instead. So I…
Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
1
vote
1 answer

QListWidgdet resizeEvent QPainter::begin: Paint device returned engine == 0, type: 2

I made class inherit from QListWidget and overrride resizeEvent: void ListaDrzew::resizeEvent(QResizeEvent *event) { QListWidget::resizeEvent(event); int width = event->size().width() / columnNumber - 10; setIconSize(QSize(width,…
Wez Sie Tato
  • 1,186
  • 12
  • 33
1
vote
3 answers

Can I subclass QEvent?

I tried to make a class which is a subclass of QEvent, but I got error after building. My steps, 1. Create a project using Qt console template 2. create the following code #ifndef MYEVENT_H #define MYEVENT_H #include #include…
CCC
  • 2,164
  • 8
  • 27
  • 47
1
vote
1 answer

global event catch for QEventfilter class

I want to add a help webpage for my Qt Application. The user can use the Qt::WhatsThis "tooltip" to have a explanation about the topic and a URL to a webpage. I edit the WhatsthisTooltips with the Qt Designer and have it language indepentend. Now I…
norca
  • 138
  • 1
  • 14