┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-10-25 22:15:45 +0200
committerPeter Penz <[email protected]>2011-10-25 22:17:07 +0200
commita3d883e73b75bdf654268c53811a2b4ac42b97e7 (patch)
tree14e48343674e962321380629b4e11311b17dc3e9 /src
parent54b5a283765f168575f2eaeff95c93dbeca3d63d (diff)
Fix minor graphical issue in group header and items
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kitemlistviewlayouter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistviewlayouter.cpp b/src/kitemviews/kitemlistviewlayouter.cpp
index 9b807aaf5..cb0e9cf55 100644
--- a/src/kitemviews/kitemlistviewlayouter.cpp
+++ b/src/kitemviews/kitemlistviewlayouter.cpp
@@ -297,7 +297,10 @@ void KItemListViewLayouter::doLayout()
// Apply the unused width equally to each column
const qreal unusedWidth = size.width() - m_columnCount * m_columnWidth;
if (unusedWidth > 0) {
- const qreal columnInc = unusedWidth / (m_columnCount + 1);
+ // [Comment #1] A cast to int is done on purpose to prevent rounding issues when
+ // drawing pixmaps and drawing text or other graphic primitives: Qt uses a different
+ // rastering algorithm for the upper/left of pixmaps
+ const qreal columnInc = int(unusedWidth / (m_columnCount + 1));
m_columnWidth += columnInc;
m_xPosInc += columnInc;
}
@@ -368,7 +371,7 @@ void KItemListViewLayouter::doLayout()
// (in average a character requires the halve width of the font height).
//
// TODO: Let the group headers provide a minimum width and respect this width here
- const qreal minimumGroupHeaderWidth = m_groupHeaderHeight * 15 / 2;
+ const qreal minimumGroupHeaderWidth = int(m_groupHeaderHeight * 15 / 2); // See [Comment #1]
if (requiredItemHeight < minimumGroupHeaderWidth) {
requiredItemHeight = minimumGroupHeaderWidth;
}