[Qt-interest] Alignment of data in a QTableView
Jason H
scorp1us at yahoo.com
Sun Feb 6 15:48:00 CET 2011
Without digging into it, I would guess that the reported Font Metrics are
incorrect. (Recorded does not match drawn)
But I think it is a problem with your 5's because its got the horizontal part
but no vertical stem. I think that is as the font is designed.
----- Original Message ----
From: Robert Hairgrove <evorgriahr at hispeed.ch>
To: qt-interest at qt.nokia.com
Sent: Sun, February 6, 2011 8:17:12 AM
Subject: [Qt-interest] Alignment of data in a QTableView
There seems to be a problem with text alignment in the default delegate
rendering of text in a QTableView.
Here is a screenshot attached which shows that the last column is
top-aligned, even though I have code in the data() function of my model
class that returns "Qt::AlignLeft + Qt::AlignVCenter" for role ==
Qt::TextAlignmentRole. Depending on the font, it is sometimes also
clipped at the top. I am using a monospaced font because this is a
text-import wizard, and if the user chooses a file with fixed-width
text, it should display with a monospaced font.
Does this happen because the last column happens to be numeric data
(although it is actually text)?
Thanks.
More information about the Qt-interest-old
mailing list