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. Format TableViewColumn item text

Format TableViewColumn item text

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 945 Views 1 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.
  • D Offline
    D Offline
    dasun
    wrote on last edited by
    #1

    Is there a way to format the text of TableViewColumn bind to a role. I know this can be done by using itemDelegate. Is there are some other way something like this

    @ TableView{
    model: myObject.getModel();
    TableViewColumn{
    title: "Customer Name"
    role: "customerID"
    text: myObject.GetCustomerNameByID(customerID)
    }
    }@

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      no I think the best solution is to create a custom delegate. Though perhaps it would make sense to have something like a standard TaleViewDelegate{} as part of the API

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dasun
        wrote on last edited by
        #3

        Thank you! Then I think I can handle it form c++ by implementing a model by sub classing QAbstractListModel.

        TaleViewDelegate idea is great. I would like to see it on a future version. :)

        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