Merged in rsskga/valentina-develop/feature (pull request #150)

Resolved issue #581. Filter lists by keyword in function wizard.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-11-10 06:14:35 +00:00
commit 7e3ebe7ca2
5 changed files with 41 additions and 0 deletions

View File

@ -159,3 +159,6 @@ $RECYCLE.BIN/
# Windows shortcuts # Windows shortcuts
*.lnk *.lnk
# Understand IDE file
*.udb

View File

@ -1,4 +1,5 @@
# Version 0.5.0 # Version 0.5.0
- [#581] User can now filter input lists by keyword in function wizard.
- [#24] User can now add labels with different information on the detail - [#24] User can now add labels with different information on the detail
- [#505] New installer script based on Inno Setup 5. - [#505] New installer script based on Inno Setup 5.
- Size of preferences dialog in both Valentina and Tape app is now preserved between sessions - Size of preferences dialog in both Valentina and Tape app is now preserved between sessions

View File

@ -95,6 +95,19 @@ DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, const qui
connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogEditWrongFormula::FormulaChanged);
connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogEditWrongFormula::DeployFormulaTextEdit);
// clear text filter every time when new radio button selected
auto clearFilterFormulaInputs = [=] () { ui->filterFormulaInputs->clear(); };
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonLengthSpline, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonAngleLine, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonRadiusesArcs, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonAnglesCurves, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonCLength, &QRadioButton::clicked, this, clearFilterFormulaInputs);
connect(ui->radioButtonFunctions, &QRadioButton::clicked, this, clearFilterFormulaInputs);
//Disable Qt::WaitCursor //Disable Qt::WaitCursor
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
if (QApplication::overrideCursor() != nullptr) if (QApplication::overrideCursor() != nullptr)
@ -529,3 +542,18 @@ void DialogEditWrongFormula::ShowFunctions()
ui->tableWidget->selectRow(0); ui->tableWidget->selectRow(0);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
} }
void DialogEditWrongFormula::on_filterFormulaInputs_textEdited(const QString &filter)
{
ui->tableWidget->blockSignals(true);
// hide all rows
for (auto i = 0; i < ui->tableWidget->rowCount(); i++)
ui->tableWidget->hideRow(i);
// show rows with matched filter
for (auto item : ui->tableWidget->findItems(filter, Qt::MatchContains))
ui->tableWidget->showRow(item->row());
ui->tableWidget->blockSignals(false);
}

View File

@ -96,6 +96,8 @@ protected:
virtual void CheckState() Q_DECL_OVERRIDE; virtual void CheckState() Q_DECL_OVERRIDE;
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE; virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
private slots:
void on_filterFormulaInputs_textEdited(const QString &filter);
private: private:
Q_DISABLE_COPY(DialogEditWrongFormula) Q_DISABLE_COPY(DialogEditWrongFormula)
Ui::DialogEditWrongFormula *ui; Ui::DialogEditWrongFormula *ui;

View File

@ -355,6 +355,13 @@
</item> </item>
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="filterFormulaInputs">
<property name="placeholderText">
<string>Filter list by keyword</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QCheckBox" name="checkBoxHideEmpty"> <widget class="QCheckBox" name="checkBoxHideEmpty">
<property name="text"> <property name="text">