S
S
Sergey Savostin2015-02-22 17:05:50
Qt
Sergey Savostin, 2015-02-22 17:05:50

[Qt] Change interface language on the fly and QComboBox?

Maybe I don’t understand something, but why is there such a clumsy implementation of retranslateUi in Qt, especially in the QComboBox part?
The code that generates cui simply clears the entire list and re-adds the translated elements. And then selects the one in .ui Moreover, with such actions, all events are triggered to change the selected element.
How to make it so that when changing the language, the choice is saved, and not reset to the original one?
Isn't there a less barbaric way to change the text of options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Danilevsky, 2015-02-24
@danilevskiy

1) If you do not want to clear the entire list, connect the model and use its capabilities
2) Use QComboBox::activated(int index) - occurs when the user selects an item

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question