Well. I'm working on an IDE. Some of you maybe saw a post about it. Well, i have no clue of how QTreeWidget & QtreeWidgetItem works since can't find a demo and the documentation doesn't help. Well, what i'm trying to do is a IDE that you open the project file and then include all the files of the project to the tree. (Files in the project file are included by doing #include "filename"). How i do this? Then you click a file and open it in a Tab (That was on other question). So in this part i just need an example of how to do the file click. :)
QTreeWidget for Projects
1.1k Views Asked by Kazuma At
1
There are 1 best solutions below
Related Questions in C++
- C++ using std::vector across boundaries
- Linked list without struct
- Connecting Signal QML to C++ (Qt5)
- how to get the reference of struct soap inherited in C++ Proxy/Service class
- Why we can't assign value to pointer
- Conversion of objects in c++
- shared_ptr: "is not a type" error
- C++ template using pointer and non pointer arguments in a QVector
- C++ SFML 2.2 vectors
- Lifetime of temporary objects
- I want to be able to use 4 different variables in a select statement in c ++
- segmentation fault: 11, extracting data in vector
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- How can I print all the values in this linked list inside a hash table?
- Configured TTL for A record(s) backing CNAME records
Related Questions in QT
- C++ template using pointer and non pointer arguments in a QVector
- Using QPointer and QObject::connect with C++11
- qt How to style a QToolBar > QToolButton overflow button?
- Qt - Repeatedly write at beginning of file
- C++ Mongodb driver, not working
- deletion and cleanup of worker thread in Qt crashes
- How to drap item from QTableView to QPushButton?
- get image type from qimage
- C++ QT Getting part from QString
- How to connect a destroyed signal of C++ object from QML?
- How to get shader version from QOpenGLShader?
- Size of Qt QRadioButton able to get smaller, but not larger than default
- error WinSock.h has already been included Boost Windows Qt
- How to call a non-class member function with pointers as parameters with QtConcurrent::run?
- What is the difference between MinGW SEH and MinGW SJLJ?
Related Questions in NOKIA
- Nokia Asha SDK files
- Is it possible to get application from Nokia e5 device (Symbian S60, 3rd edition)?
- MapControl is empty? Windows phone 8
- Catch events from a TextField
- What are the basics concepts in Nokia Qt?
- getRequestCode on nokia J2ME
- Where can I download Nokia os?
- Symbian C++ Development Under Mac OS X
- Is there a way to programmatically identify the clear button on mobiles by using j2me?
- undefined reference to
- how to bind the values in to list view and table view in nokia qt?
- Qlibrary unload dll with carbide/nokia emulator
- Binding Array value in to listview control in nokia Qt?
- BlackBerry Problem with Browsing
- How to use Nokia Qt to launch another mobile application within an application based upon a MIME type?
Related Questions in QTREEWIDGET
- QTreeWidgetItem editing finished slot
- Disable only one item in QTreeWidget
- Python PyQt5 QTreeWidget sub item
- List folders with Qtreewidget in Qt c++
- PyQT which tree view to display changing data
- Qt4 QTreeWidget with VS2015 x64 win10
- Why does QtNetwork.QFtp.get download fail in a for-loop for multiple files?
- Qt QTreeWidget alternative to IndexFromItem?
- Draw on QTreeWidget With QPainter
- PyQt - get list of all checked in QTreeWidget
- which class need to be addressed to support drag'n drop between Qt app and finder
- Style hover and selected colors for arbitrarely chosen QTreeWidgetItems
- QTreeWidget Expanding individual Items from memory in C++
- QTreeWidget and QFileSystemModel
- popup menu on QTreeWidget on right mouse click with python
Related Questions in QTREEWIDGETITEM
- QTreeWidgetItem editing finished slot
- Python PyQt5 QTreeWidget sub item
- List folders with Qtreewidget in Qt c++
- Qt4 QTreeWidget with VS2015 x64 win10
- which class need to be addressed to support drag'n drop between Qt app and finder
- Style hover and selected colors for arbitrarely chosen QTreeWidgetItems
- QTreeWidget Expanding individual Items from memory in C++
- popup menu on QTreeWidget on right mouse click with python
- Using QTreeWidgetItemIterator in PyQT4 to return isChecked from QTreeWidget as a dictionary (or...something)
- Unselect in QTreeWidget PyQt4
- How to find the parent of item when clicked in empty space PyQt4 QTreeWidget
- QTreeWidget for Projects
- Retrieve QTreeWidgetItem object at drop event Pyside
- How to prepend a child item in qtreewidgetitem?
- How to properly show QIcon on a QTreeWidget child?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
A simple solution would be to directly use QTreeWidgetItem. For every file in your project, create an instance of QTreeWidgetItem:
Where "filename" is a string containing the name of your file. You can get the filename by parsing your project file looking for lines beginning with "#include".
By passing another QTreeWidgetItem in the constructor of a new item, you make the new item a child of the othe one. That way you can create directory structures.
To open a file, you can connect to the signal "itemDoubleClicked" of the QTreeWidget. You will get a pointer to the clicked widget item. Calling "text()" will retrieve the filename. If you have a directory structure, you need to do this too for all parent widget items. By concatenating the strings, you will get the path to your file.
You can find an example for this in the Qt Docs (see file settingstree.cpp)
As long as your IDE stays simple, this will be sufficient. A more flexible and "object-oriented" solution would be to create a subclass of QTreeWidgetItem. You will need to overwrite some methods. Since you probably only need read-only access the four methods described in the Qt Docs will be enough.