svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=796617
This commit is contained in:
Alexis Ménard 2008-04-13 21:47:47 +00:00
parent 1605283e9e
commit 2cc5870dd6
3 changed files with 14 additions and 13 deletions

View File

@ -28,7 +28,8 @@
#include <KDebug> #include <KDebug>
#include "widgets/widget.h" #include <plasma/applet.h>
namespace Plasma namespace Plasma
{ {
@ -296,7 +297,7 @@ void DesktopToolbox::toolMoved(QGraphicsItem *item)
{ {
//kDebug() << "geometry is now " << static_cast<Plasma::Widget*>(item)->geometry(); //kDebug() << "geometry is now " << static_cast<Plasma::Widget*>(item)->geometry();
if (!m_showing && if (!m_showing &&
QGraphicsItem::children().indexOf(static_cast<Plasma::Widget*>(item)) != -1) { QGraphicsItem::children().indexOf(static_cast<Plasma::Applet*>(item)) != -1) {
item->hide(); item->hide();
} }
} }

View File

@ -256,14 +256,14 @@ void IconAction::paint(QPainter *painter) const
} }
Icon::Icon(QGraphicsItem *parent) Icon::Icon(QGraphicsItem *parent)
: Plasma::Widget(parent), : QGraphicsWidget(parent),
d(new Private) d(new Private)
{ {
init(); init();
} }
Icon::Icon(const QString &text, QGraphicsItem *parent) Icon::Icon(const QString &text, QGraphicsItem *parent)
: Plasma::Widget(parent), : QGraphicsWidget(parent),
d(new Private) d(new Private)
{ {
setText(text); setText(text);
@ -271,7 +271,7 @@ Icon::Icon(const QString &text, QGraphicsItem *parent)
} }
Icon::Icon(const QIcon &icon, const QString &text, QGraphicsItem *parent) Icon::Icon(const QIcon &icon, const QString &text, QGraphicsItem *parent)
: Plasma::Widget(parent), : QGraphicsWidget(parent),
d(new Private) d(new Private)
{ {
setText(text); setText(text);
@ -831,7 +831,7 @@ void Icon::Private::drawTextItems(QPainter *painter, const QStyleOptionGraphicsI
} }
void Icon::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{ {
Q_UNUSED(widget) Q_UNUSED(widget)
@ -974,7 +974,7 @@ bool Icon::isDown()
void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event) void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (event->button() != Qt::LeftButton) { if (event->button() != Qt::LeftButton) {
Widget::mousePressEvent(event); QGraphicsWidget::mousePressEvent(event);
return; return;
} }
@ -999,7 +999,7 @@ void Icon::mousePressEvent(QGraphicsSceneMouseEvent *event)
void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (~d->states & Private::PressedState) { if (~d->states & Private::PressedState) {
Widget::mouseMoveEvent(event); QGraphicsWidget::mouseMoveEvent(event);
return; return;
} }
@ -1019,7 +1019,7 @@ void Icon::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void Icon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
if (~d->states & Private::PressedState) { if (~d->states & Private::PressedState) {
Widget::mouseMoveEvent(event); QGraphicsWidget::mouseMoveEvent(event);
return; return;
} }
@ -1069,7 +1069,7 @@ void Icon::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
hoverEffect(true); hoverEffect(true);
update(); update();
Widget::hoverEnterEvent(event); QGraphicsWidget::hoverEnterEvent(event);
} }
void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
@ -1082,7 +1082,7 @@ void Icon::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
hoverEffect(false); hoverEffect(false);
update(); update();
Widget::hoverLeaveEvent(event); QGraphicsWidget::hoverLeaveEvent(event);
} }
void Icon::setPressed(bool pressed) void Icon::setPressed(bool pressed)

View File

@ -45,7 +45,7 @@ class QAction;
namespace Plasma namespace Plasma
{ {
class PLASMA_EXPORT Icon : public Plasma::Widget class PLASMA_EXPORT Icon : public QGraphicsWidget
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY( QString text READ text WRITE setText ) Q_PROPERTY( QString text READ text WRITE setText )
@ -210,7 +210,7 @@ public Q_SLOTS:
void setUnpressed(); void setUnpressed();
protected: protected:
void paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
Q_SIGNALS: Q_SIGNALS:
/** /**