- Timestamp:
- Apr 12, 2013, 2:45:52 PM (12 years ago)
- Location:
- trunk/GnssCenter/inpedit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/inpedit/keyword.cpp
r5091 r5092 29 29 30 30 _ok = false; 31 _type = e_type_max;32 31 _widget = 0; // do not delete (it is owned by layout) 33 32 … … 67 66 QString descVal = rx.cap(2).trimmed(); 68 67 _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 }92 68 } 93 69 } … … 113 89 } 114 90 115 if (_type == checkbox) { 91 QString widgetType = _desc.value("widget"); 92 93 if (widgetType == "checkbox") { 116 94 QCheckBox* chBox = new QCheckBox(); 117 95 if (_values.size() && _values[0] == "1") { … … 120 98 _widget = chBox; 121 99 } 122 else if ( _type == combobox) {100 else if (widgetType == "combobox") { 123 101 QComboBox* cmbBox = new QComboBox(); 124 102 _widget = cmbBox; 125 103 } 126 else if ( _type == lineedit) {104 else if (widgetType == "lineedit") { 127 105 t_lineEdit* lineEdit = new t_lineEdit(); 128 106 if (_values.size()) { … … 131 109 _widget = lineEdit; 132 110 } 133 else if ( _type == radiobutton) {111 else if (widgetType == "radiobutton") { 134 112 _widget = new QRadioButton(); 135 113 } 136 else if ( _type == selwin) {114 else if (widgetType == "selwin") { 137 115 _widget = new t_selWin(); 138 116 } 139 else if ( _type == spinbox) {117 else if (widgetType == "spinbox") { 140 118 _widget = new QSpinBox(); 141 119 } 142 else if ( _type == uniline) {120 else if (widgetType == "uniline") { 143 121 _widget = new t_uniLine(fldMask, this); 144 122 } -
trunk/GnssCenter/inpedit/keyword.h
r5091 r5092 8 8 class t_keyword { 9 9 public: 10 enum e_type {checkbox, combobox, lineedit, radiobutton,11 selwin, spinbox, uniline, e_type_max};12 13 10 t_keyword(QString line, QTextStream& inStream); 14 11 ~t_keyword(); … … 23 20 QString _name; 24 21 QStringList _values; 25 e_type _type;26 22 QWidget* _widget; 27 23 QMap<QString, QString> _desc;
Note:
See TracChangeset
for help on using the changeset viewer.