Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog doesn't list tty* files in /dev/ on Linux

QFileDialog doesn't list tty* files in /dev/ on Linux

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hazelnusse
    wrote on last edited by
    #1

    I'm working on a Linux desktop application that needs to open a USB serial port, typically /dev/ttyUSB0 or /dev/ttyUSB1. I'm using QFileDialog to let the user select the file:
    @
    QFileDialog dialog(this);
    dialog.setFileMode(QFileDialog::AnyFile);
    dialog.setFilter(QDir::System | QDir::AllEntries | QDir::Hidden);
    dialog.setViewMode(QFileDialog::Detail);
    QStringList fileNames;
    if (dialog.exec())
    fileNames = dialog.selectedFiles();
    @

    When I direct the FileDialog to /dev, none of the files that I can see by typing "ls /dev -al" are there. The directories show up, but for example, this file doesn't:

    @
    $ ls -al /dev/ttyS0
    crw-rw---- 1 root dialout 4, 64 2011-10-09 10:47 /dev/ttyS0
    @

    My user is a member of the dialout group:
    @
    $ groups
    luke adm dialout cdrom audio video plugdev users fuse netdev bluetooth lpadmin admin sambashare
    @

    I've tried adding QDir::Readable and QDir::Writable and the above file still doesn't show up. What am I doing wrong?

    ~Luke

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved