#ifndef RM_RADIO_BUTTONS_H #define RM_RADIO_BUTTONS_H #include #include #include #include #include #include "rm_value_selector.h" class RMRadioButtons : public QWidget, public RMValueSelector { Q_OBJECT public: #if (USE_JSON_SETTINGS) explicit RMRadioButtons(QWidget *parent,QString title, int object); explicit RMRadioButtons(QWidget *parent,QString title, int object, bool rowType); #else // USE_JSON_SETTINGS explicit RMRadioButtons(QWidget *parent,QString title, QStringList titles,unsigned char* value, QList indexMap = QList()); explicit RMRadioButtons(QWidget *parent,QString title, QStringList titles,unsigned char* value, bool rowType = false,QList indexMap = QList()); #endif // USE_JSON_SETTINGS QBoxLayout* layout; //QHBoxLayout* layout; QLabel* titleLabel; void setCurrentIndex(int index); int currentIndex(); private: QList buttons; void paintEvent(QPaintEvent *pe); signals: void selected(int index); private slots: void onSelected(); void onUpdateByValue(); }; #endif // RM_RADIO_BUTTONS_H