Questions tagged [qtreewidgetitem]

The QTreeWidgetItem class, part of the Qt framework, provides an item for use with the QTreeWidget class.

Documentation can be found here (Qt4) and here (Qt5).

219 questions
3
votes
1 answer

Formatted text in QTreeWidgetItem

I need to create QTreeWidgetItems which have support for formatted texts, such as: MyCreatedType - INTEGER(1) (ie: the line above should have a "normal" part : MyCreatedType and a "formatted" part (INTEGER(1) in our case). Any idea how to accomplish…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
2
votes
1 answer

QTreeWidget Passing multiple Items (more then one selection) through a function

I am a student programmer using Qt to build a GUI for work. I have ran into an issue; more or less and inconvience of sorts wiith multiple selections in the QTreeWidget. My GUI has a main interface with a QTreeWidget as the central item in this…
Wylie Coyote SG.
  • 1,009
  • 6
  • 22
  • 37
2
votes
2 answers

QTreeWidget and PyQt: Methods to save and read data back in from file

I'm working on a project that contains a QTreeWidget. This widget will have Parent nodes with childs nodes and or other siblings nodes. Attached to each node will be a unique ID in the form of an integer as well as a name. Now..... what methods…
thedax
  • 131
  • 1
  • 5
2
votes
1 answer

How to resize a QTreeWidgetItem when their widget is changed?

I have made a custom QTreeWidget class to make a kind of collapsible list of widgets. Now when I change the widget in one of the section, let's say from a short widget to a taller one, the size does not update to respect the taller widget's…
Sepand.S
  • 25
  • 1
  • 5
2
votes
2 answers

qt 4.7 removeChild() and memory

Im writing a c++ qt application. In one part I'm creating a QTreeWidget. The user has all possibilities to create and delete entries in that tree. So when the user creates a item he will call a function which then itself calls: QTreeWidgetItem*…
Donny
  • 549
  • 2
  • 10
  • 24
2
votes
1 answer

Editing QTreeWidgetItem while retaining file extension

I have a QListWidget that contains filenames. Right-clicking on an item brings up a menu which contains a Rename... item. Clicking on Rename... lets the user edit the filename. So far so good. But in the Qt Creator Projects window, right-clicking on…
TonyK
  • 16,761
  • 4
  • 37
  • 72
2
votes
1 answer

Drag and Drop Data among multiple QTreeWidget

I have a number of QTreeWidget. Here, there are two trees. the left one has "a" , "b". I want to drag this item into the right tree. I have no error but the item become empty. How should I do for dragging the left data to the right tree? and…
Haru
  • 1,884
  • 2
  • 12
  • 30
2
votes
2 answers

How to set a string property to QTreeWidgetItem?

I have a list of application specific items uniquely identified by an id. Their names are displayed in a QTreeWidget (one item corresponds to a single QTreeWidgetItem). I would like to somehow attach the corresponding ids to these QTreeWidgetItems…
pseudomarvin
  • 1,477
  • 2
  • 17
  • 32
2
votes
1 answer

QTreeWidgetItem setting not selectable clears the selection

I have a QTreeWidget and I want certain rows to be non select-able, which can be achieved by QTreeWidgetItem::setFlags(treeWidgetItem->flags() & ~Qt::ItemIsSelectable). The problem is that I have an existing row that is already selected and later I…
santahopar
  • 2,933
  • 2
  • 29
  • 50
2
votes
1 answer

Pyqt5 QTreeWidget CurrentItemChanged signal sending integers as previous item

I've got a QTreeWidget item and the signal CurrentItemChanged connected to a method that updates the GUI based on a DB lookup. The CurrentItemChanged documentation says it will pass QTreeWidgetItems as arguments to the method. First the current…
bythenumbers
  • 155
  • 1
  • 3
  • 10
2
votes
1 answer

QTreeWidgetItem.addChild() doesn't work in some cases?

I'm having trouble with adding a child to a top-level item in a QTreeWidget. I have a QTreeWidget in which the user can click a button to add items called "steps". It contains only two levels and is presented as in the following example: -…
Gnahahaaa
  • 23
  • 7
2
votes
2 answers

how to convert a list of directories and files from normal list into a tree list using python & PyQt5

i am using python and PyQt5 library in order to display the list of directories and files existing in a required path. where the user choose the desired folder and the program create a list that holds all the existing folders and sub_folders and…
Pyt Leb
  • 99
  • 2
  • 10
2
votes
1 answer

How to populate QTreeWidget from tuple?

I'm pretty new to Python so please bear with me. I'm trying to populate a QTreeWidget from a tuple, but I can't seem to get it too work. TreeList = ({ 'Header1': (( 'Item1', 'Item2', )), 'Header2': (( 'Item1', …
artomason
  • 3,625
  • 5
  • 20
  • 43
2
votes
1 answer

Python PYQT QTreeWidgetItem selected cell

I have QTreeWidget like this What should i do to get value from selected row and filename column ? I have current selected item item = self.ui.files_treewidget.currentItem() but how to access to specific cell?
RogerZ
  • 61
  • 1
  • 2
  • 3
2
votes
1 answer

Modify default widget text color with applied stylesheet of QTreeWidget items

I have a QTreeWidget (however this question relates to any kind of widget) in which I have items which, under certain circumstances change their foreground color to red using item.setForeground(0,QBrush(QColor("red"))). Later they can change their…
1 2
3
14 15