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++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in QT
- qt c++ fonction converting adress to coordinates (longitude, latitude)
- Qml table and chart using python
- Qt: running callback in the main thread from the worker thread
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Frameless Qt + WinAPI maximized window size is bigger than the availableGeometry()
- new window with c++ qt
- How to get scaling from transformation matrix
- How to build just Qt core libraries from Qt sources
- doxyqml not documenting qml files properly
- Incorrect assignment from a QStringList to a char * array
- How to make QT Chart size larger than widget size?
- Queued async operations with QtConcurrent interfere QImage from freed
- Questions about qt5 dynamic link library
- how to document QML files inside C++ project?
- How do I keep my screen contents centered and also have a scrollbar in QT?
Related Questions in NOKIA
- How to Enable "Copy To SIM" feature in Nokia C12 Smartphone?
- UnsupportedOperationException: Sms is not supported, from SmsManager.sendTextMessage – where previously worked well in production
- list of Connected Devices on the Wifi Hotspot
- Is it possible to use existing SSH connection (which is created at Ansible playbook level) in custom module to execute a different set of action
- How to show camera options (e.g. zoom) when opening the camera within an app on a Nokia X10 with Android 12
- Ansible subtasks with dynamic hosts
- "Google Play Services for AR" listed as incompatible in Play Store for a compatible device, a Nokia 7.2
- Hi, when I try to run the following command: AT+CPMS="SM" (or any other memory) I get: cms error . Can anyone help me? Thanks
- How to get Nokia S30+'s MRE vxp file to run on nokia 225?
- How to Install by ADB on Nokia 6300 4G?
- having a problem using ttp while parsing a data which has similar template
- Creating old Nokia apps before JavaME support
- How to generate Hash passwords for SNMPv3 authentication and privacy settings on NOKIA SROS?
- How to modify checksum after making changes in Nokia 215 4G firmware?
- How do I develop a web app for Nokia 6230i?
Related Questions in QTREEWIDGET
- User interactions with column width in QTreeWidget
- How do I prevent a user from expanding a QTreeWidgetItem?
- PyQt6: Find element by path in QTreewidget
- How can I append directories with many subdirectories to a QTree from a list of paths?
- How to pass or retrieve (Mime) data when dragging/dropping a QTreeWidgetItem
- Drag and Drop between QTreeWidgets
- How do I remove Focus when I mouse-click on QtreeWidget?
- QTreeWidget, Subitem must not receive a subitem
- How to resize a QTreeWidgetItem when their widget is changed?
- PySide2 - Qt - Disable drag selection when using ExtendedSelection on QListWidget / QTreeWidget / QTableWidget
- What is the easiest way to set data of a QTreeWidget from a numpy array?
- QTreeWidget header column merging
- Drag and Drop TreeWidget
- Flash an active Qt tree widget item green
- Python QTreeWidget const columns
Related Questions in QTREEWIDGETITEM
- How do I prevent a user from expanding a QTreeWidgetItem?
- How can I append directories with many subdirectories to a QTree from a list of paths?
- How to resize a QTreeWidgetItem when their widget is changed?
- What is the easiest way to set data of a QTreeWidget from a numpy array?
- Flash an active Qt tree widget item green
- Iterating through QTreeWidget Items
- Qt QTreeWidget looping over top level items slows down after sorting
- Qt - Python - Adding icons to treewidgetitems
- Partially coloring text of QTreeWidgetItem
- Why are checkboxes showing through in qt (pyqt) QStyledItemDelegate for TreeWidget
- Pyqt5 QTreeWIdgetItem with select one item checkbox at atime
- PySide2: How to keep QTreeWidgetItem widgets?
- Fetch values from QWidgets added to QTreeWidgets via QTreeWidgetItems
- Extra row appearing in QTreeWidget PyQt
- Get selected item name from QTreeWidget PyQt
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 # Hahtags
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.