September 19, 2011

Robert.W Robert.W
Lab Rat
11 posts

QComboBox > QListView

 

Hi. I am new to QT Qt and i have a Question:

I’ll put the subfolderfiles from the parentfolder, who is shown in the QComboBox, in a QListView..
The Box show the right path but i can’t find any way to get the subfolder to the ListView…

can sombody help me?

sorry for my english..

4 replies

September 19, 2011

cincirin cincirin
Ant Farmer
387 posts

Maybe QDir::entryList [doc.qt.nokia.com] is what you are looking for ?

September 19, 2011

Andre Andre
Area 51 Engineer
6031 posts

Really, I have no idea what you want to achieve. What are “subfolderfiles”? Are those entries in the file list that represent subfolders of the current folder? Or is that something else? And what is it exactly that you want do with that?

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

September 20, 2011

Volker Volker
Robot Herder
5428 posts

I don’t get exactly what you need, but it sounds like this thread [developer.qt.nokia.com] could be of use for you too.

October 6, 2011

Robert.W Robert.W
Lab Rat
11 posts

I’ve solved so…

  1. QDir dir;
  2. dir.setPath (ListDir);
  3.  
  4. for (int i=0;i<dir.entryList(QStringList("*")).count();i++){
  5.        QString fileName = dir.entryList(QStringList("*")).at(i);
  6.        ui->listWidget->addItem(fileName);
  7. }

thanks…

[EDIT: code formatting, please wrap in @-tags, Volker]

 
  ‹‹ Problem in displaying window?      [SOLVED] QDir setNameFilter problem, it does not filter ››

You must log in to post a reply. Not a member yet? Register here!