- if ((aWgtType.length() > 0) && (aWgtType == "radiobuttons")) {
- myButtons = new QButtonGroup(this);
- QGroupBox* aGroupBox = new QGroupBox(aLabelText, this);
- aLayout->addWidget(aGroupBox);
-
-
- QLayout* aBtnLayout = 0;
- std::string aWgtDir = theData->getProperty("buttons_dir");
- if (aWgtDir == "horizontal")
- aBtnLayout = new QHBoxLayout(aGroupBox);
- else
- aBtnLayout = new QVBoxLayout(aGroupBox);
- ModuleBase_Tools::adjustMargins(aBtnLayout);
-
- std::string aIcons = theData->getProperty("icons_list");
- QStringList aIconList = QString(aIcons.c_str()).split(' ');
- if (aIconList.length() == aList.length()) {
- int aId = 0;
- foreach(QString aBtnTxt, aList) {
- QToolButton* aBtn = new QToolButton(aGroupBox);
- aBtn->setCheckable(true);
- aBtn->setToolTip(aBtnTxt);
-
- QPixmap aIcon(aIconList.at(aId));
- aBtn->setIcon(aIcon);
- aBtn->setIconSize(aIcon.size());
-
- aBtnLayout->addWidget(aBtn);
- myButtons->addButton(aBtn, aId++);
- }