[Qt-interest] QFileDialog and UNIX device nodes

David Boosalis david.boosalis at gmail.com
Sun Jul 25 03:41:44 CEST 2010


for linux . I 'd use a USB to Serial converter cable, In fact you have to
use this on most modern computers as they don't even have serial ports
anymore.  The only down side to this kind of USB to Serial cable is the
extra cost, but its probable less then $12 dollars, and you get a lot of
benefits from this. Like getting dbus notifications as to when and where it
is plugged in.  KDE's Solid API provides very high level classes for getting
this kind of events. It is very good at telling you want was plugged in
(Storage card, printer, USB Serial cable).  If you don't want to use KDE and
Solid, it is still worth using this kind of USB cable.  You can learn about
what is being plugged in just using Qt tool "qdbusviewer", and the Linux
desktop tool "dbusmonitor".  So if you have a choice use the USB interface,
the plain serial interface is jut to brain dead to give you any
notifications of something hotplugable.

Regardless, the QFileDialog seems like an over kill.  I mean whether you use
Serial or USB-Serial you only have to have a combox filled with at most
three or four choices (ttyS0,ttyS1, ...) or (USBtty0,USBtty1). If it is a
bar code reader your probable not going to be able to open it like a normal
file, but will have to do some ioctl setting (8-N-1).

 Sorry I don't know about Macs, maybe there is DBUs for macs, or it has its
own API.


-David


On Wed, Jul 21, 2010 at 2:49 PM, Jeffery MacEachern
<j.maceachern at gmail.com>wrote:

> A friend and I are working on a GUI application that can be used for
> rapid testing of a library he's working on, as well as testing the
> hardware the library communicates with.  As part of the connection
> process, the user is presented with a QFIleDialog to select the serial
> port that the device is connected to.  We are currently using a filter
> of "*".  Is there a smarter way to do this on Linux/UNIX/OS X?  If
> possible, it would be really nice if we could filter on character
> devices, for example.  I assume QFileDialog doesn't have that sort of
> platform-specific granularity, though.
>
> Ideas?
>  - Jeffery MacEachern
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100724/7e48ffc9/attachment.html 


More information about the Qt-interest-old mailing list