Questions tagged [qabstractitemview]

The QAbstractItemView class provides the basic functionality for item view classes.

The QAbstractItemView class provides the basic functionality for item view classes.

QAbstractItemView class is the base class for every standard view that uses a QAbstractItemModel. QAbstractItemView is an abstract class and cannot itself be instantiated. It provides a standard interface for interoperating with models through the signals and slots mechanism, enabling subclasses to be kept up-to-date with changes to their models. This class provides standard support for keyboard and mouse navigation, viewport scrolling, item editing, and selections.

Reference: http://qt-project.org/doc/qt-4.8/qabstractitemview.html

44 questions
0
votes
0 answers

how to disable button of one item when other item is clicked in a row in gridlayout

I want, that when the user click on the button of left item, certain function happens and the button on the right got disable, same vice versa with other button on the right. Videoview is inside the recyclerView, placed with the help of…
0
votes
3 answers

How to not get changed-signals to be emitted when setting the current-index in QAbstactItemView?

I'm programmatically changing the selected item with setCurrentIndex() of my Tree- and TableViews. If the current item has changed, a multitude of signals are emitted (currentChanged(), currentColumnChanged, etc). I'm listening to some of these…
Patrick B.
  • 11,773
  • 8
  • 58
  • 101
0
votes
0 answers

How to get a Cell's coordinates in the delegate's painter by index/ column/row?

Note, I'm not asking about the current cell. I'm asking about getting some OTHER cell's position by row and column. I've set a delegate for my Qtableview to handle graphics. Inside my paint (self, painter: QPainter, option, index: QModelIndex): I…
0
votes
0 answers

With a QTreeView (or QAbstractItemView) open dialog on item activated, or edit item on single click

I'm trying to create behaviour in my program similar to windows file explorer, where double clicking (or pressing enter on the keyboard when it's selected and in focus) on an item in my QAbstractItemView will "open" that item in a new window, and…
Dan Forever
  • 381
  • 2
  • 12
0
votes
1 answer

QTreeView with custom item delegate with Browse button

Working with the Qt5 framework (via pyQt5 with Python), I need to create a QTreeView widget with Parameter - Value columns, where the Value items for some rows must have an internal 'Browse' button to open a file browse dialog and place the selected…
0
votes
2 answers

How to hyperlink to an item in a QAbstractItemModel?

Qt versions used: 4.7.1 and 4.8 I store hierarchical data as nodes in a model that is derived from QAbstractItemModel. I have a QTreeView in my application GUI to display the hierarchical data. (The data being hierarchical may not be essential…
Mike Finch
  • 746
  • 1
  • 7
  • 20
0
votes
0 answers

Minimum vertical size of a collapsed QTreeWidget is too large

I have a QScrollArea with a number of QTreeWidgets in it arranged into QVBoxLayout. Each tree widget has a single top-level item (but hierarchy of child items is arbitrary). Vertical scrollbars of individual tree widgets are disabled via…
Maximko
  • 627
  • 8
  • 20
0
votes
0 answers

How does QAbstractItemView know about my custom roles when emitting dataChanged() with no roles?

On receipt of the signal QAbstractItemModel::dataChanged(), the connected QAbstractItemViews will call the QAbstractItemModel::data() method to update their data. The user defined data() method should give different information based on both…
0
votes
1 answer

QTreeView Edit UserRole Instead of DisplayRole Upon Double Click

In my project, I have a QTreeView displaying items from a QStandardItemModel. Each item has data stored in several UserRoles. QStandardItem* item = new QStandardItem(); item->setIcon(iconByte); item->setData(3, Qt::UserRole+1); item->setData(name,…
mrg95
  • 2,371
  • 11
  • 46
  • 89
0
votes
0 answers

QAbstractItemView selectAll slow

I have a QTableView with around 10k entries. When I call QAbstractItemView::selectAll it takes about 5secs to complete. The performance otherwise is OK. Why is the selection so slow? and is there something I can do to speed it up?
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
0
votes
1 answer

Qt,QListView Model

I want to set background color for selected row from my listview model.After select another row,the color of previous row is make transparent.Thanks! QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override { if…
paulc
  • 125
  • 6
0
votes
1 answer

Selected Item losing Highlight in QTableView

I have a problem with the extendedSelection of my QTableView. The Problem is that i have some whitespace around my columns and rows and when i click this whitespace the highlighting of my selected Fields is lost. Its not ocurring when i click…
solove
  • 1
  • 1
0
votes
2 answers

Item is selected but isn't highlighted

I work with Qt/C++, and I have a QListView to display icons on screen. I set the QListView::iconMode to display it as icon view. But I cannot see that it is selected(but it is selected) it doesn't highlights. However it works for list mode. I have…
tokafr
  • 109
  • 2
  • 12
0
votes
1 answer

Catch item creation moment in QTreeView to set custom widget

I have custom model inherited from QAbstractItemModel and custom view inherited from QAbstractItemView. Model is a wrap on data organized as a tree. When model is changed it emits neccessary signals to notify view about changes. View has default…
GLaz
  • 295
  • 1
  • 11
1 2
3