diff --git a/private/toolbox.cpp b/private/toolbox.cpp index 00468ea4c..e6d79d181 100644 --- a/private/toolbox.cpp +++ b/private/toolbox.cpp @@ -70,7 +70,7 @@ public: }; ToolBox::ToolBox(Containment *parent) - : QGraphicsItem(parent), + : QGraphicsWidget(parent), d(new ToolBoxPrivate(parent)) { d->userMoved = false; @@ -82,6 +82,11 @@ ToolBox::~ToolBox() delete d; } +Containment *ToolBox::containment() +{ + return d->containment; +} + QPoint ToolBox::toolPosition(int toolHeight) { switch (d->corner) { diff --git a/private/toolbox_p.h b/private/toolbox_p.h index b5d4cd2ac..ec7f5ffeb 100644 --- a/private/toolbox_p.h +++ b/private/toolbox_p.h @@ -21,8 +21,7 @@ #ifndef PLASMA_TOOLBOX_P_H #define PLASMA_TOOLBOX_P_H -#include -#include +#include #include "containment.h" @@ -37,7 +36,7 @@ namespace Plasma //class EmptyGraphicsItem; class ToolBoxPrivate; -class ToolBox : public QObject, public QGraphicsItem +class ToolBox : public QGraphicsWidget { Q_OBJECT #if QT_VERSION >= 0x040600 @@ -108,6 +107,7 @@ Q_SIGNALS: void toggled(); protected: + Containment *containment(); QPoint toolPosition(int toolHeight); void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseMoveEvent(QGraphicsSceneMouseEvent *event);