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

Difference in QEvent types emitted on Mac OS and Linux when QMenu is closed

I am using a QMenu in my application and when I click outside the QMenu to close it, Qt emits a couple of events. I found that on Linux, it emits the following…
shubhamcr7
  • 37
  • 1
  • 5
0
votes
2 answers

Qt: How to catch QDateEdit click event?

I'm trying to catch mouse click on QDateEdit widget by handling QEvent::MouseButtonRelease event, but can't find a way to do it. I tried to override QWidget::event method of the parent widget, but it seems that events go through children to parent,…
Denis
  • 2,786
  • 1
  • 14
  • 29
0
votes
1 answer

How to get new coordinate of a widget when window is moved?

I have a small dialog like this: When I move the dialog into another place on the desktop, how can I get the new global coordinate of an element in the dialog (for example, in this case the top left point of the Ok button)? Imagine I have a…
songvan
  • 369
  • 5
  • 21
0
votes
0 answers

hoverMoveEvent in Qt5 interfering with mousePressEvent

I have a subclassed QGraphicsPixmapItem (item) set to receive hoverMoveEvents and mousePressEvent. When I click on the item without moving my mouse, the hoverMoveEvent is also triggered. What's more problematic is that when I call…
ALH
  • 85
  • 4
  • 14
0
votes
1 answer

Overloading event on QMainWindow blocks all other events

I want to handle the QEvent::WindowDeactivate and for this I overload this function on my QMainWindow derieved class. class MainWindow : public QMainWindow .... bool event(QEvent * e); .... bool MainWindow::event(QEvent *e) { if(e->type() ==…
3dmodels
  • 103
  • 7
0
votes
1 answer

capture a copy of other QWidget events?

I am working on a widget that needs to update itself when another widget it is matched with moves or is resized. Currently, I have the other widget do its own resizeEvent() and moveEvent() and inside that it emits a signal that my widget connects…
Drew
  • 1,171
  • 4
  • 21
  • 36
0
votes
1 answer

Qt Event process order in scene items model

I custom my own item, which inherits from QGraphicsItem, override the mousePressEvent function, then I add it into QGraphicScene. When I debug, I move mouse onto my item, then press down, I find that the QGraphicScene's event processing function is…
user497032
  • 75
  • 1
  • 10
0
votes
0 answers

Activate QMainWindow in Astra Linux

I have an application with some windows, and one of them is modal. On Windows OS, I can't raise the not modal window by clicked on it when the modal window is activated. On Linux (I'm using Astra Linux) I can do this (not modal window will raise). I…
0
votes
0 answers

Qt MouseReleaseEvent never triggered inside eventFilter

I have the following widget's hierarchy: root (QWidget) |-> first child (QWidget) |---> label A (QLabel) |---> label B (QLabel) |-> second child (QButton) |-> third child (QButton) what I am trying to achieve is to receive mouse release events…
cmourglia
  • 2,423
  • 1
  • 17
  • 33
0
votes
1 answer

QTableView enable Drag & Drop columns only for specific columns

So I want to prevent some columns from allowing drag & drop Events. I wasn't able to add a eventfilter to those columns. Anyone with an idea how to do that? I have an QTableView filled with a QStandardItemModel and set up for allowing drag & drop.
easysaesch
  • 159
  • 1
  • 14
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

QCombobox write "HELLO" when press backspace

i want intercept signal when i press on a Qcombobox->linEdit(), key Backpace and clear all text. I have seen on web and i write this code, but it dont work. It seem that keypressevent function not is invoked.. Some tips??? …
user3589887
  • 139
  • 2
  • 13
0
votes
1 answer

QEvent::Drop event is never generated for QQuickView window

I'm struggling with an issue that QEvent::Drop event is never generated for my QQuickView window. I need to implement a drag'n'drop functionality, to drop files from explorer to the QQuickView. As described in this post, i've istalled an eventfilter…
Vaska el gato
  • 198
  • 15
0
votes
1 answer

Is it safe to forward a QEvent recieved from QCoreApplication::postEvent

I have a QT C++ application that has multiple threads running, and the threads use the QCoreApplication::postEvent mechanism to transmit information to each other. The QCoreApplication::postEvent documentation explicitly states the the event must…
IAS_LLC
  • 135
  • 11
0
votes
1 answer

Getting Pixmap is a null pixmap on calling a function 500 times

I am showing a image in qt label. Below is my code: void MyClass::onPushButtonClicked(QString myurl) { this->setCursor(Qt::WaitCursor); ui.qtImageLabel->clear(); qDebug()<
sk110
  • 77
  • 2
  • 9