- case QVariant::Int:
- widget = new QSpinBox(fieldBox);
- // Here we assume that int fields are always in 16 bit range, like ports
- static_cast<QSpinBox *>(widget)->setMinimum(0);
- static_cast<QSpinBox *>(widget)->setMaximum(65535);
- static_cast<QSpinBox *>(widget)->setValue(std::get<2>(fieldInfo).toInt());
- break;
- case QVariant::String:
- widget = new QLineEdit(std::get<2>(fieldInfo).toString(), fieldBox);
- // Here we assume that fields named something with "password" are actual password inputs
- if (std::get<0>(fieldInfo).toLower().contains("password"))
- static_cast<QLineEdit *>(widget)->setEchoMode(QLineEdit::Password);
- break;
- default:
- qWarning() << "Unsupported type for backend property" << std::get<0>(fieldInfo);
+ case QVariant::Int:
+ widget = new QSpinBox(fieldBox);
+ // Here we assume that int fields are always in 16 bit range, like ports
+ static_cast<QSpinBox*>(widget)->setMinimum(0);
+ static_cast<QSpinBox*>(widget)->setMaximum(65535);
+ static_cast<QSpinBox*>(widget)->setValue(std::get<2>(fieldInfo).toInt());
+ break;
+ case QVariant::String:
+ widget = new QLineEdit(std::get<2>(fieldInfo).toString(), fieldBox);
+ // Here we assume that fields named something with "password" are actual password inputs
+ if (std::get<0>(fieldInfo).toLower().contains("password"))
+ static_cast<QLineEdit*>(widget)->setEchoMode(QLineEdit::Password);
+ break;
+ default:
+ qWarning() << "Unsupported type for backend property" << std::get<0>(fieldInfo);