first commit
This commit is contained in:
43
project/fm_viewer/cfg/rm_group_combo_box.cpp
Normal file
43
project/fm_viewer/cfg/rm_group_combo_box.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "rm_group_combo_box.h"
|
||||
#include <QStyleOption>
|
||||
#include <QPainter>
|
||||
#include <QLabel>
|
||||
#include <QDebug>
|
||||
#include "rm_combo_box.h"
|
||||
#if (USE_JSON_SETTINGS)
|
||||
#include <QJsonObject>
|
||||
#include "rm_settings_cfg.h"
|
||||
RMGroupComboBox::RMGroupComboBox(QWidget *parent,int index) : QGroupBox(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||
setObjectName("settings");
|
||||
QJsonObject obj = CFG::items.at(index).toObject();
|
||||
if(obj.contains("title")) {
|
||||
setTitle(obj.value("title").toString());
|
||||
}
|
||||
|
||||
layout = new QVBoxLayout(this);
|
||||
layout->setAlignment(Qt::AlignVCenter | Qt::AlignLeading);
|
||||
layout->setContentsMargins(8,2,8,2);
|
||||
layout->setSpacing(3);
|
||||
|
||||
|
||||
comboBox = new RMComboBox(this,"",index);
|
||||
layout->addWidget(comboBox);
|
||||
}
|
||||
#else
|
||||
RMGroupComboBox::RMGroupComboBox(QWidget *parent,QString title, QStringList titles,unsigned char* value,QList<int> indexMap) : QGroupBox(parent)
|
||||
{
|
||||
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||
setObjectName("settings");
|
||||
setTitle(title);
|
||||
|
||||
layout = new QVBoxLayout(this);
|
||||
layout->setAlignment(Qt::AlignVCenter | Qt::AlignLeading);
|
||||
layout->setContentsMargins(8,2,8,2);
|
||||
layout->setSpacing(3);
|
||||
|
||||
comboBox = new RMComboBox(this,"",titles,value,indexMap);
|
||||
layout->addWidget(comboBox);
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user