Hey trolls,
Consider the following code:
socketNotifier->setEnabled(true);
QObject::connect(socketNotifier,
SIGNAL(activated
(int)), q,
SLOT(onReadyRead
()));
if (file.
open(0,
QFile::WriteOnly) == true) {
stream << "lol";
file.close();
}
socketNotifier = new QSocketNotifier(0, QSocketNotifier::Read, q);
socketNotifier->setEnabled(true);
QObject::connect(socketNotifier, SIGNAL(activated(int)), q, SLOT(onReadyRead()));
QFile file;
if (file.open(0, QFile::WriteOnly) == true)
{
QTextStream stream(&file);
stream << "lol";
file.close();
}
To copy to clipboard, switch view to plain text mode
My onReadyRead() slot never gets called.
Why ?
Bookmarks