colorbar.h

来自「This a framework to test new ideas in tr」· C头文件 代码 · 共 38 行

H
38
字号
#include <qwidget.h>class ColorBar: public QWidget{    Q_OBJECT    Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation )    Q_PROPERTY( QColor light READ light WRITE setLight )    Q_PROPERTY( QColor dark READ dark WRITE setDark )public:    ColorBar(Orientation = Qt::Horizontal,         QWidget * = NULL, const char *name = 0);    virtual void setOrientation(Orientation o);    Orientation orientation() const { return d_orientation; }    void setRange(const QColor &light, const QColor &dark);    void setLight(const QColor &light);    void setDark(const QColor &dark);    QColor light() const { return d_light; }    QColor dark() const { return d_dark; }signals:    void selected(const QColor &);protected:    virtual void mousePressEvent(QMouseEvent *);    virtual void paintEvent(QPaintEvent *);    void drawColorBar(QPainter *, const QRect &) const;private:    Orientation d_orientation;    QColor d_light;    QColor d_dark;};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?