I'm using PyQt 4.4.
It's best shown using some pictures. All nodes should have leafs from 0 to 99. They are being incrementally loaded using canFetchMore() and fetchMore(). But for some reason unknown for me this works only for the root node. (Picture 1)
If I collapse and expand a node it loads additional 10 values. (Picture 2 & 3)
It...
Hi,
I've a simple question regarding the update of a QTreeView (or any subclass of QAbstractItemView) when a model object changes externally. Let's say that a list shows a subclass of QAbstractItemModel, and an item of that model gets changed outside of the list window, and we would like to update the list with the change. What is the u...
I would like to draw texts in one of the columns in a QTreeView widget using a custom color (depending on the data related to each row). I tried to overload the drawRow() protected method and change the style option parameter like this (a stripped-down example):
virtual void drawRow(QPainter* p_painter, const QStyleOptionViewItem& optio...
Hello,
I've got a slightly tricky problem to solve; imagine this:
One of my applications needs to make heavy use of scripting, so my idea was to provide the user a way to write script snippets and organize them in a directory-like tree structure. This is much like a source code directories with subdirectories and source files.
Data Cl...
Suppose my model has items with the following string for Qt::DisplayRole
<span>blah-blah <b>some text</b> other blah</span>
I want QTreeView (actually, any item view) to render it like a rich text. Instead, item views render it like a pure text by default. How to achieve the desired rendering?
Actually, this is a search results mod...
I have a QTreeView subclass (and QAbstractItemModel subclass) which has a nice horizontal header. I would like to add vertical headers (going down the left side) to match. But unlike QTableView which has separate vertical (setVerticalHeader()) and horizontal headers (setHorizontalHeader()), QTreeView only allows a single header (setHeade...
Hello, I'm using QTreeView with QDirModel like this:
QDirModel * model = new QDirModel;
ui->treeView->setModel(model);
ui->treeView->setSelectionMode(QTreeView::ExtendedSelection);
ui->treeView->setSelectionBehavior(QTreeView::SelectRows);
This works fine, however, I'm not sure how to get the details about the files I select. I've got...
Hi,
my question is about Qt and its QAbstractItemModel.
I have a map of strings and doubles (std::map<stringclass, double>) which I would like to present in a Qt widget. While I could use QTableView for that, I would like to exploit the fact that the keys of the map are of form "abc.def.ghi" where there can be multiple strings that c...
I want the top header to span on 2 or 3 bottom header column.
Is there a way to do so in Qt c++?
I'm looking for an exemple.
thank you.
...
I have a QTreeView with data that changes over time, with a dataChanged signal being emitted in the QAbstractItemModel every second. The items in the QTreeView can be edited as well, but when a editor is opened for a certain item the editor string is updated while I edit is, which is very annoying. Any way to prevent an editor to be upda...
My Google skills must be failing me today.
I've inherited from QTreeView to create a TreeView that stores a QStandardItemModel instead of a QAbstractItemModel. I have also inherited from QStandardItem to create a class to store my data in an item as is necessary.
I've successfully inserted my derived QStandardItem into my derived QTree...
I'm writing a simple test program using QTreeModel and QTreeView for a more complex project later on. In this simple program, I have data in groups which may be contracted or expanded, as one would expect in a QTreeView. The data may also be sorted by the various data columns (QTreeView.setSortingEnabled is True). Each tree item is a lis...
I've written a descendant of QTreeView with multiple columns. I want to create a popup menu that appears whe nthe user right-clicks over the column headers. I have tried catching signals from QTreeView for this, but QTreeView doesn't seem to emit signals on the headers. QTreeView.header() does. I therefore believe I must either:
1: conne...
I have a custom subclass of a QTreeView in a pyqt application. I'm trying to give the user the ability to highlight and "lowlight" (for lack of a better term) rows. Highlighted rows should have bold text and (optionally) a different background color. Any ideas?
I'm considering StyleSheets as an option, but have so far been unable to get ...
I'd like to be able to deselect items in my QTreeView by clicking in a part of the QTreeView with no items in, but I can't seem to find anyway of doing this. I'd intercept a click that's not on an item, but the QTreeView doesn't have a clicked signal, so I can't work out how to do this.
...
Hello.
I'm testing QTreeView functionality right now, and i was amazed by one thing. It seems that QTreeView memory consumption depends on items count O_O. This is highly unusual, since model-view containers of such type only keeps track for items being displayed, and rest of items are in the model. I have written a following code with ...
Hi.
What I have:
QTreeView class with table data
And connected QAbstractTableModel model
Question: how to save expanded state of items? Is some one have finished solutions?
PS: I know, that I can do this code by myself, but I don't have much time, and this is not the major problem of our project, but still we need it, because app ...
I would like to build a dialog similar to QFileDialog::getExistingDirectory() for which the OK-button only is enabled when the selected directory contains certain files.
I know I cannot achieve this with QFileDialog, instead I would have to come up with my own QDialog that has a QTreeView coupled to a QFileSystemModel.
How can I limit...
Hey all,
I'm using Qt 4.7.0, a Qtreeview with multiple columns.
What I want to do is "simple" : I want a line to increase its height, when it's selected.
Will delegates be enough to do this ?
I've been through some stuff with a QTableView :
m_pMyTableView->verticalHeader()->setResizeMode(QHeaderView::Interactive);
...
QSize Abstrac...
How do i set a custom background color for certain rows in a QFileSystemModel applied on a QTreeView?
...