QTfrontend/ui/widget/hatbutton.cpp
changeset 9738 18bb6d1fc9d9
parent 9080 9b42757d7e71
child 9998 736015b847e3
equal deleted inserted replaced
9737:f0769402350c 9738:18bb6d1fc9d9
    17  */
    17  */
    18 
    18 
    19 #include <QDebug>
    19 #include <QDebug>
    20 
    20 
    21 #include "hatprompt.h"
    21 #include "hatprompt.h"
    22 #include "DataManager.h"
       
    23 #include "HatModel.h"
    22 #include "HatModel.h"
    24 #include "hatbutton.h"
    23 #include "hatbutton.h"
    25 
    24 
    26 HatButton::HatButton(QWidget* parent) : QPushButton(parent)
    25 HatButton::HatButton(QWidget* parent) : QPushButton(parent)
    27 {
    26 {
    28     setIconSize(QSize(32, 37));
    27     setIconSize(QSize(32, 37));
    29     setFixedSize(44, 44);
    28     setFixedSize(44, 44);
    30 
    29 
    31     m_hatModel = DataManager::instance().hatModel();
    30     m_hatModel = 0;
    32     connect(this, SIGNAL(clicked()), this, SLOT(showPrompt()));
    31     connect(this, SIGNAL(clicked()), this, SLOT(showPrompt()));
       
    32 }
       
    33 
       
    34 void HatButton::setModel(HatModel *model)
       
    35 {
       
    36     m_hatModel = model;
    33 
    37 
    34     setCurrentIndex(0);
    38     setCurrentIndex(0);
    35 }
    39 }
    36 
    40 
    37 void HatButton::setCurrentIndex(int index)
    41 void HatButton::setCurrentIndex(int index)