⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 colorbar.h

📁 QWT5.01用于Qt开发的二维图形库程序
💻 H
字号:
#include <qwidget.h>

class ColorBar: public QWidget
{
    Q_OBJECT

public:
    ColorBar(Qt::Orientation = Qt::Horizontal, 
        QWidget * = NULL);

    virtual void setOrientation(Qt::Orientation o);
    Qt::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:
    Qt::Orientation d_orientation;
    QColor d_light;
    QColor d_dark;
};

⌨️ 快捷键说明

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