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. TreeView model styling: How to display multiple role names (columns)?
Forum Updated to NodeBB v4.3 + New Features

TreeView model styling: How to display multiple role names (columns)?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 660 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.
  • D Offline
    D Offline
    David.G
    wrote on 5 Oct 2015, 22:58 last edited by
    #1

    Hello,

    I'm at a lost here, I just can't find the answer in the documentation.

    I have a treeview with a C++ model (based on QAbstractItemModel, of course). The data displays fine but now I want to provide a better style to it, which I can't due to the implicit nature of Qt Quick controls/QML in general I just don't know how to make a simple "Product name (20% off, was [product regular price]) per row.

    It's a very basic structure. A model with a row containing (id, product name, price, discount) etc. I want to provide a better styling but I can't find a way to mix different role names (data per column).

    I've found a few possible answers through googling and stackoverflow, but nothing concrete yet.

    P 1 Reply Last reply 7 Oct 2015, 10:21
    0
    • D David.G
      5 Oct 2015, 22:58

      Hello,

      I'm at a lost here, I just can't find the answer in the documentation.

      I have a treeview with a C++ model (based on QAbstractItemModel, of course). The data displays fine but now I want to provide a better style to it, which I can't due to the implicit nature of Qt Quick controls/QML in general I just don't know how to make a simple "Product name (20% off, was [product regular price]) per row.

      It's a very basic structure. A model with a row containing (id, product name, price, discount) etc. I want to provide a better styling but I can't find a way to mix different role names (data per column).

      I've found a few possible answers through googling and stackoverflow, but nothing concrete yet.

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 7 Oct 2015, 10:21 last edited by
      #2

      @David.G AFAIK one way would be to return the data as required from re-implemented data function.

      157

      1 Reply Last reply
      0

      1/2

      5 Oct 2015, 22:58

      • Login

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