[Qt-interest] QT 4.5 (embedded) : unable to open device file

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Tue Nov 17 10:16:44 CET 2009


Hi All,

I'm fairly new to Qt. We're using Qt 4.5 for our embedded board
running Linux (based on 2.6.22 with some vendor specific patches). I
plan to use the remote control for handling user input for the Qt GUI
apps.

I've written a simple console app (using QCoreApplication), which
opens the remote control device (/dev/ir) and installs a
QSocketNotifier over it (I pass the file descriptor of this file
opened using the "open" syscall). This way the moment somebody presses
a remote control button, my app gets a notification via the
QSocketNotifier::activated() signal and I'm able to read from the
device file and get the key code value. All this works fine. But, the
moment I move this code to a GUI app (using QApplication), I see that
the app starts failing at the device opening stage, i.e open syscall
fails (perror states : "Input/output error").

Any idea why this might be happening?

I tried another thing. In the _working_ console app, I put a
QWSServer::sendKeyEvent call() in the handler for the
QSocketNotifier::activated() signal. With this, open started failing
in this app with the same error (i.e "Input/output error")!!! I'm not
sure though, if I can directly call QWSServer::sendKeyEvent call() in
my console app. Will this event be passed on to, say, an already
running Qt GUI app instance (run with the -qws option)?

Please excuse if my questions sound n00bish! :) Thanks for your time.

Regards,
-mandeep



More information about the Qt-interest-old mailing list