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. TableView Model
Qt 6.11 is out! See what's new in the release blog

TableView Model

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 2.0k 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.
  • F Offline
    F Offline
    Fehan Arif
    wrote on last edited by
    #1

    Hi

    I have created a tableview with alternative Rows color. Then I needed to change the font size of the text in Row.

    I have inserted these changes to get the font size changes.
    itemDelegate: Recatangle{
    Text{
    font.pixelSize: 35
    }
    }

    This helped and font size has changed, but my alternative Rows color has vanished.

    My question is.

    1. How can I change the size of font and Row size without losing control on AlternativeRows color.
    2. Also how can I control which color is to be displayed for Alternative Rows color.
    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Fehan-Arif
      Once you set your custom delegate the default style is overridden.

      How can I change the size of font and Row size without losing control on AlternativeRows color.

      You will manually need to set those colors. For eg:

      itemDelegate: Recatangle{
      color: styleData.row%2==0? "red" : "lightgray"
      Text{
            font.pixelSize: 35
         }
      }
      

      http://doc.qt.io/qt-5/qml-qtquick-controls-tableview.html#itemDelegate-prop

      Also how can I control which color is to be displayed for Alternative Rows color.

      Shown in above code.

      157

      1 Reply Last reply
      2

      • Login

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