* make a QGrahpicsWidget

* provide access to the containment pointer

svn path=/trunk/KDE/kdelibs/; revision=1032379
This commit is contained in:
Aaron J. Seigo 2009-10-07 17:08:44 +00:00
parent d8e084c77e
commit 4fc13d171a
2 changed files with 9 additions and 4 deletions

View File

@ -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) {

View File

@ -21,8 +21,7 @@
#ifndef PLASMA_TOOLBOX_P_H
#define PLASMA_TOOLBOX_P_H
#include <QGraphicsItem>
#include <QObject>
#include <QGraphicsWidget>
#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);