Questions tagged [qtableview]

QTableView is a Qt class providing a default model/view implementation of a table view.

A QTableView implements a table view that displays items from a model. This class is used to provide standard tables that were previously provided by the QTable class, but using the more flexible approach provided by Qt's model/view architecture.

QTableView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.

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

1244 questions
0
votes
2 answers

CSS set QTableView background color?

I want to set the background color of all cell in a QTableView Object using css. something along the lines of... ui.tableView->setStyleSheet("QTableView { background-color: red; color: yellow"); Is this possible? If so how would I do it?
andre
  • 7,018
  • 4
  • 43
  • 75
0
votes
1 answer

QStandardItem inserting rows in a weird way

i am creating a table and uinserting the row in it like this.only one row is inserted in the table and that too conditional and if condition isnt satisfied than an error is shown. the problem is that when a row is inserted on satisfying condition…
Mcolorz
  • 145
  • 1
  • 5
  • 20
0
votes
1 answer

(Qt) How to implement editorOpened(index) and editorClosed(index) signals in a view

I've coded myself into a corner sort of with my data abstraction scheme and it's resulted in my needing editorOpened(QModelIndex) and editorClosed(QmodelIndex) signals in my views (QTableView almost exclusively). The reason being that my data…
0
votes
2 answers

Qt & SqlAlchemy - Qtableview

Ok - taking baby steps toward a very simple MVC app using pyside and sqlalchemy... such baby steps that I've got stuck on step #1! I want to populate a QTableView with data. Should I be using QSqlTableModel or QStandardItemModel or…
Steven Lee
  • 179
  • 2
  • 14
0
votes
1 answer

How create a qcombobox in a tableview in Java?

I have a tableview (model) with 5 columns. In one of them, I want to show 2 options in a combobox. The options are predetermined, so I think that the use of delegate is not necessary. Am I wrong? for (int state=0; state <3; state++) { …
0
votes
1 answer

Reimplimenting insertRows in a table's DataModel

I'm trying to implement a insertRow function (very similar to the overridableinsertRows). This is what I've done: def insertRow(self, row_data, parent=QtCore.QModelIndex()): self.beginInsertRows(parent, self.rowCount(), self.rowCount()) …
iTayb
  • 12,373
  • 24
  • 81
  • 135
0
votes
1 answer

QTableView does not refresh foreign keys?

I have a QMainWindow with two QTableViewson it. Each QTableView has its own QSqlRelationalTableModel. I am using OnManualSubmit as the edit strategy for both models. Both models hit the same database, and are populated using setTable (each hits a…
David Burson
  • 2,947
  • 7
  • 32
  • 55
-1
votes
1 answer

How do you selcet the specific cell in a QTableView

In Python, using a QTableView how do I get a specific cell and how do I set the current cell.
QuentinJS
  • 162
  • 1
  • 9
-1
votes
1 answer

issue with update shown values in a pyqt5-applet (using qtableview)

I want to make a qtableview widget correctly updating. I'm working on a calibration applet, where i wanna fill cell by cell of an (e. g.) 100 x 100 x 4 array. If my hardware reaches position 1, 2, 3, and so on, I will trigger a voltage measurement…
El_Mo
  • 1
  • 2
-1
votes
1 answer

Sort Arrows Disappear When Subclassing QHeaderView

I am subclassing QHeaderView to add a filtering icon in the horizontal header of a QTableView. The QTableView has sorting capability activated consume a QSortFilterProxyModel, until now it works fine. However when I try to subclass QHeaderView and…
user2019716
  • 587
  • 4
  • 13
-1
votes
1 answer

HTML renderer for QTableView - what's happening to the font size?

This answer (updated by me from other answers there) to a question about how to render HTML in a QTableView certainly seems to produce a marked-up text look. But there's a problem with the font size. See this MCE: column 0 uses the standard paint…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
-1
votes
1 answer

How to share a selection between table views?

I am writing a Qt C++ app to show byte values and its hexdump right next to it. For that I am creating a new dialog, I have 2 QTableViews(each for byte representation or hexdump) and 1 class which inherits from QAbstractTableModel and 1 class which…
Peter
  • 57
  • 1
  • 7
-1
votes
1 answer

Control display of gridlines and borders in header of QTreeView

(W10 platform) What I'm trying to get (I was asked to produce a target outcome, with Gimp): What I currently get: MRE: from PyQt5.QtCore import QRect, Qt, QAbstractTableModel from PyQt5.QtWidgets import QApplication, QMainWindow, QTableView,…
mike rodent
  • 14,126
  • 11
  • 103
  • 157
-1
votes
1 answer

QTableView, glitch on showing hidden rows

I'm not sure either it's some kind of bug\glitch or I'm doing something wrong. I have some hidden rows in the table and on click I want them to appear but result you can see on the picture below. This effect occurs only when slider is scrolled…
JuicyKitty
  • 318
  • 1
  • 16
-1
votes
1 answer

Find a value in QTableView

I'm trying to find the row where a value is stock in a QTableView. I had use QString select = ui->tableView->model()->index(row,0).data().toString(); to collect the value. Now i want the exact opposite, like an indexOf() but i can't find it in the…
Nakila_br
  • 5
  • 3
1 2 3
82
83