Conversion of a SQL model into a standard item model?
-
Do you mean the ones solved by QSqlRelationalTableModel and QSqlRelationalDelegate mentioned in the documentation you are linking to ?
-
It's not a restriction, it's how the class works. QSqlTableModel as it name suggest allows access to one table.
So what exactly are you after ?
Specify a real situation
Specify a real need -
From the article you linked:
If the database system can determine the reverse mapping from the view schema to the schema of the underlying base tables, then the view is updatable. INSERT, UPDATE, and DELETE operations can be performed on updatable views.
Since there's no generic way for a Qt model to know that, it is left to the user to implement using
QSqlQuery
directly -
Attractive for what ?
-
I'll let you start by providing the analysis you want to discuss about.
-
@elfring said in Conversion of a SQL model into a standard item model?:
Is there a “development competition” going on between data processing by SQL queries and/or Qt standard items?
No, there is no competition going on.
@elfring, what is your goal for asking us these questions? Are you trying to get us to write a "software extension" for you?
-
@elfring said in Conversion of a SQL model into a standard item model?:
I hope that more software evolution can happen in this area so that the switching between discussed data models might become easier.
We will not perform this "software evolution" because we cannot see any good reason to provide additional conversion/switching between QSqlTableModel and QStandardItemModel. Furthermore, none of your posts above provide convincing arguments for this conversion/switching.
-
@elfring said in Conversion of a SQL model into a standard item model?:
I assume that some Qt users will care for collateral evolution around data models.
Yes, there are users here who care about the improvement of Qt data models. For example, @VRonin submitted many patches this year for models (such as https://codereview.qt-project.org/#/c/235730/4//ALL ), and his changes were accepted by the Qt Project.
His changes were accepted for a few reasons:
- Because his submissions solve real problems that are encountered by real people.
- Because his submissions do not introduce new problems.
Try to follow his example. Try to submit proposals that solve real problems, and try not to introduce new problems.
First, thank you for submitting https://bugreports.qt.io/browse/QTBUG-71482. This is a good submission because it addresses a real problem: Important documentation is missing.
However, here are some examples where your submissions are not good:
- This thread ("Conversion of a SQL model into a standard item model?") is rejected because it does not solve a real problem. Nobody here needs to convert/switch between QSqlTableModel and QStandardItemModel.
- "Returning C++ references from more programming interfaces?" is rejected because it introduces a new problem: It breaks encapsulation.