Important: Please read the Qt Code of Conduct -

Collecting dimensions of translatable text labels in Qt Quick

  • Hi All,

    Is there a way to collect dimensions of translatable text labels used in QMLs?
    I know that lupdate can be used to collect texts to be translated, but is there a tool that collects information allowing translators know what size their translations should fit in?
    If there is no such tool, maybe there is a commonly used approach to deal with this

    Thanks :)

  • Lifetime Qt Champion


    AFAIK, there's no such tool nor any extracted information about that because it will depend on many parameters some of which are not controlled by Qt.

    Why do you need your translators to be limited by the geometry of your widgets ?

  • @SGaist I need to know dimensions of text labels to let translators deliver translations that would fit in those text labels using the very same font and font size. I want to make sure translated texts are not getting truncated.

  • Lifetime Qt Champion

    Why not let these labels expand as needed for the texts ?

  • Hi,


    u want to have the translated text of different languages, to be fit in label, make sure the label size is not fixed, and make them expand based on the translated text of the respective words which needs to be fit in label.
    Coz if u make label as fixed , for particular text it gets cropped. as said by @SGaist , expand labels dynamically for the text.


  • @SGaist I can certainly make labels expandable but I'm still limited by the screen size (say 800x480)

  • Lifetime Qt Champion

    What kind of text do you have that might be big enough to become a problem for your UI ?