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)
: DataVisualization(),
QGraphicsItem(parent),
: QGraphicsItem(parent),
QLayoutItem (Qt::AlignHCenter),
d(new Private)
{
@ -72,7 +71,7 @@ PushButton::PushButton(QGraphicsItem *parent)
d->maxHeight = d->height;
setPos(QPointF(0.0,0.0));
d->state = PushButton::None;
d->labelText = tr("Plasma");
d->labelText = QString("Plasma");
d->labelTextColor = QColor(201,201,255);
d->hasIcon = false;
d->iconSize = QSize(32,32);
@ -83,6 +82,11 @@ PushButton::~PushButton()
delete d;
}
void PushButton::data(const DataSource::Data &data)
{
Q_UNUSED(data)
}
QRectF PushButton::boundingRect() const
{
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);
}
void PushButton::data(const DataSource::Data&)
{
}
void PushButton::setText(const QString& text)
{
d->labelText = text;
@ -199,15 +198,15 @@ void PushButton::mousePressEvent ( QGraphicsSceneMouseEvent * event )
event->accept();
d->state = PushButton::Pressed;
update();
// emit clicked();
// emit clicked();
}
void PushButton::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event )
{
event->accept();
d->state = PushButton::RELEASED;
d->state = PushButton::Released;
update();
emit clicked();
// emit clicked();
}
QSize PushButton::sizeHint() const

View File

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