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 doesn't assign twice
Forum Updated to NodeBB v4.3 + New Features

QDir::entryList doesn't assign twice

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.5k 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.
  • K Offline
    K Offline
    Kaijun
    wrote on last edited by
    #1

    I tried to get file list by QDir::entryList, but I found QDir::entryList returns empty list at the second time. Here is example,

    QDir dir1("aaa");
    QDir dir2("bbb");

    QStringList files;

    if (!dir1.exists())
    return;

    files1 = dir1.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot);
    .
    .
    .

    if (!dir2.exists())
    return;

    QStringList files2;
    files2 = dir2.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot);

    In this case files1 is O.K. but files2 is empty. If I use following way, it works.

    files2 << dir2.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot);

    I just wonder why the second assign doesn't work.

    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