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

PyQt5 QTimer 10ms is not accurate with QEventLoop and qasync in GUI APP

there: I have a weird behaviour with QTimer in PyQT5 when I try to measure frames and frequency. If you set a timer with 10ms = 1 / 100 every signal message gives the time every time. It works with the following snippet but then with another app…
1
vote
3 answers

PYQT - How to cancel loop in my GUI using cancel button?

I have been strugling with this for some time. I will try to explain what i want to do , maybe you guys could help me. So lets say I have GUI with status label on it and Two loops that look like this: for _a in range(3000): …
zebov
  • 19
  • 1
  • 2
1
vote
0 answers

Is there a semaphore in Qt that is based on event loops as opposed to thread blocking?

The threadblocking of a semaphore or a mutex often causes program stuttering, and I'd rather have one that was based on QEventLoop, where as that will not halt the thread. Does this already exist, particularly for a semaphore, or do I need to create…
1
vote
0 answers

What is the purpose of QEventLoop::wakeUp()?

I am using a custom event processing with QEventLoop::processEvents() to make some piece of code synchronous... I have seen QEventLoop::wakeUp() in the documentation which says: Wakes up the event loop. Looks like too little for me. What does…
Slava Zhuyko
  • 691
  • 4
  • 12
1
vote
0 answers

QEventLoop slot not called with WASM

I am trying to run the following code: std::string RequestLogin() { std::cout << ">> User Login method..." << std::endl; QNetworkRequest request(this->serverUrl); request.setHeader(QNetworkRequest::ContentTypeHeader,…
Ronak SHAH
  • 171
  • 2
  • 11
1
vote
1 answer

How Qt Handle Events and Signal in Same EventLoop

I couldn't understand how qt handle events (e.g timer event, socket event etc.) and signals in same event loop.As I understand,timer and socket events are handled via select system call(in Unix like OS). How an event loop handle signals while…
overlord
  • 489
  • 1
  • 7
  • 20
1
vote
1 answer

How to end graphic GUI and do console function(QT)?

I am completely new to QT and I want to prepare one window and take some input from the user then with this input run one console and show output in the console. I have tried to write code after exec but it seems it is not possible: int main(int…
SpongeBob
  • 383
  • 3
  • 16
1
vote
1 answer

QEventLoop process all events

I've a menu screen which must be updated before the login screen closed. The code is something similar to below one; emit updateMainMenuAccordingToUserRights; QCoreApplication::processEvents(); emit jumpMainMenu(); The problem is 'how can I be…
cumbaba
  • 11
  • 3
1
vote
0 answers

Qthread deleteLater() crashing program

QT 4.8: I have been getting a number of segment faults and I/O Possible errors in my code that I cannot figure out. From print statements I have seen a number of odd and inconsistent behaviors, likely indicating race conditions. Many times…
JavaBeast
  • 766
  • 3
  • 11
  • 28
1
vote
0 answers

QEventLoop 's exec doesn't loop in certain situations. (QT 4.8)

I'm working in a QT complex application that serves HTTP/TCP requests through QT 4.8 slots. Example module (QT slot): QString HelloWorld::greet() { return "Hello world..."; } With this module, we can call our service through either HTTP or TCP…
1
vote
1 answer

Why does PyQt4 behave differently between Jupyter and IPython notebook?

I have created a large python program with GUI based on PyQt4. I would like the package to run both in an IPython notebook (old installation with Python 2.7 on windows), Jupyter notebook (Python 3.5 installed recently with Anaconda), and as a python…
Leonhard Neuhaus
  • 228
  • 3
  • 11
1
vote
2 answers

QTimer fires late due other thread busy with big loop

Brief of environment: I have a device on which runs an application written in qt. It has a main thread which handles Database operations (SQlite) and a separate thread for networking operations (via 3G). Mains thread Event loop is ran by…
ionutCb
  • 13
  • 6
1
vote
1 answer

QUdpSocket High rate message reading

everybody! I have a strange issue in working with QUdpSocket and readyRead signal, I can say it's not working as I think, I create a QUdpSocket and bind it to some port , connect the readyRead signal to my slot and I read all the pending datagram as…
danics
  • 323
  • 1
  • 9
1
vote
1 answer

QTimer timeout problems with QEventLoop and QNAM

I have created my own HTTP class that utilizes QNAM and provides means for sending HTTP requests. It uses QEventLoop for synchronization and QTimer for timeouts. I'm facing few problems with my solution. On certain Symbian platforms my QTimer…
Routa
  • 565
  • 3
  • 6
  • 14
1
vote
3 answers

QApplication Within A Shared Library Event Loop Issues

I'm trying to use QWebPage in a shared library, which means I have to have QApplication in there to get a GUI context for it to run in. I've built my code up to get this in place, however as soon as I run qApp->exec() the Event Loop completely…
Nicholas Smith
  • 11,642
  • 6
  • 37
  • 55