Hi, sorry i searched this in net but i fund nothing! how can i open a folder in Qt?
for example in this path:"c:\newfolder" I want to open "newfolder" folder by clicking a PushButton.
Hi, sorry i searched this in net but i fund nothing! how can i open a folder in Qt?
for example in this path:"c:\newfolder" I want to open "newfolder" folder by clicking a PushButton.
Do you want to open the folder in the system's file manager? If so, QDesktopServices::openUrl() looks promising.
Alex22 (8th January 2016)
this is exactly that i want. last question: i need also if "newfolder", in path "c:\newfolder", is not exist then first create "newfolder" and then open it and if it is exist, only open it.
thanks for any help
Have a look at the QDir class. It has a method that creates a path.
Alex22 (8th January 2016)
@yeye_olive, Thanks
I fund this:
Qt Code:
//To create "newfolder"To copy to clipboard, switch view to plain text mode
I hope you understand that your "solution" only works if you want to examine or create something in your current working directory. The QDir() constructor with no arguments returns a QDir instance pointing to the current working directory.
Alex22 (9th January 2016)
Bookmarks