Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.9.0, 5.9.1, 5.9.2
-
None
-
macOS Sierra 10.12.6
Qt 5.9.2 or earlier.
Description
When using QSocketNotifier with stdin under macOS the activated() signal fires continuously causing the CPU to spike to 100%. The same doesn't happen under Linux for example.
The way it's used is pretty basic. You have a QSocketNotifier* m_notifier and you attach it to the signal/slot using the following way:
m_notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read, this);
connect(m_notifier, SIGNAL(activated(int)), this, SLOT(readMessages()));
Even when the readMessages() function performs a blocking std::cin.read() it doesn't help at all. Something is clearly happening under macOS that is not correct.