Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
46 views

In Qt 6.8.2 I subclassed QTableView in order to catch the pressing of Key_Delete: #include <QTableView> #include <QKeyEvent> class TableView : public QTableView { Q_OBJECT public: ...
Mark's user avatar
  • 5,355
1 vote
1 answer
36 views

In a Qt 6.8.2 Desktop application with SQLite I have two related tables: Table master id name 1 aaa 2 bbb Table details id idMaster value 1 1 foo 2 1 bar In my QMainWindow I have two QTableView and I ...
Mark's user avatar
  • 5,355
1 vote
0 answers
41 views

I'm studying the masterdetail example but it does not fit my real case scenario. I cannot use the same approach of retrieving the relational model like this: QSqlTableModel *artistModel = model->...
Mark's user avatar
  • 5,355
1 vote
1 answer
93 views

Suppose that in a QSqlRelationalDelegate we have two relation columns, country and city. The city table has a country_id field. By overriding the setEditorData method of QSqlRelationalDelegate, I'm ...
Minas Lyrakis's user avatar
1 vote
0 answers
107 views

I am an experienced programmer but new to Python/PyQt & just trying to get my head around how the QSqlrelationship/DataWidget mapper works. I have a main table, Tracks which links to Album table. ...
Titus's user avatar
  • 11
0 votes
0 answers
48 views

I can't figure out the strange display behavior of QSqlRelationalTableModel. setEditStrategy of the model is set to OnFieldChange. I'm trying to change the values in the cells, but the whole row ...
papadulo's user avatar
3 votes
2 answers
530 views

I have a QTableView connected to a QSqlRelationalTableModel. Everything works as expected, however, it seems to be impossible to have a sqlite3 generated column in my model: bhd [INTEGER] GENERATED ...
Oliver Bienert's user avatar
0 votes
0 answers
610 views

I have created a QtableView with QSqlRelationalTableModel. All works fine. I would like add a checkbox to column. class myQSqlRelationalDelegate(QSqlRelationalDelegate): def __init__(self, ...
Vincenzo Trotta's user avatar
1 vote
0 answers
553 views

So, I’m stumped by a problem when updating a record on a relational column in a QSqlRelationalTableModel with PyQt6. Background: I’m developing an app which includes a GUI to keep track of clients. ...
ce.berlin's user avatar
1 vote
1 answer
121 views

The following code works perfectly with Sqlite3 but not with Postgres. No bug but the returned table is always empty... self.model = QSqlRelationalTableModel(db=db) self.model.setTable("...
Jean-Luc Thomas's user avatar
0 votes
1 answer
151 views

I have a QTableView with a QSqlRelationalTableModel as the model. Essentially: QSqlRelationalTableModel *theModel = ...; QTableView *theView = ...; theModel->setTable("table"); theView-&...
Jason C's user avatar
  • 40.6k
0 votes
1 answer
161 views

I have this relational model rel_model = QSqlRelationalTableModel(self, connectDB) rel_model.setTable("person") rel_model.setRelation(1, QSqlRelation("email", "id", "...
accpert.com's user avatar
6 votes
0 answers
356 views

I have a QTableView populated by QSqlRelationalTableModel. There is a column that references another table, so when I edit/create a row, this column's editor is QCombobox which gets its data from the ...
Muslimbek Abduganiev's user avatar
0 votes
0 answers
82 views

I am using a QtableView to display data from a QSqlRelationalTableModel which seems to work fine, however when I use self.motormodel.setRelation(1, QSqlRelation('Instruments', "Asset Tag",&...
adi2scoops's user avatar
0 votes
1 answer
739 views

I have a QComboBox populated from a relationModel of a QSqlRelationalTableModel and connected to a QDataWidgetMapper. I select a row in the QTableView, this row (record) mapped to the QLineEdit and ...
embabi's user avatar
  • 11
2 votes
1 answer
481 views

I am trying to add new rows to QSqlRelationalModel which is represented in QTableView. I have set proper QSqlRelationalDelegate and proper QSqlRelations in the model. Displaying existing data from the ...
Muslimbek Abduganiev's user avatar
0 votes
1 answer
762 views

I have a QTableView with a QSortFilterProxyModel as its model which has a QSqlRelationalTableModel as its source model. When I sort or filter the viewed data through the QSortFilterProxyModel, only ...
embabi's user avatar
  • 11
0 votes
1 answer
858 views

I have 2 QTableViews connected to 2 QSortFilterProxyModels which are connected to only 1 source model (QSqlRelationalTableModel). On sorting or filtering any of the proxy models, it is reflected in ...
embabi's user avatar
  • 11
0 votes
1 answer
114 views

After setRelation(...), How can I get the original value of the column which seems have already been replaced by the column in the foreign table? Here's my code: Table "record" contains "recordId ...
yjjj's user avatar
  • 1
2 votes
1 answer
566 views

I have two SQLite tables having the following structure: CREATE TABLE "log" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "name" TEXT, "value" INTEGER NOT NULL, "category_id" ...
Liviu's user avatar
  • 172
0 votes
0 answers
177 views

I have a QSqlRelationalTableModel like this: rel_model = QSqlRelationalTableModel(self, connectDB) rel_model.setTable("main_table") rel_model.setRelation(1, QSqlRelation("linked_table", "id", "name"))...
vezzon's user avatar
  • 209
1 vote
1 answer
441 views

I have a QSqlRelationalTableModel with a related table with more than 256 rows. The relation is working perfect, i have in column 1 the related values from the "relation_table" But mapping the data ...
vezzon's user avatar
  • 209
-1 votes
4 answers
1k views

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 ...
jaro2gw's user avatar
  • 133
1 vote
1 answer
621 views

Whenever I enable a filter with QSortFilterProxyModel() and insert a new record in my QSqlRelationalTableModel() which is linked to a QTreeView I get the error: RecursionError: maximum recursion ...
ProfP30's user avatar
  • 368
0 votes
1 answer
251 views

I need to sort records displayed in a QTableView that uses a QSqlRelationalTableModel with QSqlRelationalDelegate. I want the values in the pull down list and the table view to be sorted. I've done a ...
Randy Pierson's user avatar
1 vote
0 answers
419 views

I'm using a QSqlRelationalTableModel with a QSqlRelationalDelegate for a simple database editing application. I would like to create a signal when user modify a value (item) in a record with delegate ...
Simone ARAGNO's user avatar
0 votes
1 answer
922 views

I've modified the relational table model at https://doc.qt.io/qt-5/qtsql-relationaltablemodel-relationaltablemodel-cpp.html I want to be able to save my changes to my database, but it only saves the ...
user1801060's user avatar
  • 2,821
0 votes
1 answer
315 views

I set the model of a view like this: model = QSqlRelationalTableModel() model.setEditStrategy(QSqlTableModel.OnManualSubmit) model.setTable("VoucherPos") model.setFilter("VoucherKey='" + str(...
vezzon's user avatar
  • 209
0 votes
1 answer
130 views

I'm displaying a table that contains one column with a blob (pdf file). I could have hide the column for the user, but instead i wanted to show a icon in the column when it was a document on file. I ...
Dan3460's user avatar
  • 95
2 votes
1 answer
224 views

What is the right way to color-code rows in a QTableView? I'm developing a spreadsheet application that should color-code its rows based on a specific value set in one of the columns. I use ...
Tylnesh's user avatar
  • 35