18 switch (parameterType(
index))
22 comboBox->addItem(
"true");
23 comboBox->addItem(
"false");
30 QRegularExpression(
"^-?(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+|\\d+)$"), textField));
38 validator->setLocale(cLocale);
39 textField->setValidator(validator);
51 QRegularExpression(
"^((0[xX][0-9a-fA-FxXzZuUlLhHwW-]+)|(0[oO][0-7xXzZuUlLhHwW-]+)|(0[bB][01xXzZuUlLhHwW-]+))$"), textField));
77 if (
auto* comboBox = qobject_cast<QComboBox*>(editor))
81 else if (
auto* lineEdit = qobject_cast<QLineEdit*>(editor))
86 const QString decimal = integerToDecimalString(lineEdit->text(), ok);
111 QString ParameterValueDelegate::integerToDecimalString(
const QString& text,
bool& ok)
117 bool negative =
false;
141 const qlonglong value = digits.
toLongLong(&ok, base);
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
ParameterValueDelegate(QObject *parent=nullptr)
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
virtual bool setData(const QModelIndex &index, const QVariant &value, int role)
void setNumberOptions(QLocale::NumberOptions options)
QObject * parent() const const
QString number(int n, int base)
QString & remove(int position, int n)
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
qlonglong toLongLong(bool *ok, int base) const const
std::string toStdString() const const
QString trimmed() const const