M
M
Mercury132015-12-04 15:11:54
Qt
Mercury13, 2015-12-04 15:11:54

QTableView: Is it possible to swap alternating rows without delegates?

table->setAlternatingRowColors(true);
Well, do not rubbish?
0ef69bcbf067415d80a66f9f00e35bd1.png
From a design point of view, the easiest way to solve this problem is to make the first line black and the second white. Like this (this is not a screenshot, but an imitation).
dd73589980404493b68b7fab3e0f67f4.png
Can this be done somehow without delegates?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mercury13, 2015-12-10
@Mercury13

It seems to be impossible. But it turned out that this is not the delegate, but the data model. The cost of it I found acceptable, so it is impossible.

A
Armenian Radio, 2015-12-04
@gbg

Yes, how to send two bytes:

myTable->setAlternatingRowColors(true);
myTable->setStyleSheet("alternate-background-color: yellow;background-color: red;");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question