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

QSqlRelationalTable How to display value from other table in a column with foreign key?

I have a SQLite database with three tables: graph(ID int primary key, name varchar(64)); vertex(ID int primary key, graphID int references graph(ID), name varchar(64), x int default 0, y int default 0); edge(ID int primary key, graphID int…
-1
votes
1 answer

QTableView get value from hidden column

I've felt into a problem: my task is getting from SQL-database some data ex (SELECT id, name, last_name FROM users); Then i want to display this data in QTableView: QSqlQueryModel *model = database->fetchAll(SELECT id, name, last_name FROM…
Joe Dea
  • 29
  • 2
  • 7
-1
votes
1 answer

How to programmatically pass QLineEdit content into QTableView rows using QPushButton

I am trying to programmatically pass the content of a QLineEdit into rows of a QTableView using a QPushButton. I was wondering if there is anyone who can provide some guidance on how to do that. Basically this is the initial situation: and this is…
Emanuele
  • 2,194
  • 6
  • 32
  • 71
-1
votes
1 answer

Qt doubleClicked event emitted twice

I have a QTableView with a QAbstractview with only one column. I assigned the double click event to the QTableView which calls a function that prints the selected value. The strange thing is that when there is only one record in the table it works…
dhirczy87
  • 33
  • 1
  • 7
-1
votes
2 answers

QTableView with QStandardItemModel: How to perform live updates during editing a cell?

Recently, I made the switch to QT. It has taken some time, but I am starting to find my way around. However, one issue remains: I want to port a program, that responds to every key press while editing a cell in a table view (QTableView with…
mvanlint
  • 61
  • 1
  • 2
-1
votes
1 answer

Copy a Qtablewidget to word

I'm a new user of Qt and I hope that you can help me. I want to copy a selected part of table from Qtablewidget to word file. How i can do that? Thank you!
Sabri
  • 11
  • 4
-1
votes
1 answer

showing large table with QTableView with PyQt4

sorry, but im an newbie in PyQT. Im trying to show a table with 300 rows with qtablview. With smaller tables everthing works fine. What do i have to change to show all rows? from PyQt4 import QtSql, QtGui class EmployesWindow(QtGui.QWidget): def…
vagus1975
  • 37
  • 4
-1
votes
2 answers

QTableView no selection

This is driving me crazy. I basically can't get a selection in my subclassed QTableView. It's a substantially large project, and most pieces of the puzzle have been subclassed. But, I feel I've checked basically…
kiss-o-matic
  • 1,111
  • 16
  • 32
-1
votes
1 answer

No signals emitted from QTableView

For some reason, my QTableView seems to never emit a single signal. At first I tried connecting to any slot programmatically, but then I realized even through the Signal/Slot Editor from the GUI I could not make something happen, no matter which…
asm
  • 11
  • 3
-1
votes
2 answers

Moving complete rows in a QTableView

I have a tab which contains a QtableView and few buttons like "MOVE UP" and "MOVE DOWN". So on "MOVE UP" button press I have to move the entire row of QTableView one step up and the bring the adjacent one, one step down. I want to achieve this…
Garifield
  • 63
  • 2
  • 8
-2
votes
1 answer

How to extend Qt Widgets that do not have model support by default

CustomMenu class inherits from QMenu. Its custom setData() method accepts an argument and sets it to a class variable model. I did this because QToolButton, QToolMenu and QAction do not support model/view framework. From what I know aside from all…
alphanumeric
  • 17,967
  • 64
  • 244
  • 392
-3
votes
2 answers

QCombobox enables selection of header (Qtableview)

I am previewing a file in Qtableview and want users to select the column they want to import into a dataframe. this selection is done by listing the column headers in a combobox for easy user selection. somehow I cannot get the list populated, my…
Zoner
  • 37
  • 9
-3
votes
1 answer

Delegate is not displayed properly in the QTableView

I am trying to implement a sample code listed in the PySide2 documentation. https://doc.qt.io/qtforpython-5.12/PySide2/QtWidgets/QAbstractItemDelegate.html#PySide2.QtWidgets.QAbstractItemDelegate import sys import os from PySide2.QtWidgets import…
1 2 3
82
83