Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Using PyQt6 and QtSql Model-view widget Form displays but no record data is displayed [closed]

$
0
0

I am trying to create a simple form to add and edit records from a table, one at a time in an SQLite database using model_view widgets and QSqlTableModel. There are two records in the table. When I run the script, the form appears but no data. I know I must be missing a line of code to select a record from the table to display but don't know how to do that. I'm trying to follow the pattern in Chapter 9 of Mastering GUI Programming with Python and adapt it to work with one record at a time.

I tried various lines of code trying to specify the id (primary key) of a record in the Recipe table. Nothing worked.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>