QTfrontend/ui/widget/colorwidget.h
author nemo
Fri, 24 Aug 2012 19:55:43 -0400 (2012-08-24)
changeset 7595 bbac3c0f0c68
parent 7130 fcab1fd02bc6
child 7749 edad8a7bcaea
permissions -rw-r--r--
Hey. How's this? It makes it harder to get stuck in the vertical rope position, prevents the wall trick, and also I think makes it easier to unglue a horizontal rope?
#ifndef COLORWIDGET_H
#define COLORWIDGET_H

#include <QWidget>
#include <QModelIndex>

namespace Ui {
class ColorWidget;
}

class QStandardItemModel;

class ColorWidget : public QWidget
{
    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);
};

#endif // COLORWIDGET_H