Varun Chitre
Varun Chitre

Reputation: 3220

Opening a specified folder in Qt

Hello can anyone tell me how can I open a specified folder in Qt?

Suppose in a lineEdit I define the folder path like

D:/MyFolder

Then how can i open this folder using push button? What should I use for that?

Upvotes: 0

Views: 151

Answers (1)

alexisdm
alexisdm

Reputation: 29896

You can use:

QDesktopServices::openUrl(QUrl::fromLocalFile(yourFolderPath));

inside a slot connected to you button.

Upvotes: 1

Related Questions