PDA

View Full Version : On item Click in QTreeWidget - to open location of the file in the system in mac



merry
18th October 2010, 12:11
hi

In treewidget, I am displaying list of all the application files in my system and also there path. On click of item in the QTreeWidget , i want to open the location of that app file in my system with that app file selected on that location.

For this I used


QDesktopServices::openUrl(QUrl("file://"+itemPath));

by using I will be able to open the location of that selected item from treeWidget in the system, but that item is not selected at that location. Is there any why to open the location with the item selected.

Lykurg
18th October 2010, 14:19
How do you detect the selected item and how do you get the path so far?

merry
19th October 2010, 06:33
How do you detect the selected item and how do you get the path so far?

The item(name of the Application) that is being clicked in QTreeWidget is the selected item, and in another column i stored path of that item (the path of the Application).