21 #include "ui_libraryeditargdialog.h"
27 #include <QStringList>
34 mMinSizes(arg.minsizes)
40 mUi->strz->setChecked(arg.
strz);
44 mUi->minsize1type->setEnabled(
true);
45 mUi->minsize1arg->setEnabled(arg.
minsizes.count() >= 1);
47 mUi->minsize2type->setEnabled(arg.
minsizes.count() >= 1);
48 mUi->minsize2arg->setEnabled(arg.
minsizes.count() >= 2);
52 items <<
"None" <<
"argvalue" <<
"mul" <<
"sizeof" <<
"strlen";
54 mUi->minsize1type->clear();
55 mUi->minsize1type->addItems(items);
57 mUi->minsize1type->setCurrentIndex(items.indexOf(
mMinSizes[0].type));
62 mUi->minsize1arg2->setValue(0);
64 mUi->minsize1type->setCurrentIndex(0);
65 mUi->minsize1arg->setValue(0);
66 mUi->minsize1arg2->setValue(0);
69 mUi->minsize2type->clear();
70 mUi->minsize2type->addItems(items);
72 mUi->minsize2type->setCurrentIndex(items.indexOf(
mMinSizes[1].type));
77 mUi->minsize2arg2->setValue(0);
79 mUi->minsize2type->setCurrentIndex(0);
80 mUi->minsize2arg->setValue(0);
81 mUi->minsize2arg2->setValue(0);
96 ret.
strz =
mUi->strz->isChecked();
98 if (
mUi->minsize1type->currentIndex() != 0) {
100 minsize1.
type =
mUi->minsize1type->currentText();
101 minsize1.
arg = QString::number(
mUi->minsize1arg->value());
102 if (minsize1.
type ==
"mul")
103 minsize1.
arg2 = QString::number(
mUi->minsize1arg2->value());
106 if (
mUi->minsize2type->currentIndex() != 0) {
108 minsize2.
type =
mUi->minsize2type->currentText();
109 minsize2.
arg = QString::number(
mUi->minsize2arg->value());
110 if (minsize2.
type ==
"mul")
111 minsize2.
arg2 = QString::number(
mUi->minsize2arg2->value());
121 mUi->minsize1arg->setEnabled(
mUi->minsize1type->currentIndex() != 0);
122 mUi->minsize1arg2->setEnabled(
mUi->minsize1type->currentText() ==
"mul");
123 mUi->minsize2type->setEnabled(
mUi->minsize1type->currentIndex() != 0);
124 mUi->minsize2arg->setEnabled(
mUi->minsize2type->currentIndex() != 0);
125 mUi->minsize2arg2->setEnabled(
mUi->minsize2type->currentText() ==
"mul");
LibraryEditArgDialog(QWidget *parent, const CppcheckLibraryData::Function::Arg &arg)
~LibraryEditArgDialog() override
Ui::LibraryEditArgDialog * mUi
CppcheckLibraryData::Function::Arg getArg() const
QList< CppcheckLibraryData::Function::Arg::MinSize > mMinSizes
QList< MinSize > minsizes