blob: 164b80f15fc4c6e14362894f3f8ff16f69a4b2f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/*
* Copyright (c) 2010 Kevin Smith
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "DelegateCommons.h"
namespace Swift {
void DelegateCommons::drawElidedText(QPainter* painter, const QRect& region, const QString& text) {
QString adjustedText(painter->fontMetrics().elidedText(text, Qt::ElideRight, region.width(), Qt::TextShowMnemonic));
painter->drawText(region, Qt::AlignTop, adjustedText);
}
const int DelegateCommons::horizontalMargin = 2;
const int DelegateCommons::verticalMargin = 2;
const int DelegateCommons::farLeftMargin = 2;
}
|