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. QDir.entryList
Forum Updated to NodeBB v4.3 + New Features

QDir.entryList

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 350 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.
  • J Offline
    J Offline
    jamat13
    wrote on last edited by
    #1

    I'm trying to get a list from /sys/class/video4linux but my list is empty.
    I do set the QDir:Files | QDir::System in the QFile call and in the entryList call but my list remains empty. Surely there is a way ...

    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by Paul Colby
      #2

      Hi @jamat13, it would help if you can show us your code.

      However, at a guess, I'd say you need to include QDir::Dirs too, because that directory (at least on my distro) contains only symlinks to directories. So I would try QDir::AllDirs|QDir::AllEntries|QDir::System to start with, and work back from there. If that doesn't work, show us the relevant QDir code :)

      Edit: did a quick test. Here's some sample code, and the resulting output, at least for my host (Ubuntu 22.10):

          const QDir dir(QStringLiteral("/sys/class/video4linux"));
          qDebug() << dir.entryList();                                // (".", "..", "video0", "video1")
          qDebug() << dir.entryList(QDir::Files|QDir::System);        // ()
          qDebug() << dir.entryList(QDir::Dirs);                      // (".", "..", "video0", "video1")
          qDebug() << dir.entryList(QDir::Dirs|QDir::NoDotAndDotDot); // ("video0", "video1")
      

      Cheers.

      1 Reply Last reply
      1
      • J Offline
        J Offline
        jamat13
        wrote on last edited by
        #3

        Paul thanks, I was being an utter dork, ofcourse they are directories not files

        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