QTfrontend/ui/widget/colorwidget.h
author koda
Tue, 21 Jan 2014 22:38:13 +0100
changeset 10015 4feced261c68
parent 8434 4821897a0f10
permissions -rw-r--r--
partial merge of the webgl branch This commit contains the new pas2c conversion tool, the pascal to c build structure and the opengl2 rendering backend. Patch reviewed by unC0Rr.

#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