Answer the question
In order to leave comments, you need to log in
How to display dynamic parameters from a database table?
Introductory: a program for weighing products is required, cross-platform (Linux, Windows, android, etc.), the following tables are needed in the database:
Products, Weighing, Product parameters, Scale operator.
Each product has its own set of parameters, which can be changed dynamically.
Display a summary table of weights for products, i.e. in the heading the product, then its weighing.
In each line of weighing, the values of the parameters of the corresponding product must be indicated, and in the column headings - the names of these parameters.
I made the following tables in the database (synchronization is carried out programmatically):
WeighingParameters
Id | Weighing | Parameter | Value
ProductParameters
Id | product | Parameter
Weighing
id | product | operator | datetime | Weight
Output a table like
Id | product | operator | datetime | Weight | (and here are the parameter columns for the selected product)
I plan to use QSqlQueryModel in conjunction with QTableView, but I can’t make an sql query to get the last table.
Answer the question
In order to leave comments, you need to log in
PIVOT .
To display a non-persistent list of attributes, you can use a table view:
or:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question