QTfrontend/ui/widget/colorwidget.h
author nemo
Wed, 08 Aug 2012 20:32:27 -0400
changeset 7523 0790527b4e00
parent 7130 fcab1fd02bc6
child 7749 edad8a7bcaea
permissions -rw-r--r--
When exiting a room where one was host, server sends a REMOVE_TEAM for the local team. It appears that this loop would not break in that case. Add a log message and a break. (I've hit a frozen frontend twice now)

#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