PDA

View Full Version : Display a file from Directory tree to show in QTextEdit



vvdounai
13th November 2007, 12:24
Hello, everyone!

I have a program, it is a txt file reader. The splitter split the GUI with left side directory tree and right side textedit area.

I want to use a directory tree to display the folders and files in the local system. when I double click one of a txt file (an iterm in the directory tree), the QtextEdit will display its content.

However, I don't know how to do it ? firstly, which view should I use, QTreeView or QTreeWidget? secondly, how should I emit the signal ?

Thanks and sorry for my poor English.

DeepDiver
13th November 2007, 13:43
Have a look at this example provided by Trolltech:http://doc.trolltech.com/4.3/itemviews-dirview.html