M
M
MaxLich2018-07-24 12:56:32
css
MaxLich, 2018-07-24 12:56:32

How to change text alignment in QTableView table headers using CSS?

Hello. I use a program from Siemens for building SCADA systems (WinCC OA), which is built on Qt. You cannot directly work with the Qt library in it, but you can change the display of graphic objects using CSS. How to define text alignment in QTableView table headers using only CSS.
Tried like this:

QTableView QHeaderView::section {
    text-align: center;
 }

And doesn't work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxLich, 2018-07-25
@MaxLich

Got a stackoverflow response:
Judging by this jira , this bug is not closed yet.
But there is a solution through the properties of qt-objects:
QHeaderView {
qproperty-defaultAlignment: AlignLeft;
}
Tried it in my program (WinCC OA): only works partially. I tried it in QSS Editor - it works. So this advice can be considered a solution. But if someone can say something specifically about WinCC OA, then I will be glad to hear it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question