Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/dulines.cpp
Context not available. | |||||
88 | QString renderedText = text; | 88 | QString renderedText = text; | ||
---|---|---|---|---|---|
89 | 89 | | |||
90 | int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin); | 90 | int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin); | ||
91 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) | ||||
92 | int pos = 3 * textMargin + option.fontMetrics.horizontalAdvance(display) + iconSize.width(); | ||||
93 | #else | ||||
91 | int pos = 3 * textMargin + option.fontMetrics.width(display) + iconSize.width(); | 94 | int pos = 3 * textMargin + option.fontMetrics.width(display) + iconSize.width(); | ||
95 | #endif | ||||
92 | 96 | | |||
93 | bool truncd = false; | 97 | bool truncd = false; | ||
94 | 98 | | |||
Context not available. | |||||
96 | if (rct.width() > pos) { | 100 | if (rct.width() > pos) { | ||
97 | rct.setX(rct.x() + pos); | 101 | rct.setX(rct.x() + pos); | ||
98 | 102 | | |||
103 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) | ||||
104 | if (fm.horizontalAdvance(renderedText) > rct.width()) { | ||||
105 | #else | ||||
99 | if (fm.width(renderedText) > rct.width()) { | 106 | if (fm.width(renderedText) > rct.width()) { | ||
107 | #endif | ||||
100 | truncd = true; | 108 | truncd = true; | ||
101 | 109 | | |||
110 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) | ||||
111 | int points = fm.horizontalAdvance("..."); | ||||
112 | | ||||
113 | while (!renderedText.isEmpty() && (fm.horizontalAdvance(renderedText) + points > rct.width())) | ||||
114 | #else | ||||
102 | int points = fm.width("..."); | 115 | int points = fm.width("..."); | ||
103 | 116 | | |||
104 | while (!renderedText.isEmpty() && (fm.width(renderedText) + points > rct.width())) | 117 | while (!renderedText.isEmpty() && (fm.width(renderedText) + points > rct.width())) | ||
118 | #endif | ||||
105 | renderedText.truncate(renderedText.length() - 1); | 119 | renderedText.truncate(renderedText.length() - 1); | ||
106 | 120 | | |||
107 | renderedText += "..."; | 121 | renderedText += "..."; | ||
Context not available. | |||||
181 | setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 195 | setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | ||
182 | setIndentation(10); | 196 | setIndentation(10); | ||
183 | 197 | | |||
198 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) | ||||
199 | int defaultSize = QFontMetrics(font()).horizontalAdvance("W"); | ||||
200 | #else | ||||
184 | int defaultSize = QFontMetrics(font()).width("W"); | 201 | int defaultSize = QFontMetrics(font()).width("W"); | ||
202 | #endif | ||||
185 | 203 | | |||
186 | QStringList labels; | 204 | QStringList labels; | ||
187 | labels << i18n("Line View"); | 205 | labels << i18n("Line View"); | ||
Context not available. |