Mercurial > hg > svgui
view widgets/LEDButton.h @ 35:10ba9276a315
* Add TextModel and TextLayer types
* Make View refresh work better when editing a model (previously edits might
not be refreshed if their visible changed area extended beyond the strict
frame range that was being modified in the model)
* Add phase-adjusted instantaneous frequency display to spectrogram layer
(still a work in progress)
* Pull maths aliases out into a separate header in dsp/maths so MathUtilities
can be included without introducing them
author | Chris Cannam |
---|---|
date | Mon, 20 Feb 2006 13:33:36 +0000 |
parents | c43f2c4f66f2 |
children | 01ab51f72e84 |
line wrap: on
line source
/* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ /* A waveform viewer and audio annotation editor. Chris Cannam, Queen Mary University of London, 2005-2006 This is experimental software. Not for distribution. */ /* This is a modified version of a source file from the KDE libraries. Copyright (c) 1998-2004 Jörg Habenicht, Richard J Moore and others, distributed under the GNU Lesser General Public License. Ported to Qt4 by Chris Cannam. The original KDE widget comes in round and rectangular and flat, raised, and sunken variants. This version retains only the round sunken variant. This version also implements a simple button API. */ #ifndef _LED_BUTTON_H_ #define _LED_BUTTON_H_ #include <QWidget> class QColor; class LEDButton : public QWidget { Q_OBJECT Q_PROPERTY(QColor color READ color WRITE setColor) Q_PROPERTY(int darkFactor READ darkFactor WRITE setDarkFactor) public: LEDButton(QWidget *parent = 0); LEDButton(const QColor &col, QWidget *parent = 0); LEDButton(const QColor& col, bool state, QWidget *parent = 0); ~LEDButton(); bool state() const; QColor color() const; int darkFactor() const; virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; signals: void stateChanged(bool); public slots: void toggle(); void on(); void off(); void setState(bool); void toggleState(); void setColor(const QColor& color); void setDarkFactor(int darkfactor); protected: void paintEvent(QPaintEvent *); void mousePressEvent(QMouseEvent *); private: bool led_state; QColor led_color; private: class LEDButtonPrivate; LEDButtonPrivate *d; }; #endif