Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Language Translation for QML ListElement.
Qt 6.11 is out! See what's new in the release blog

Language Translation for QML ListElement.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
1 Posts 1 Posters 489 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Pradeep P NP Offline
    Pradeep P NP Offline
    Pradeep P N
    wrote on last edited by
    #1

    Hi,

    Can some one help me in Translation of ListElement in QML.
    Sample Code is as below. And i have the .ts File with updated language text, but no Change in UI.

    ListModel {
        id: myModel
    
        ListElement {
            name: QT_TR_NOOP("Pressure")
        } 
        ListElement {
            name: QT_TR_NOOP("Control")
        }
        ListElement {
            name: QT_TR_NOOP("Check")
        }
    }
    

    Item{
    // -----------------------
    Component.onCompleted: {
    display.text = qsTr(myModel.get(index).name) //name
    }

    // -----------------------
    }

    Pradeep Nimbalkar.
    Upvote the answer(s) that helped you to solve the issue...
    Keep code clean.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved