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

View File

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

View File

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