Changeset View
Changeset View
Standalone View
Standalone View
src/editors/utils.cpp
Show All 16 Lines | |||||
17 | * Boston, MA 02110-1301, USA. | 17 | * Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "utils.h" | 20 | #include "utils.h" | ||
21 | 21 | | |||
22 | #include <QPushButton> | 22 | #include <QPushButton> | ||
23 | #include <QFontMetrics> | 23 | #include <QFontMetrics> | ||
24 | 24 | | |||
25 | KPROPERTY_EXPORT void KPropertyUtils::setupDotDotDotButton(QPushButton *button, const QString& toolTip, const QString& whatsThis) | 25 | KPROPERTYCORE_EXPORT void KPropertyUtils::setupDotDotDotButton(QPushButton *button, const QString& toolTip, const QString& whatsThis) | ||
26 | { | 26 | { | ||
27 | button->setText(QObject::tr("...", "Three dots for 'Insert image from file' button")); | 27 | button->setText(QObject::tr("...", "Three dots for 'Insert image from file' button")); | ||
28 | if (!toolTip.isEmpty()) | 28 | if (!toolTip.isEmpty()) | ||
29 | button->setToolTip(toolTip); | 29 | button->setToolTip(toolTip); | ||
30 | if (!whatsThis.isEmpty()) | 30 | if (!whatsThis.isEmpty()) | ||
31 | button->setWhatsThis(whatsThis); | 31 | button->setWhatsThis(whatsThis); | ||
32 | button->setFocusPolicy(Qt::NoFocus); | 32 | button->setFocusPolicy(Qt::NoFocus); | ||
33 | button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 33 | button->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
34 | const QFontMetrics fm(button->font()); | 34 | const QFontMetrics fm(button->font()); | ||
35 | button->setFixedWidth(fm.width(button->text() + QLatin1String(" "))); | 35 | button->setFixedWidth(fm.width(button->text() + QLatin1String(" "))); | ||
36 | } | 36 | } |