Hi , How to force delete a file or folder using Qt ??
With administrator permissions ...
Hi , How to force delete a file or folder using Qt ??
With administrator permissions ...
You can delete files and directories with a combination of QFile::remove(), QDir::remove() and QDir::rmdir().
If you require Windows to elevate privileges then you must use the Windows APIs to achieve that.
http://stackoverflow.com/questions/2...indows-api-c-c
AFAIK, no. There is no object in Qt which would pop up a "password" dialog and (if answered correctly) give you root priviledges. Because some apps can do that, there should be a way of writing such object yourself. The object will depend on the operating system (windows, Linus, etc.)
-------------------
[Edit] ChrisW67s link contains a way of doing it under windows.
Last edited by Radek; 22nd July 2015 at 17:16.
The necessary mechansims/functions are builtin in to every copy of Windows since Vista, they are fully documented, widely used, utterly non-portable, and frankly ugly. They are, nonetheless, the better way because the alternative is that Windows stayed the wide-open malware magnet its original design made it.
Bookmarks