Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/dulines.cpp
Context not available. | |||||
43 | #include <KConfigCore/KSharedConfig> | 43 | #include <KConfigCore/KSharedConfig> | ||
---|---|---|---|---|---|
44 | #include <KI18n/KLocalizedString> | 44 | #include <KI18n/KLocalizedString> | ||
45 | 45 | | |||
46 | #include "../compat.h" | ||||
46 | 47 | | |||
47 | class DULinesItemDelegate : public QItemDelegate | 48 | class DULinesItemDelegate : public QItemDelegate | ||
48 | { | 49 | { | ||
Context not available. | |||||
88 | QString renderedText = text; | 89 | QString renderedText = text; | ||
89 | 90 | | |||
90 | int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin); | 91 | int textMargin = QApplication::style()->pixelMetric(QStyle::PM_FocusFrameHMargin); | ||
91 | int pos = 3 * textMargin + option.fontMetrics.width(display) + iconSize.width(); | 92 | int pos = 3 * textMargin + option.fontMetrics.QFONTMETRICS_WIDTH(display) + iconSize.width(); | ||
92 | 93 | | |||
93 | bool truncd = false; | 94 | bool truncd = false; | ||
94 | 95 | | |||
Context not available. | |||||
96 | if (rct.width() > pos) { | 97 | if (rct.width() > pos) { | ||
97 | rct.setX(rct.x() + pos); | 98 | rct.setX(rct.x() + pos); | ||
98 | 99 | | |||
99 | if (fm.width(renderedText) > rct.width()) { | 100 | if (fm.QFONTMETRICS_WIDTH(renderedText) > rct.width()) { | ||
100 | truncd = true; | 101 | truncd = true; | ||
101 | 102 | | |||
102 | int points = fm.width("..."); | 103 | int points = fm.QFONTMETRICS_WIDTH("..."); | ||
103 | 104 | | |||
104 | while (!renderedText.isEmpty() && (fm.width(renderedText) + points > rct.width())) | 105 | while (!renderedText.isEmpty() && (fm.QFONTMETRICS_WIDTH(renderedText) + points > rct.width())) | ||
105 | renderedText.truncate(renderedText.length() - 1); | 106 | renderedText.truncate(renderedText.length() - 1); | ||
106 | 107 | | |||
107 | renderedText += "..."; | 108 | renderedText += "..."; | ||
Context not available. | |||||
181 | setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | 182 | setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); | ||
182 | setIndentation(10); | 183 | setIndentation(10); | ||
183 | 184 | | |||
184 | int defaultSize = QFontMetrics(font()).width("W"); | 185 | int defaultSize = QFontMetrics(font()).QFONTMETRICS_WIDTH("W"); | ||
185 | 186 | | |||
186 | QStringList labels; | 187 | QStringList labels; | ||
187 | labels << i18n("Line View"); | 188 | labels << i18n("Line View"); | ||
Context not available. |