SVN_SILENT:fixed some signal-slot issuses

svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=639521
This commit is contained in:
Siraj Razick 2007-03-05 09:00:26 +00:00
parent f084f1d722
commit dcdcafe4df
2 changed files with 8 additions and 13 deletions

View File

@ -24,6 +24,7 @@
#include <QGraphicsSceneMouseEvent>
#include "pushbutton.h"
#include "pushbutton.moc"
namespace Plasma
{
@ -81,14 +82,6 @@ void PushButton::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
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

View File

@ -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();