VimProject | All about my vim projects | Text Editor library
kandi X-RAY | VimProject Summary
kandi X-RAY | VimProject Summary
All about my vim projects
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of VimProject
VimProject Key Features
VimProject Examples and Code Snippets
Community Discussions
Trending Discussions on VimProject
QUESTION
I've recently examined an example from Chapter 15 of “Rapid GUI Programming with Python and Qt” by Mark Summerfield which presents the use of SQL Database TableView modelling. In this original example, I found a little dysfunctionality which prevents the table views from refreshing combobox delegates (being QSqlRelation). Simply, the combobox delegates in the table view which represent the data of QSqlRelationalTableModel, are not updated once relational tables have been modified.
The original file name is chap15/assetmanager.pyw and can be find elsewhere. Below I provide a code snippet necessary to reproduce the problem.
In this example, a relation with QSqlTableModel (self.assetModel and self.logModel) is established for actions and categories (QSqlRelationalTableModel) which can be modified using the combobox delegates (LogDelegate or AssetDelegate). New actions or categories can be added through the ReferenceDataDlg dialog.
New record added in Categories
However, once the dialog ReferenceDataDlg is closed the newly created record does not appear in the combobox delegate even though the new records exist in the SQL table for actions or categories.
Combobox delegate not refreshed
How can I programmatically refresh the list of items in the combobox delegate in the table views: self.assetView and self.logView?
...ANSWER
Answered 2020-Jan-05 at 20:58I suppose that for reasons of efficiency the model associated to the QComboBox
of QSqlRelationalDelegate
is not reloaded every time the QComboBox
is shown, the solution is to reload that model using the select()
method:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install VimProject
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page