QFileInfo directory name

Although it is called QFileInfo, QFileInfo not only handle files but also directories. This function is often used to traverse all items under a directory including files and sub-directories.

QFileInfo::fileName() returns the name of a file or a directory(no ending slash). The special cases are . for current dir and .. for parent dir.

QFileInfo::filePath() returns the dir+name of a file or a dir(no ending slash).

Even you use Qdir::setFilter(QDir::Files), QDir::entryInfoList() also returns the list that include . and ..

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Comments are closed, but trackbacks and pingbacks are open.