Questions tagged [qeventloop]

The QEventLoop class, part of the Qt framework, provides a means of entering and leaving an event loop.

At any time, you can create a QEventLoop object and call exec() on it to start a local event loop. From within the event loop, calling exit() will force exec() to return.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

99 questions
0
votes
0 answers

How to add loadFinished to QEventloop in Pyqt4

I'm using PyQT4 (for the first time) to scrape some pages. Since I try to scrape multiple pages I use QEventloop. However I could not add loadFinished signal to code. Here is how my code looks like this: # Imports import requests from bs4 import…
edyvedy13
  • 2,156
  • 4
  • 17
  • 39
0
votes
0 answers

QT Closing QDialogs/QMessageBox opened from calling exec() when the parent window is closing

I am opening a QDialog/QMessageBox using exec() to get user input. But before the user selects Save or Discard from the message box, the parent window from which it was opened is closed. When this happens the application crashed. Can the…
ndnine89
  • 137
  • 2
  • 3
  • 12
0
votes
0 answers

QEventloop block boundary

I declare QEventloop class property: class myClass: public QObject { Q_OBJECT public: explicit QZXingFilterRunnable(QZXingFilter * filter) // ... private: // ... QEventLoop…
Mohammad Kanan
  • 4,452
  • 10
  • 23
  • 47
0
votes
1 answer

Modal QProgressDialog::setValue() causes crash by nested event loop

I just wrote some QThread based code that executes a big calculation. To visualize the progress I need to open a QProgressDialog. The dialog is application modal (using open()) since I do not want to allow modifications of the main window during…
Silicomancer
  • 8,604
  • 10
  • 63
  • 130
0
votes
1 answer

How are managed the events in QStateMachine?

I work with a state machine based on QScxmlStateMachine. Some transitions are automatically triggered by code in the onEntry handlers, some others are triggered by external events (such as user click). The execution of the state machine is…
ymoreau
  • 3,402
  • 1
  • 22
  • 60
0
votes
1 answer

Pyside / Pyqt Opening new windows from a window (Event loop is already running)

I am trying to create a UI that will act as a hub to launch all the other tools that have been created. The problem is that if i try to launch the UI from the toolshub UI, it won't let me because the event loop is already running. I know that I…
ghost654
  • 161
  • 2
  • 18
0
votes
0 answers

QEventLoop discard some signal

I have a question about QEventLoop: how to set a QEventLoop to discard some signal class MyThread : public QThread { Dialog *_dlg; public: MyThread(Dialog* dlg) : _dlg(dlg) { } virtual void run() { QTimer*…
zzh
  • 1
  • 1
0
votes
0 answers

Slot argument is (sometimes) invalid

In one of like 10-20 signal invocations i have an invalid argument in the slot. The problem boils down to the following class Sender : public QEnabledSharedFromThis { public: void emitSignal() { emit…
user6256186
  • 103
  • 1
  • 5
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
0
votes
2 answers

Run multiple QEventLoops in parallel (for QtNetwork)

I try to extend an old program that runs under Ubuntu/Linux Desktop with a Qt-network support. Having a LAN communication with these libraries needs to run the .exec() of the QEventLoop to really start working (i.e.: accept connections, receive,…
user3085931
  • 1,757
  • 4
  • 29
  • 55
0
votes
0 answers

Calling QEventLoop in QRunnable (to connect to multiple devices)

I have a QthreadPool to connect to upto 5 serial devices at the same time. each serial device is defined as: struct serialDevice { std::shared_ptr port; QByteArray portData; }; Inside a GUI and upon clicking…
QuestionMark
  • 412
  • 1
  • 4
  • 16
0
votes
1 answer

QEventLoop has already called exec() even with exit() before

I have a Button connected on click with myfuntion see below. I'm using a QEventLoop because I am waiting for an event, wich will call _myEventLoop.exit(0); When I click the button two times in a row without waiting for the event to happen I get the…
Giacogiac
  • 189
  • 1
  • 11
0
votes
2 answers

QTimer does not fire (trigger) timeout

I want to use Qtimer to pause executing of given block of codes, while in another thread it does something else. I connected the timeout of the thread with qeventloop quit, but the problem is, that the timeout is not called. When another emit…
0
votes
2 answers

How is my code Receiving Signals before the Qt Eventloop is Started

I'm trying to understand why putting the a.exec() call in the following Qt 4.8 code does not need to happen before my QProcess waitForFinished() and waitForStarted() calls can work. I understand that a.exec() starts the event loop, and in my mind…
PhilBot
  • 748
  • 18
  • 85
  • 173
0
votes
1 answer

Handling and deleting QThread in a loop

I have a class that is inherited from QThread (lets called it ClassA) that is running in a for loop like following: for(int i=0;iexecute(); // just a normal direct function call …
John Yang
  • 547
  • 1
  • 8
  • 21