Commit 878ba466 authored by Thomas Gubler's avatar Thomas Gubler

add keyboard shortcut for plot filtering

parent 6e882d95
......@@ -221,7 +221,7 @@
<item row="1" column="0">
<widget class="QLineEdit" name="plotFilterLineEdit">
<property name="placeholderText">
<string>Filter...</string>
<string>Filter... (Ctrl+F)</string>
</property>
</widget>
</item>
......
......@@ -106,6 +106,7 @@ LinechartWidget::LinechartWidget(int systemid, QWidget *parent) : QWidget(parent
connect(ui.recolorButton, SIGNAL(clicked()), this, SLOT(recolor()));
connect(ui.shortNameCheckBox, SIGNAL(clicked(bool)), this, SLOT(setShortNames(bool)));
connect(ui.plotFilterLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(filterCurves(const QString&)));
new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F), this, SLOT(setPlotFilterLineEditFocus()));
int labelRow = curvesWidgetLayout->rowCount();
......@@ -694,6 +695,11 @@ void LinechartWidget::recolor()
}
}
void LinechartWidget::setPlotFilterLineEditFocus()
{
ui.plotFilterLineEdit->setFocus(Qt::ShortcutFocusReason);
}
void LinechartWidget::filterCurve(const QString &key, bool match)
{
colorIcons[key]->setVisible(match);
......
......@@ -108,6 +108,8 @@ public slots:
void readSettings();
/** @brief Select all curves */
void selectAllCurves(bool all);
/** @brief Sets the focus to the LineEdit for plot-filtering */
void setPlotFilterLineEditFocus();
private slots:
/** Called when the user changes the time scale combobox. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment