compile++

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=642024
This commit is contained in:
Matt Broadstone 2007-03-13 03:25:19 +00:00
parent 72dbcaf4f0
commit a918f6180f
2 changed files with 15 additions and 16 deletions

View File

@ -55,8 +55,7 @@ class PushButton::Private
}; };
PushButton::PushButton(QGraphicsItem *parent) PushButton::PushButton(QGraphicsItem *parent)
: DataVisualization(), : QGraphicsItem(parent),
QGraphicsItem(parent),
QLayoutItem (Qt::AlignHCenter), QLayoutItem (Qt::AlignHCenter),
d(new Private) d(new Private)
{ {
@ -72,7 +71,7 @@ PushButton::PushButton(QGraphicsItem *parent)
d->maxHeight = d->height; d->maxHeight = d->height;
setPos(QPointF(0.0,0.0)); setPos(QPointF(0.0,0.0));
d->state = PushButton::None; d->state = PushButton::None;
d->labelText = tr("Plasma"); d->labelText = QString("Plasma");
d->labelTextColor = QColor(201,201,255); d->labelTextColor = QColor(201,201,255);
d->hasIcon = false; d->hasIcon = false;
d->iconSize = QSize(32,32); d->iconSize = QSize(32,32);
@ -83,6 +82,11 @@ PushButton::~PushButton()
delete d; delete d;
} }
void PushButton::data(const DataSource::Data &data)
{
Q_UNUSED(data)
}
QRectF PushButton::boundingRect() const QRectF PushButton::boundingRect() const
{ {
return QRectF(x(), y(), d->width, d->height); return QRectF(x(), y(), d->width, d->height);
@ -108,11 +112,6 @@ void PushButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
widget-> style()->drawControl(QStyle::CE_PushButton, &options, painter, widget); widget-> style()->drawControl(QStyle::CE_PushButton, &options, painter, widget);
} }
void PushButton::data(const DataSource::Data&)
{
}
void PushButton::setText(const QString& text) void PushButton::setText(const QString& text)
{ {
d->labelText = text; d->labelText = text;
@ -205,9 +204,9 @@ void PushButton::mousePressEvent ( QGraphicsSceneMouseEvent * event )
void PushButton::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) void PushButton::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event )
{ {
event->accept(); event->accept();
d->state = PushButton::RELEASED; d->state = PushButton::Released;
update(); update();
emit clicked(); // emit clicked();
} }
QSize PushButton::sizeHint() const QSize PushButton::sizeHint() const

View File

@ -84,17 +84,17 @@ class KDE_EXPORT PushButton : public DataVisualization,
virtual QRect geometry() const ; virtual QRect geometry() const ;
virtual bool isEmpty() const {return false;} virtual bool isEmpty() const {return false;}
public Q_SLOTS:
void data(const DataSource::Data&);
Q_SIGNALS: Q_SIGNALS:
void clicked(); void clicked();
public Q_SLOTS:
virtual void data(const DataSource::Data &);
protected: protected:
bool isDown(); bool isDown();
void mousePressEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private: private:
class Private ; class Private ;
Private * const d; Private * const d;