SVN_SILENT:fixed some signal-slot issuses
svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=639521
This commit is contained in:
parent
f084f1d722
commit
dcdcafe4df
@ -24,6 +24,7 @@
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
||||
#include "pushbutton.h"
|
||||
#include "pushbutton.moc"
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
@ -80,15 +81,7 @@ void PushButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
|
||||
options.state = option->state;
|
||||
options.rect = boundingRect().toRect();
|
||||
options.text = text();
|
||||
|
||||
if (option->state & QStyle::State_Enabled) {
|
||||
painter->setPen(option->palette.mid().color());
|
||||
painter->setBrush(option->palette.buttonText());
|
||||
} else {
|
||||
painter->setPen(option->palette.buttonText().color());
|
||||
painter->setBrush(option->palette.mid());
|
||||
}
|
||||
|
||||
|
||||
widget->style()->drawPrimitive(QStyle::PE_PanelButtonCommand, &options, painter, widget);
|
||||
widget->style()->drawPrimitive(QStyle::PE_FrameFocusRect, &options, painter, widget);
|
||||
widget-> style()->drawControl(QStyle::CE_PushButton, &options, painter, widget);
|
||||
@ -176,5 +169,6 @@ void PushButton::mousePressEvent ( QGraphicsSceneMouseEvent * event )
|
||||
event->accept();
|
||||
d->state = PushButton::PRESSED;
|
||||
update();
|
||||
emit clicked();
|
||||
}
|
||||
} // namespace Plasma
|
||||
|
@ -19,6 +19,7 @@
|
||||
#ifndef PUSHBUTTON_H
|
||||
#define PUSHBUTTON_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QGraphicsTextItem>
|
||||
|
||||
#include <kdemacros.h>
|
||||
@ -31,9 +32,9 @@
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class KDE_EXPORT PushButton : public QGraphicsItem,
|
||||
public DataVisualization
|
||||
class KDE_EXPORT PushButton : public DataVisualization,public QGraphicsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
typedef enum {RECT=0,ROUND,COUSTOM} ButtonShape;
|
||||
typedef enum {NONE,HOVER,PRESSED,RELEASED} ButtonState;
|
||||
@ -53,9 +54,9 @@ class KDE_EXPORT PushButton : public QGraphicsItem,
|
||||
int width();
|
||||
int height();
|
||||
|
||||
public Q_SLOTS:
|
||||
public slots:
|
||||
void data(const DataSource::Data&);
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void clicked();
|
||||
protected:
|
||||
bool isDown();
|
||||
|
Loading…
Reference in New Issue
Block a user