-
Bug
-
Resolution: Incomplete
-
P3: Somewhat important
-
None
-
4.7.0
-
None
-
OpenSUSE 11.3 with qt 4.7.0 + kde SC 4.5.2 Qt compiled according to the kde manual.
I open QFile object on the fifo file. Use QSocketNotifier to understand when data arrives (connect it`c activate signal to the my slot). So In this slot QFile::bytesAvaliable always return zero!.
some code:
SomeClass::SomeClass() { .... channel = new QFile("../channel"); notifier = new QSocketNotifier(channel->handle(), QSocketNotifier::Read, this); connect(notifier, SIGNAL(activated(int)), this, SLOT(read(int))); .... } SomeClass::read(int desc) { qDebug() << channel.bytesAvailable(); //This always print zero! But int canRead = 0; qDebug() << "ioctl result:" << ioctl(desc, FIONREAD, &canRead); // This print right value - there is non zero data! }
Is it a bug in Qt? Or I do something wrong. I think it is a bug because it is a similar to the http://www.qtcentre.org/threads/20268-Non-blocking-stream-read and it doesn`t work for me.