compile++
svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=642024
This commit is contained in:
parent
72dbcaf4f0
commit
a918f6180f
@ -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;
|
||||
@ -205,9 +204,9 @@ void PushButton::mousePressEvent ( QGraphicsSceneMouseEvent * event )
|
||||
void PushButton::mouseReleaseEvent ( QGraphicsSceneMouseEvent * event )
|
||||
{
|
||||
event->accept();
|
||||
d->state = PushButton::RELEASED;
|
||||
d->state = PushButton::Released;
|
||||
update();
|
||||
emit clicked();
|
||||
// emit clicked();
|
||||
}
|
||||
|
||||
QSize PushButton::sizeHint() const
|
||||
|
@ -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);
|
||||
|
||||
private:
|
||||
class Private ;
|
||||
Private * const d;
|
||||
|
Loading…
Reference in New Issue
Block a user