Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
Posts: 16
Registered: ‎08-14-2012
My Device: blackberry 10 dev alpha
My Carrier: China unicom

How to use the function "entryList(); " which from QDIR class?

Hi:

    In the head file,entrylist function is described as below:

    

QStringList entryList(Filters filters = NoFilter, SortFlags sort = NoSort) const;


QStringList entryList(const QStringList &nameFilters, Filters filters = NoFilter,
SortFlags sort = NoSort) const;

 

    If I want to get all files‘ path in specified directory such as shared/video,what shoud I do?

Highlighted
Retired
Posts: 35
Registered: ‎08-01-2012
My Device: BB10 alpha-BB10 developer
My Carrier: T-Mobile

Re: How to use the function "entryList(); " which from QDIR class?

QT documentation seems have good description for QDir.

 

Did you have chance to look at it?

 

http://qt-project.org/doc/qt-4.8/QDir.html

 

 

when you try to get the list of all the files under "share/video", you can declare a QDir object:

 

QDir dir("/accounts/1000/shared/videos");

 

( Don't forget to request the permission for accessing the shared folder in the bar-descriptor.xml of your app)

 

then, you can use one of those two function to get the list.

 

Note: the above link provides the description about how to set "nameFilters", "filters", "sort".

 

Hope this helps.