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. QString use in ComboBox model data presentation

QString use in ComboBox model data presentation

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 107 Views
  • 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.
  • G Offline
    G Offline
    GregWilsonLindberg
    wrote on last edited by
    #1

    I would like to use a QML QString for formatting the text that will be displayed for the model data in a ComboBox. QString has the C++ .arg() functionality which will give me better formatting than I can otherwise get.

    Does anyone know if it is possible to use QString to format the data to be presented in a ComboBox.

    I have tried to use it directly in the text: line in my ComboBox delegate, like "text: new QString("Cass Id: %1").arg(modelData.CassId, 2)", but I get no data out.

    I've tried to write a function to call, but I can't get that to work either.

    Any help would be greatly appreciated.

    Regards,
    Greg

    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