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

QStateMachine - QMouseEvent

In another question you tell me to use QStateMachine. I'm new to Qt and it's the first time i use the objects so I make a lot of logical mistake, so using QStateMachine it's a big problem... It's the only way to do thath ? I try to explain my…
0
votes
1 answer

try to use QMouseEvent

I've a problem with QMouseEvent: void Gioco::gioco_G1() { QMouseEvent *mouse = new QMouseEvent; bool stato = false; do { if (mouse->KeyPress() == Qt::MouseButton::LeftButton) { qDebug()<<"entra nell'if"; if (img_mano1G1 ->…
0
votes
0 answers

Creating one event from another - do I have memory leak?

Who is responsible for managing events ? For the following code: bool MyView::gestureEvent(QGestureEvent *event) { if (QGesture *hold = event->gesture(Qt::TapAndHoldGesture)) holdTriggered(static_cast(hold)); …
Thalia
  • 13,637
  • 22
  • 96
  • 190
0
votes
1 answer

How to make a QEvent that bubbles up to parent QObjects?

I need to make a GUI button that tells it's parent (or parent's parent or even parent's parent's parent...) that different widget in the QStackedLayout should be shown. I created a custom QEvent: class SwitchScreenEventWidget : public QEvent…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
1 answer

Abort a QCloseEvent

In my application, I am handling a QCloseEvent (when the close button X was pressed): void MainWindow::closeEvent(QCloseEvent* event) { if ( !isAbortedFilestoSave() ) { this->close(); } // else abort } The if clause is triggereed…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
0
votes
1 answer

How to register for ACTION_VIEW Intent on Android? Why doesn't my QApplication receive QEvent::FileOpen events?

I am trying to register a QtQuick Android application to open a certain class of files and handle them. From what I gather, when a file is opened with a QApplication it results in a QEvent::FileOpen being fired. The strongest (if inconclusive)…
Tobia Tesan
  • 1,938
  • 17
  • 29
0
votes
0 answers

Integration testing with QEvent serialization

I want to create integration test toolkit for my gui app. My app will have 3 modes: Normal mode - app just executing and doing what must do Record mode - app executing and doing what must do with recording all system events Repeat mode - app…
synacker
  • 1,722
  • 13
  • 32
0
votes
2 answers

Determine mouse event: hover leave parent for child widget

I have 2 widgets, a parent and a child widget: Having access to the implementation of the red widget, is it possible to determine the moment when the cursor hovers out of the red widget into the blue widget without implementing any event handlers…
Jacob Krieg
  • 2,834
  • 15
  • 68
  • 140
0
votes
0 answers

send Qevent from thread

Please can some-one suggest on this question..? I have to send data from my TX thread to mainwindow using class derived from QEvent. I want my RX thread to throw an event whenever some data is received so hat i can display that data in the…
Katoch
  • 2,709
  • 9
  • 51
  • 84
0
votes
1 answer

saving pointer to mainwindow - Qevent

I need to post an Event from an thread to an QtreeView in my Mainwindow. Now to post an event we need the pointer to the Qobject (i.e. our qtreeview inside main window). For this i have to take the pointer to my mainwindow in constructor…
Katoch
  • 2,709
  • 9
  • 51
  • 84
0
votes
1 answer

Qt5 (c++) android listening for system buttons

I want to use the menu button in my android app (4.x so usually software, not hardware buttons) but I can't find a suitable QEvent to do so. I tried to do bool GLViewer::event(QEvent * e){ qDebug()<type(); } But pressing the menu button…
user2525598
  • 75
  • 1
  • 7
0
votes
1 answer

Force A QWidget to End Event Propagation

I attached a QLineEdit to a subclass of QGraphicsScene. I noticed that the QGraphicsScene is also getting any mouse event (such as mouse press, mouse release, mouse move, etc) in addiction to the QLineEdit I attached. Is there any way to prevent the…
K. Barresi
  • 1,275
  • 1
  • 21
  • 46
0
votes
0 answers

QObject auto-delete

I am having some problems with a QObject that is being deleted when I don't expect it to. I have this class (note that I don't declare Q_OBJECT) class MyEntry : public QTreeWidgetItem { public: MyEntry(QTreeWidgetItem* _parent, QString _name =…
Lieuwe
  • 1,734
  • 2
  • 27
  • 41
-1
votes
1 answer

Infinite QGraphicsView::resizeEvent calls

I have a custom layout BoardLayout, which inherits QLayout. It is written in analogy to BorderLayout example (https://doc.qt.io/qt-5/qtwidgets-layouts-borderlayout-example.html), with a following setGeometry() method: void…
user87035
  • 11
  • 3
-1
votes
1 answer

How to emit a signal if double clicking on slider handle

We are using Qt 5.10/C++ and I'm asked to implement a feature using the QSlider class. My colleague wants me to emit a signal, whenever the user performs a double mouse click on the slider handle. How can this be achieved. Maybe I have to…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
1 2 3 4 5 6 7
8