Problem with vertical alignment in QTextTableFormat
Hi!
I have a problem with vertical alignment of a table in a QTextDocument. I suspect it’s related to bug https://bugreports.qt-project.org/browse/QTBUG-6979 , but before thinking about bugs, I’d like to know whether there’s a problem in the code that I don’t see and experts probably will:
- QSettings settings;
- printer.setPrinterName(settings.value("printerName").toString());
- printer.setFullPage(true);
- QSizeF paperSize;
- QTextTableFormat tableFormat;
- //Horizontal alignment works fine (I tried left, center and right)
- //But when I add any vertical alignment, table renders in top left corner.
- //With Qt::AlignCenter, table aligns horizontally, but not vertically
- QTextCharFormat textFormat;
- textFormat.setFont(font);
- textFormat.setFontPointSize(12);
- paperSize.setWidth(printer.width());
- paperSize.setHeight(printer.height());
- envelopeDocument->setPageSize(paperSize);
- cursor = table->cellAt(0,0).firstCursorPosition();
- cursor.insertText(addressText,textFormat);
If this is a bug, is there any workaround?
Thank you!
1 reply
You must log in to post a reply. Not a member yet? Register here!
