QTfrontend/ui/widget/colorwidget.h
author Wuzzy <Wuzzy2@mail.ru>
Thu, 13 Dec 2018 12:38:16 +0100
changeset 14422 b2d0c72b5d89
parent 8434 4821897a0f10
permissions -rw-r--r--
Backed out changeset e60e2e7dd43a to restore pre-0.9.25 string changes

#ifndef COLORWIDGET_H
#define COLORWIDGET_H

#include <QFrame>
#include <QModelIndex>

namespace Ui {
class ColorWidget;
}

class QStandardItemModel;

class ColorWidget : public QFrame
{
    Q_OBJECT

public:
    explicit ColorWidget(QStandardItemModel *colorsModel, QWidget *parent = 0);
    ~ColorWidget();

    void setColors(QStandardItemModel * colorsModel);
    void setColor(int color);
    int getColor();

signals:
    void colorChanged(int color);

private:
    int m_color;
    QStandardItemModel * m_colorsModel;

private slots:
    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);

protected:
    void mousePressEvent(QMouseEvent * event);
    void wheelEvent(QWheelEvent * event);
    void nextColor();
    void previousColor();
};

#endif // COLORWIDGET_H