QTfrontend/ui/widget/colorwidget.h
author unc0rr
Thu, 05 Dec 2013 00:51:27 +0400
changeset 9753 9579596cf471
parent 8434 4821897a0f10
permissions -rw-r--r--
- Special rooms which stay even when last player quits. Not useful for now, and can't be removed at all. - Define default value for SCRIPT in room config - Allow server admins to join 'registered users only' room

#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