PDA

View Full Version : Set hidden attribute to a folder in the Windows system file



xelag
8th October 2007, 22:18
I can't find a way to set the attribute "hidden" to a folder or to a file. I try to find out with QDir, QFile and QFileInfo. But no success.

The only thing I find about the use of hidden file, is the use of filter for listing a folder with QDir.entrylist(..filters..).
But there is no function like QDir.setAttribute(Qt::Hidden | Qt::ReadOnly) which would make a folder become hidden.

Can someone help plz?
Thx,
Xelag

jpn
27th October 2007, 16:00
I'm afraid Qt cannot help you with this. You might have to rely on platform dependent code, see SetFileAttributes() (http://msdn2.microsoft.com/en-us/library/aa365535.aspx).

xelag
27th October 2007, 18:16
Thank you for your answer. So, I will use Windows API.