Plasma
Go to the documentation of this file.
26 #include <kmimetype.h>
28 #include "private/themedwidgetinterface_p.h"
35 class CheckBoxPrivate :
public ThemedWidgetInterface<CheckBox>
38 CheckBoxPrivate(CheckBox *c)
39 : ThemedWidgetInterface<CheckBox>(c),
51 if (imagePath.isEmpty()) {
57 KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
58 QPixmap pm(q->size().toSize());
60 if (mime->is(
"image/svg+xml") || mime->is(
"image/svg+xml-compressed")) {
61 if (!svg || svg->imagePath() != imagePath) {
64 svg->setImagePath(imagePath);
65 QObject::connect(svg, SIGNAL(repaintNeeded()), q, SLOT(setPixmap()));
69 svg->paint(&p, pm.rect());
73 pm = QPixmap(absImagePath);
76 static_cast<QCheckBox*
>(q->widget())->setIcon(QIcon(pm));
86 d(new CheckBoxPrivate(this))
88 QCheckBox *native =
new QCheckBox;
89 connect(native, SIGNAL(
toggled(
bool)),
this, SIGNAL(
toggled(
bool)));
91 native->setWindowIcon(QIcon());
92 native->setAttribute(Qt::WA_NoSystemBackground);
104 static_cast<QCheckBox*
>(widget())->
setText(text);
109 return static_cast<QCheckBox*
>(widget())->
text();
114 if (d->imagePath == path) {
122 bool absolutePath = !path.isEmpty() &&
124 !QDir::isRelativePath(path)
126 (path[0] ==
'/' || path.startsWith(QLatin1String(
":/")))
131 d->absImagePath = path;
147 widget()->setStyleSheet(stylesheet);
152 return widget()->styleSheet();
157 return static_cast<QCheckBox*
>(widget());
168 static_cast<QCheckBox*
>(widget())->
setChecked(checked);
173 return static_cast<QCheckBox*
>(widget())->
isChecked();
178 d->changeEvent(event);
184 #include <checkbox.moc>
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 21:58:13 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.