Plasma
Go to the documentation of this file.
24 #include <QRadioButton>
26 #include <kmimetype.h>
28 #include "private/themedwidgetinterface_p.h"
35 class RadioButtonPrivate :
public ThemedWidgetInterface<RadioButton>
38 RadioButtonPrivate(RadioButton *radio)
39 : ThemedWidgetInterface<RadioButton>(radio),
49 void setPixmap(RadioButton *q)
51 if (imagePath.isEmpty()) {
55 KMimeType::Ptr mime = KMimeType::findByPath(absImagePath);
56 QPixmap pm(q->size().toSize());
58 if (mime->is(
"image/svg+xml")) {
61 svg->paint(&p, pm.rect());
63 pm = QPixmap(absImagePath);
66 static_cast<QRadioButton*
>(q->widget())->setIcon(QIcon(pm));
76 d(new RadioButtonPrivate(this))
78 QRadioButton *native =
new QRadioButton;
79 connect(native, SIGNAL(
toggled(
bool)),
this, SIGNAL(
toggled(
bool)));
81 native->setWindowIcon(QIcon());
82 native->setAttribute(Qt::WA_NoSystemBackground);
93 static_cast<QRadioButton*
>(widget())->
setText(text);
98 return static_cast<QRadioButton*
>(widget())->
text();
103 if (d->imagePath == path) {
111 bool absolutePath = !path.isEmpty() &&
113 !QDir::isRelativePath(path)
115 (path[0] ==
'/' || path.startsWith(QLatin1String(
":/")))
120 d->absImagePath = path;
136 widget()->setStyleSheet(stylesheet);
141 return widget()->styleSheet();
146 return static_cast<QRadioButton*
>(widget());
157 static_cast<QRadioButton*
>(widget())->
setChecked(checked);
162 return static_cast<QRadioButton*
>(widget())->
isChecked();
167 d->changeEvent(event);
173 #include <radiobutton.moc>
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:31:03 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.