Questions tagged [qtreeview]

QTreeView is a class in Qt framework. It provides a default model/view implementation of a tree view.

A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the QListView class, but using the more flexible approach provided by Qt's model/view architecture.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

823 questions
-1
votes
1 answer

QTreeView: Do not update index if nothing has been typed

In a QTreeView if the user was editing previousIndex and hit TAB an editor is opened for currentIndex, the default behaviour is to open a blank textedit so that if the user immediately hits TAB again the cursor moves to nextIndex and the model…
Reimundo Heluani
  • 918
  • 9
  • 18
-1
votes
1 answer

QTreeView setStyleSheet has no effect

I want to set background color of a selected inactive item in a QTreeView using style sheet as follows: MyTreeView->setStyleSheet("QTreeView::item:selected:!active { background-color: rgb(150, 180, 220) }"); But the code has no effect in the tree…
Yarram
  • 115
  • 1
  • 11
-1
votes
1 answer

QT QTreeView Not Connecting itemSelectionChanged

I am trying to figure out why my signal isn't connecting, I have the following code: connect(mFileTree, SIGNAL(itemSelectionChanged()), this, SLOT(OnItemSelected())); Yet it doesn't fire. mFileTree is a QTreeView there is a function called void…
Jalomba
  • 25
  • 6
-1
votes
1 answer

pyside checkboxes editable

How can i make the checkboxes editable but not the Name field in the first column? import sys from PySide import QtGui, QtCore class Browser(QtGui.QDialog): def __init__(self, parent=None): super(Browser, self).__init__(parent) …
JokerMartini
  • 5,674
  • 9
  • 83
  • 193
-1
votes
1 answer

What is QT-Creator's equivalent to WinForms Dock-Fill?

I have a QTreeView widget placed inside a QDockWidget: I want to set the properties of the QTreeView, that it automatically fills the whole available client drawing area (similar as WinForms DockFill property). How can this be achieved with the…
πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
-1
votes
1 answer

select node from dynamic treeview

I am creating some treeviews at runtime and need to get value of the nodes that have been selected in one of these treeviews. How can I accomplish this. A google search did not return any useful answers.
-1
votes
1 answer

setModel on a QTreeView invalids previous model indexes?

I have a QTreeView to which I have attached a custom model. In my code, I do: treeView->setModel(modelPtr) ... ... ... treeView->setModel(modelPtr) Can I rely that after the 2nd setModel() call, the model indexes will remain same as after the…
Nishant Sharma
  • 341
  • 2
  • 5
  • 17
-1
votes
1 answer

QSortFilterProxyModel not showing 2nd column in QTreeView

I have inherited a class from QSortFilterProxyModel to support filtering of a hierarchical tree in my code. I have added code below of what I have done. After filtering is done, data in the 2nd column is NOT shown... I am not able to understand why…
Nishant Sharma
  • 341
  • 2
  • 5
  • 17
-1
votes
1 answer

.app files behaves like folder in Qtreeview on MAC

I am using QSortFilterProxyModel in QTreeView for exploring all the files and folders of a directory on MAC systems. Its working fine. but my problem is, In my Qtreeview, .app files also behaves like folders. means .app files also have an expansion…
Ashish
  • 219
  • 2
  • 6
  • 22
-2
votes
1 answer

Is it possible to add dict() or list() to insertRows() in QTreeView

I have this TreeItem: class QJsonTreeItem(object): def __init__(self, data, parent=None): self._parent = parent self._key = "" self._value = "" self._type = None self._children = list() self.itemData = data ... def…
Leonid
  • 34
  • 5
-2
votes
1 answer

How to get an current object (or data) when clicked a tree item

I use a QTreeView, I'd like to return an Item object (or data) instead of the item text when I click on the item in the TreeView For example, TreeView has an item named "Banana" |-Parent | |-Banana | |-Apple when I click on the item "Banana" I've…
Jiwon
  • 11
  • 2
-3
votes
1 answer

How to solve slowness of the dataChanged signal when adding a row to my QTreeView?

https://stackoverflow.com/a/22379130/21860235[the post 8 years ago][1] Hello, I would like to understand what is the trolltech modelest that he disabled in order to have a fast datachanged.emit(QModelIndex(), QModelIndex()) signal. I don't have a…
Thomas.C
  • 7
  • 5
1 2 3
54
55