Good way to maintain Qt labels and text on UI

mercurial

What is the best way/common practice for maintaining all string resources found on a UI in Qt, especially the textual input/text in combo boxes etc. (since these are the once that are frequently used in the code itself)?

I know that Android has this string resources thing such that resources only have to be modified at one position.

Does Qt have something like that too or do I have to initialize string resources in code instead of in the UI's XML itself...

vahancho

AFAIK, there is no built-in mechanism for string resources in Qt. If you want to maintain strings at build time you can define them in one .h/.cpp file as global variables and reuse them in your code.

Otherwise you can use Qt's translator files (binary) and load them along with your application. If you need to change a string, you simply will need to edit the translation file (xml) and "recompile" it with lrelease utility without building the application again.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What could be a good way to maintain reusable objects in Processing?

From Dev

tree: Is there a way to maintain visibility of outer level directory labels when scrolling?

From Dev

Qt slider widget with tick text labels

From Dev

Excel: good way to separate text to columns?

From Dev

What's a good way to maintain the functionality while removing the chance of stack overflow exceptions

From Java

Is there good way to save text input from tkinter Text widget

From Dev

Qt 5.2 - How to add a text link into a UI

From Dev

Is this a good way to start a anonymous task and continue with ui thread?

From Dev

Is there a way to maintain Qt script context environment outside of QScriptEngine#pushContext/popContext?

From Dev

What's a good way to filter a text file to remove empty lines?

From Dev

Is there a good automated way to make a generic block of text square?

From Dev

What's a good way to display text messages in JavaFX FXML?

From Dev

Proper way to maintain database known state by rolling back transactions in NUnit, Sql Server and UI Testing

From Dev

Good way to input PASCAL-VOC 2012 training data and labels with tensorflow

From Dev

Maintain text in browser with zoom

From Dev

In Sklearn machine learning, is there any way to classify text without target labels?

From Dev

R plots: Is there a way to draw a border, shadow or buffer around text labels?

From Dev

R plots: Is there a way to draw a border, shadow or buffer around text labels?

From Dev

what free percentage is good for a partition to maintain?

From Dev

What is the best way to set/read UI values in Qt Quick

From Dev

What is the best way to set/read UI values in Qt Quick

From Dev

Changing color of QLabel text? Accessing and modifying members of .ui file? [Qt]

From Dev

Changing color of QLabel text? Accessing and modifying members of .ui file? [Qt]

From Dev

Qt/C++ : get Ui QLineEdit text from another class

From Dev

Remove Labels in qt

From Dev

Best way to maintain a Git fork

From Dev

Pythonic way to maintain variable assignment

From Dev

Is there any way to maintain counts in crontab?

From Dev

BDD good for UI automation?

Related Related

  1. 1

    What could be a good way to maintain reusable objects in Processing?

  2. 2

    tree: Is there a way to maintain visibility of outer level directory labels when scrolling?

  3. 3

    Qt slider widget with tick text labels

  4. 4

    Excel: good way to separate text to columns?

  5. 5

    What's a good way to maintain the functionality while removing the chance of stack overflow exceptions

  6. 6

    Is there good way to save text input from tkinter Text widget

  7. 7

    Qt 5.2 - How to add a text link into a UI

  8. 8

    Is this a good way to start a anonymous task and continue with ui thread?

  9. 9

    Is there a way to maintain Qt script context environment outside of QScriptEngine#pushContext/popContext?

  10. 10

    What's a good way to filter a text file to remove empty lines?

  11. 11

    Is there a good automated way to make a generic block of text square?

  12. 12

    What's a good way to display text messages in JavaFX FXML?

  13. 13

    Proper way to maintain database known state by rolling back transactions in NUnit, Sql Server and UI Testing

  14. 14

    Good way to input PASCAL-VOC 2012 training data and labels with tensorflow

  15. 15

    Maintain text in browser with zoom

  16. 16

    In Sklearn machine learning, is there any way to classify text without target labels?

  17. 17

    R plots: Is there a way to draw a border, shadow or buffer around text labels?

  18. 18

    R plots: Is there a way to draw a border, shadow or buffer around text labels?

  19. 19

    what free percentage is good for a partition to maintain?

  20. 20

    What is the best way to set/read UI values in Qt Quick

  21. 21

    What is the best way to set/read UI values in Qt Quick

  22. 22

    Changing color of QLabel text? Accessing and modifying members of .ui file? [Qt]

  23. 23

    Changing color of QLabel text? Accessing and modifying members of .ui file? [Qt]

  24. 24

    Qt/C++ : get Ui QLineEdit text from another class

  25. 25

    Remove Labels in qt

  26. 26

    Best way to maintain a Git fork

  27. 27

    Pythonic way to maintain variable assignment

  28. 28

    Is there any way to maintain counts in crontab?

  29. 29

    BDD good for UI automation?

HotTag

Archive