On 07/07/2007 10.23, Michiel De Hoon wrote:
static int qtcore_input_hook()
{
QCoreApplication::processEvents();
QCoreApplication* app = QCoreApplication::instance();
if (!app) return 0;
while (1)
{
QTimer timer;
QObject::connect(&timer, SIGNAL(timeout()), app, SLOT(quit()));
timer.start(100);
QCoreApplication::exec();
timer.stop();
QObject::disconnect(&timer, SIGNAL(timeout()), app, SLOT(quit()));
if (_kbhit()) return 0;
}
}
FWIW, I'm +1 on this. It's a problem within Python proper of course (it should
be calling PyOS_InputHook with the same semantic irrespective of the presence
of a readline module), but it's totally hopeless to see it fixed in Python 2.x
(see some related SF.NET bugs for more infos).
Thus, it looks like this workaround is the only stop-gap. TkInter does the
same, after all.
--
Giovanni Bajo
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt