Alignment of image and text in QTextTable
Unsolved
General and Desktop
-
I create a simple two column table programmatically using
QTextTable
class. In the cells of the first row I need to put an image plus short text and center them vertically. Unfortunately I can't find a way to do it.I have tried to apply a vertical alignment to cells using following code
format = table->cellAt(0, 1).format(); format.setVerticalAlignment(QTextCharFormat::AlignMiddle); table->cellAt(0, 1).setFormat(format);
But it seems not working. In the resulting table images and text are not centered vertically, instead image seems to be aligned to the cell top while text aligned to the cell bottom.
Also tried with applying
QTextBlockFormat
with vertical alignment to cells with the same result.Am I miss something or doing it incorrectly? Maybe another approach should be used to achieve desired result?
-
Hi,
Please provide a minimal compilable example to reproduce your issue.