GUI: Tweak the 'Human knowledge' tab

This commit is contained in:
Daniel Marjamäki 2019-07-11 14:00:32 +02:00
parent f239d4675b
commit 8eaa50c050
2 changed files with 110 additions and 140 deletions

View File

@ -178,6 +178,15 @@ ProjectFileDialog::ProjectFileDialog(ProjectFile *projectFile, QWidget *parent)
const QRegExp undefRegExp("\\s*([a-zA-Z_][a-zA-Z0-9_]*[; ]*)*"); const QRegExp undefRegExp("\\s*([a-zA-Z_][a-zA-Z0-9_]*[; ]*)*");
mUI.mEditUndefines->setValidator(new QRegExpValidator(undefRegExp, this)); mUI.mEditUndefines->setValidator(new QRegExpValidator(undefRegExp, this));
// Human knowledge..
mUI.mListUnknownFunctionReturn->clear();
mUI.mListUnknownFunctionReturn->addItem("rand()");
for (int row = 0; row < mUI.mListUnknownFunctionReturn->count(); ++row) {
QListWidgetItem *item = mUI.mListUnknownFunctionReturn->item(row);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable); // set checkable flag
item->setCheckState(item->text() == "rand()" ? Qt::Checked : Qt::Unchecked); // AND initialize check state
}
connect(mUI.mButtons, &QDialogButtonBox::accepted, this, &ProjectFileDialog::ok); connect(mUI.mButtons, &QDialogButtonBox::accepted, this, &ProjectFileDialog::ok);
connect(mUI.mBtnBrowseBuildDir, &QPushButton::clicked, this, &ProjectFileDialog::browseBuildDir); connect(mUI.mBtnBrowseBuildDir, &QPushButton::clicked, this, &ProjectFileDialog::browseBuildDir);
connect(mUI.mBtnClearImportProject, &QPushButton::clicked, this, &ProjectFileDialog::clearImportProject); connect(mUI.mBtnClearImportProject, &QPushButton::clicked, this, &ProjectFileDialog::clearImportProject);

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>642</width> <width>888</width>
<height>585</height> <height>585</height>
</rect> </rect>
</property> </property>
@ -415,154 +415,115 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="mTabCustom"> <widget class="QWidget" name="mTabHumanKnownledge">
<attribute name="title"> <attribute name="title">
<string>Custom</string> <string>Human knowledge</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_19"> <layout class="QVBoxLayout" name="verticalLayout_19">
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QGroupBox" name="groupBox_13">
<property name="horizontalScrollBarPolicy"> <property name="title">
<enum>Qt::ScrollBarAlwaysOff</enum> <string>Input from file/network/user/...</string>
</property> </property>
<property name="widgetResizable"> <layout class="QVBoxLayout" name="verticalLayout_14">
<bool>true</bool> <item>
</property> <widget class="QLabel" name="label_6">
<widget class="QWidget" name="scrollAreaWidgetContents"> <property name="text">
<property name="geometry"> <string>If the return value from a function below is always completely unknown, then click on its checkbox</string>
<rect> </property>
<x>0</x> <property name="wordWrap">
<y>0</y> <bool>true</bool>
<width>605</width> </property>
<height>522</height> </widget>
</rect> </item>
</property> <item>
<layout class="QVBoxLayout" name="verticalLayout_22"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QLabel" name="label_10"> <widget class="QListWidget" name="mListUnknownFunctionReturn">
<property name="text"> <property name="maximumSize">
<string>Here it will be possible to configure &quot;human knowledge&quot; about your project.</string> <size>
</property> <width>16777215</width>
</widget> <height>60</height>
</item> </size>
<item> </property>
<widget class="QGroupBox" name="groupBox_13">
<property name="title">
<string>Arbitrary input from file/network/user/...</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<item> <item>
<widget class="QLabel" name="label_6"> <property name="text">
<property name="text"> <string>rand()</string>
<string>TODO: Select the functions that give your project &quot;arbitrary input&quot; ....</string> </property>
</property>
</widget>
</item> </item>
</layout> </widget>
</widget> </item>
</item> <item>
<item> <widget class="QPushButton" name="mButtonAddUnknownFunctionReturn">
<widget class="QGroupBox" name="groupBox_14"> <property name="enabled">
<property name="title"> <bool>false</bool>
<string>Interface headers</string> </property>
</property> <property name="text">
<layout class="QVBoxLayout" name="verticalLayout_20"> <string>Add..</string>
<item> </property>
<widget class="QLabel" name="label_8"> </widget>
<property name="text"> </item>
<string>TODO: Select &quot;interface&quot; headers. All public functions/variables in these must be &quot;safe&quot;.</string> </layout>
</property> </item>
</widget> </layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>Possible values of function parameters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QCheckBox" name="mAllFunctionsAreSafe">
<property name="text">
<string>Experimental: All function parameters can have arbitrary values</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>TODO: Configure possible values of function parameters</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Note: It must be possible to define parameter values in the code using annotations in the code (SAL , code contracts, etc)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_12">
<property name="title">
<string>Classes</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>All classes must have a &quot;safe&quot; public interface</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>&quot;Safe&quot; classes:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_15">
<property name="title">
<string>Global variables</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
<widget class="QLabel" name="label_9">
<property name="text">
<string>TODO: Possible values of global variables</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_11">
<property name="title">
<string>Possible values of function parameters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QCheckBox" name="mAllFunctionsAreSafe">
<property name="text">
<string>Experimental: All function parameters can have arbitrary values</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>TODO: Configure possible values of function parameters</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Note: It must be possible to define parameter values in the code using annotations in the code (SAL , code contracts, etc)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>All classes must have a &quot;safe&quot; public interface</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="mTabWarningOptions"> <widget class="QWidget" name="mTabWarningOptions">