a ctor with a QGraphicsItem as parent as it should always had

svn path=/trunk/KDE/kdelibs/; revision=1081047
This commit is contained in:
Marco Martin 2010-01-27 16:03:47 +00:00
parent 99cd8006e6
commit 189289660c
2 changed files with 23 additions and 5 deletions

View File

@ -53,6 +53,7 @@ public:
delete pixmap;
}
void init();
void syncBorders();
QFont widgetFont() const;
@ -68,6 +69,16 @@ public:
bool customFont;
};
void FramePrivate::init()
{
svg = new Plasma::FrameSvg(q);
svg->setImagePath("widgets/frame");
svg->setElementPrefix("plain");
syncBorders();
QObject::connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), q, SLOT(syncBorders()));
}
QFont FramePrivate::widgetFont() const
{
if (customFont) {
@ -96,12 +107,14 @@ Frame::Frame(QGraphicsWidget *parent)
: QGraphicsWidget(parent),
d(new FramePrivate(this))
{
d->svg = new Plasma::FrameSvg(this);
d->svg->setImagePath("widgets/frame");
d->svg->setElementPrefix("plain");
d->syncBorders();
d->init();
}
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(syncBorders()));
Frame::Frame(QGraphicsItem *parent)
: QGraphicsWidget(parent),
d(new FramePrivate(this))
{
d->init();
}
Frame::~Frame()

View File

@ -62,6 +62,11 @@ public:
* @arg parent the parent of this widget
*/
explicit Frame(QGraphicsWidget *parent = 0);
/**
* @since 4.5
*/
explicit Frame(QGraphicsItem *parent = 0);
~Frame();
/**