It's a combo box question linked to the database
-
Hello, I'm a beginner developer. It's nothing but
It's a Q combo box that is linked to SQL. There is a separate name for the row in the DB, what should I do if I want to put it as a different name in Qcombobox?
Is this possible?
ex)
The value stored in DB hi. -> The value I want to retrieve from QCombo hello.
Can I change it using the ini file like this? Or is there another way?
-
Hello, I'm a beginner developer. It's nothing but
It's a Q combo box that is linked to SQL. There is a separate name for the row in the DB, what should I do if I want to put it as a different name in Qcombobox?
Is this possible?
ex)
The value stored in DB hi. -> The value I want to retrieve from QCombo hello.
Can I change it using the ini file like this? Or is there another way?
@meria0503 Your description is really unclear.
Do you want to translate text in QComboBox?
Please explain more clearly. -
Hello, I'm a beginner developer. It's nothing but
It's a Q combo box that is linked to SQL. There is a separate name for the row in the DB, what should I do if I want to put it as a different name in Qcombobox?
Is this possible?
ex)
The value stored in DB hi. -> The value I want to retrieve from QCombo hello.
Can I change it using the ini file like this? Or is there another way?
@meria0503
If you mean you have entries in a SQL table which you are displaying in aQComboBoxbound to aQSqlQueryModeland you want to change their text, one way would be to interpose aQAbstractProxyModel-derived class with your "translations".But you may mean something quite different! No idea what your "change it using the ini file" might mean.
-
@meria0503 Your description is really unclear.
Do you want to translate text in QComboBox?
Please explain more clearly. -
@meria0503 said in It's a combo box question linked to the database:
I want to print it out in Korean.
Do you already have the translations somewhere?
-
@meria0503 said in It's a combo box question linked to the database:
I want to print it out in Korean.
Do you already have the translations somewhere?
-
@meria0503
If you mean you have entries in a SQL table which you are displaying in aQComboBoxbound to aQSqlQueryModeland you want to change their text, one way would be to interpose aQAbstractProxyModel-derived class with your "translations".But you may mean something quite different! No idea what your "change it using the ini file" might mean.
@JonB said in It's a combo box question linked to the database:
and you want to change their text, one way would be to interpose a
QAbstractProxyModel-derived class with your "translations". -
@JonB said in It's a combo box question linked to the database:
and you want to change their text, one way would be to interpose a
QAbstractProxyModel-derived class with your "translations". -
@JonB said in It's a combo box question linked to the database:
QAbstractProxyModel
Are you saying that it is possible to use the QAbstract proxy model?
@meria0503
Yes, I don't know how to be much clearer!There you could override the
data()method and "translate" strings retrieved from the database into strings you want shown in the combo box. It's one way, without too much disruption. You might write your ownQAbstractProxyModel, or you might derive from QIdentityProxyModel as the starting point:Because it does no sorting or filtering, this class is most suitable to proxy models which transform the
data()of the source model -
@meria0503
Yes, I don't know how to be much clearer!There you could override the
data()method and "translate" strings retrieved from the database into strings you want shown in the combo box. It's one way, without too much disruption. You might write your ownQAbstractProxyModel, or you might derive from QIdentityProxyModel as the starting point:Because it does no sorting or filtering, this class is most suitable to proxy models which transform the
data()of the source model