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
0 answers

in QTextEdit ,can't respond to mouse click events

I want to use mouseDoubleClickEvent,but it does not work this is my code: textEdit->setMouseTracking(true); who can help me ? thank you sorry,my English is so bed
1
vote
1 answer

event(QEvent*) conflicts with mousePressEvent(QMouseEvent *)?

In QT: I use a class inherited from QToolButton and rewrite event(QEvent*), now I want to add 'mousePressEvent', but it never gets hit, does event(QEvent*) conflict with mousePressEvent(QMouseEvent *) ? Thank you. bool IconLabel::event (QEvent* e )…
Al2O3
  • 3,103
  • 4
  • 26
  • 52
1
vote
1 answer

Filter minimize event

I have a QMdiSubWindow and I need to filter the minimize event so that I can simply hide() the window. I have tried the following: void accounts::changeEvent ( QEvent *event ) { if(event->QEvent::WindowStateChange) { event->ignore();…
JP_
  • 1,636
  • 15
  • 26
0
votes
2 answers

Qt/C++ – How to differentiate between closing main window from an external app and clicking close button click from title bar?

I currently have a QMessageBox appear on exiting from MainWindow, asksing "Are you sure?". While updating the app through InnoSetup installer file, the installer tries to close the MainWindow, however, the "Are you sure?" button still appears, which…
0
votes
1 answer

QContextMenu issue with QPlainTextEdit item delegat in QTableView

I have a QTableView with delegates for certain columns. The default editor for indices is QLineEdit, for the 'comment' column delegate however I chose a QPlainTextEdit. Getting that to expand and adjust to contents was a PITA on its own (see…
0
votes
0 answers

[QT][QML_C++]Not able to detect touch events as "TouchBegin" QEvent when Popup object is open

I have implemented a code to detect X and Y co-ordinates of the touch points. In the implementation, I have used eventFilter() to detect the touch events like this: bool IpcSocket::eventFilter(QObject *,QEvent *event) { qDebug()<<" EVENT TYPE…
0
votes
0 answers

Accept mouse input in QWidget shown while right mouse button pressed

My usecase is as follows: I am making a simple drawing app, and one of the "innovations" is to hide the tool palette until the user presses and holds the right mouse button at which point the window containing the tools will show. The tool palette…
Mr. Developerdude
  • 9,118
  • 10
  • 57
  • 95
0
votes
0 answers

How to let sibling windows accept event?

I write a simple window, when cursor in QLineEdit and press Enter Key, I want the QGraphicsRectItem, QGraphicsScene, QGraphicsView and QWidget also accept QKeyEvent or MyEvent(customize event).I have no idea to do it,Could someone have good method…
jett chen
  • 1,067
  • 16
  • 33
0
votes
1 answer

does QEvent::KeyPress require QEvent::KeyRelease?

I've been using QEvent::KeyPress only to emulate keypresses for navigating QTreeView and QTableView without explicitly releasing the keys afterwards. Works like a charm, no issue at all. For example Class::moveFocus(double v) { const auto mod =…
ronso0
  • 1
  • 1
0
votes
0 answers

QEvent on property set in QML

I would like to catch QEvent in my custom cpp QObject (MyObject) if some of the properties is changed (QEvent::DynamicPropertyChange): class MyObject : public QObject { Q_OBJECT Q_PROPERTY(bool value MEMBER mValue) public: MyObject(); …
0
votes
0 answers

Create event clicking on context menu with python pyqt5

Am working with PyQt5, and I have a window app, I already have some functions and classes, and I implemented that when the user click Mouse Right-click it shows a context menu. What I need is: I want to make a unit test for the code, so I want to…
0
votes
0 answers

QEvent:: MouseButtonPress and QEvent:: MouseMove effecting a QGraphicsScene in a strange way

I have an application where I want to pick up the position of the mouse in a graphics view and use this to draw a pair of threshold markers to adjust a gradation scale within the same graphics view. The graphicsView_gradbar widget is 162x22 pixels…
0
votes
0 answers

Want to make pen pressure viewer with Python

I want to make a pen pressure viewer with Python. It's working in that window: but it's not working when I'm drawing in Photoshop or just other software. How can I make it work when I'm drawing in other windows? import os, time, sys,…
Neereu
  • 1
0
votes
0 answers

Why mousePressEvent is not called when I click MiddleButton of mouse on Combobox popup?

I am using Qt Creator and C++ for my code. I have a checkable combobox for multiselection. I want to select the unchecked checkbox using mouse Middlebuton from popup. I tried to override the mousePressEvent but didn't work. Below is the snippet of…
0
votes
0 answers

Serializing QEvent to send over a QTcpSocket connection

I'm pretty new to Qt and C++. I've been trying to send a QMouseEvent across a QTcpSocket. I understand that you can serialize QObjects using the QDataStream and the << / >> operators. However, QEvent is not a supported class, so I was wondering if…