Ignore:
Timestamp:
Apr 12, 2013, 2:45:52 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/inpedit/keyword.cpp

    r5091 r5092  
    2929
    3030  _ok     = false;
    31   _type   = e_type_max;
    3231  _widget = 0;  // do not delete (it is owned by layout)
    3332
     
    6766          QString descVal = rx.cap(2).trimmed();
    6867          _desc[descKey]  = descVal;
    69           if (descKey == "widget") {
    70             if      (descVal == "checkbox") {
    71               _type = checkbox;
    72             }
    73             else if (descVal == "combobox") {
    74               _type = combobox;
    75             }
    76             else if (descVal == "lineedit") {
    77               _type = lineedit;
    78             }
    79             else if (descVal == "radiobutton") {
    80               _type = radiobutton;
    81             }
    82             else if (descVal == "selwin") {
    83               _type = selwin;
    84             }
    85             else if (descVal == "spinbox") {
    86               _type = spinbox;
    87             }
    88             else if (descVal == "uniline") {
    89               _type = uniline;
    90             }
    91           }
    9268        }
    9369      }
     
    11389  }
    11490
    115   if      (_type == checkbox) {
     91  QString widgetType = _desc.value("widget");
     92
     93  if      (widgetType == "checkbox") {
    11694    QCheckBox* chBox = new QCheckBox();
    11795    if (_values.size() && _values[0] == "1") {
     
    12098    _widget = chBox;
    12199  }
    122   else if (_type == combobox) {
     100  else if (widgetType == "combobox") {
    123101    QComboBox* cmbBox = new QComboBox();
    124102    _widget = cmbBox;
    125103  }
    126   else if (_type == lineedit) {
     104  else if (widgetType == "lineedit") {
    127105    t_lineEdit* lineEdit = new t_lineEdit();
    128106    if (_values.size()) {
     
    131109    _widget = lineEdit;
    132110  }
    133   else if (_type == radiobutton) {
     111  else if (widgetType == "radiobutton") {
    134112    _widget = new QRadioButton();
    135113  }
    136   else if (_type == selwin) {
     114  else if (widgetType == "selwin") {
    137115    _widget = new t_selWin();
    138116  }
    139   else if (_type == spinbox) {
     117  else if (widgetType == "spinbox") {
    140118    _widget = new QSpinBox();
    141119  }
    142   else if (_type == uniline) {
     120  else if (widgetType == "uniline") {
    143121    _widget = new t_uniLine(fldMask, this);
    144122  }
Note: See TracChangeset for help on using the changeset viewer.