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
4
votes
3 answers

How to insert child into QTreeWidget hierarchy?

Consider I have QTreeWidget with following items hierarchy: top_item |--child Every item has assigned with setItemWidget() widget. I need to insert another child between my first two elements like this : top_item |--another_child …
MaxNes
  • 81
  • 1
  • 1
  • 5
4
votes
2 answers

PyQt: get the current QTreeWidget item

I presently have a QTreeWidget named 'treeWidget', and for the life of me, cannot figure out how to get the index value or the text of the selected treeWidget branch. self.treeWidget looks like: User -Inbox -Sent -Drafts -Trash I need to know which…
Ang
  • 43
  • 1
  • 1
  • 3
4
votes
3 answers

add checkbox to qtreewidgetitem

i want to add a check box to my qtreewigetitem, i tried this code to setflag, then i add item is selectable for sake of maybe this will solve my problem but nothing happened, would you please help me how can i add check box to my item? thank you in…
mari
  • 417
  • 1
  • 6
  • 21
3
votes
1 answer

QTreeWidget::currentItem What returns when there is nothing selected?

I am a student programmer using Qt to develop a GUI application. I am using a QTreeWidget to display some properties stored in a vector. In the same window I have the buttons edit, copy, and delete. So far the buttons work to do what they need to;…
Wylie Coyote SG.
  • 1,009
  • 6
  • 22
  • 37
3
votes
1 answer

How to add a QTableWidget into a QTreeWidget but as a QTreeWidgetItem

I am designing a major interface but had a problem on how to add a QTableWidget into a QTreeWidget but as a QTreeWidgetItem. In order to save everyone's time and provide the best information, below an example that replicate exactly the problem I…
EsoMars
  • 337
  • 3
  • 14
3
votes
1 answer

Disable a column of a QTreeWidgetItem or remove set CheckBox

I have QTreeWidgetItem set in a QTreeWidget with 2 columns. Both cells got a CheckBox set by setCheckState(...). When the user unchecks the CheckBox in my first column I uncheck the second CheckBox in column 2. Now, I would like to prevent the user…
3
votes
2 answers

QTreeWidget catch item editing finished with no text change

I'm developing a Qt application with QTreeWidget on Qt Designer form. User can press add-new-item button and new item will appear with default name, after that user must enter item's name. So this is my code: void…
serg.v.gusev
  • 501
  • 4
  • 13
3
votes
0 answers

highlighting items of treewidget on mouseover

I do have an app with a treeWidget supporting Drag n Drop. I'm trying to highlight an item during the drag'n drop action. When dragging a file and before dropping it, I would like to highlight the destination item. void…
Seb
  • 2,929
  • 4
  • 30
  • 73
3
votes
1 answer

How to remove an icon in a QTreeWidgetItem?

I have a QTreeWidget with QTreeWidgetItems and sometimes the items have an icon. So I set the icon using: self.setIcon(0, icon) But how do I remove that icon again? self.setIcon(0, None) gives TypeError: 'PySide.QtGui.QTreeWidgetItem.setIcon'…
Goswin von Brederlow
  • 11,875
  • 2
  • 24
  • 42
3
votes
2 answers

set subchild not to indent in qtreewidget when I expand them

I have a QTreeWidget and I want children of a QTreeWidgetItem not indent when I expand them. I want to set the line only for top items. The first screenshot demonstrates what I would like to have, and the second what I am currently having. Would you…
mari
  • 417
  • 1
  • 6
  • 21
3
votes
3 answers

Remove space from QLabel in a QTreeWidget

I've added QLabel widgets to my QTreeWidget to work around the word wrapping issue in QTreeWidget. (see how to word wrap a QTreeWidgetItem). The QLabel widgets appear to have spacing around the text which for some reason disappears when the text…
Jason
  • 1,098
  • 12
  • 33
3
votes
2 answers

Using QTreeWidgetItemIterator in PyQT4 to return isChecked from QTreeWidget as a dictionary (or...something)

Check the edit for final code! So...I'll admit that I'm drawing an absolute blank here due to lack of knowledget and will just present my code and pray a little bit. Using this fantastic xml to QTreeWidget generator that ekhumoro coded I've added in…
Amdingo
  • 100
  • 1
  • 8
3
votes
1 answer

QTreeWidgetItem display html

I would like to have a QTreeWidgetItem display formatted html.(PyQt) Has anyone successfully managed this? htmlString = r"BoldText:SomeValue" item = QtGui.QTreeWidgetItem( item, [htmlString], 0) Any help greatly appreciated!
tranimatronic
  • 201
  • 2
  • 7
3
votes
2 answers

Displaying a tooltip for QTreeWidgetItem when it's hovered without calling setTooltip() for every item

I want to display a tooltip for QTreeWidgetItem that's hovered. However, getting a tooltip is not a very fast process in my case, so I don't want to call setTooltip() for every single item. I want to do it on demand, on some event or signal. What's…
Violet Giraffe
  • 32,368
  • 48
  • 194
  • 335
3
votes
1 answer

QTreeWdiget adding child element at specific location

I am trying to build a tree in a way that I can insert the element where I want. This is my tree in its initial stage: +Project +--Version 1.0 +--Version 2.0 Now, let's suppose I made a Version 1.1 and I would like to add it at the location…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
1
2
3
14 15