Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Row height in TableView in qml-components

$
0
0
Hi I’m trying to make different heights for rows in TableView, but it seems now I can’t change default cell height at all. It used to work earlier, it was not perfect but it worked. Now no matter what height I set in itemDelegate nothing changes, although setting height in rowDelegate helps. But in rowDelegate I don’t have access to current displaying data and hence I can’t not change height based on cell values in current row. Here is my simple code import QtQuick 2.0 import QtDesktop 1.0   Rectangle {     width: 360     height: 360    ListModel {   id:listmodel   ListElement{ myrole1: "value 1"; myrole2: "value 2"}   ListElement{ myrole1: "value 3"; myrole2: "value 4"}  }    TableView  {   anchors.fill: parent     TableColumn{ role: "myrole1" ; title: "Column 1" ; width:100}   TableColumn{ role: "myrole2" ; title: "Column 2" ; width:200}   model:listmodel     itemDelegate: Text{      height: 60  //!!! does not work    text: itemValue   }  } } In itemDelegate I’d like to write something like this height: check_some_condition(itemValue) ? 50 : 100 Is it another regression or something crucial has changed and now there is another way to handle such cases?

Viewing all articles
Browse latest Browse all 4972

Trending Articles