From 9068228427fe5bbcf322841b84a8a341fd24b40c Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 3 Dec 2018 18:29:54 -0500 Subject: [PATCH] improve regex filter UX --- extensions/regexfilter/window.cpp | 5 ++++- extensions/regexfilter/window.ui | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/extensions/regexfilter/window.cpp b/extensions/regexfilter/window.cpp index 0eaf84c..8a7b7dc 100644 --- a/extensions/regexfilter/window.cpp +++ b/extensions/regexfilter/window.cpp @@ -1,5 +1,6 @@ #include "window.h" #include "ui_window.h" +#include Window::Window(QWidget *parent) : QMainWindow(parent), @@ -15,7 +16,9 @@ Window::~Window() void Window::on_regexInput_textEdited(const QString& newRegex) { + QLabel* info = findChild("info"); std::lock_guard l(m); try { regex = newRegex.toStdWString(); } - catch (...) {} + catch (...) { return findChild("info")->setText("Invalid regex"); } + findChild("info")->setText("Currently filtering: " + newRegex); } diff --git a/extensions/regexfilter/window.ui b/extensions/regexfilter/window.ui index 14766ee..1b1f9f1 100644 --- a/extensions/regexfilter/window.ui +++ b/extensions/regexfilter/window.ui @@ -7,7 +7,7 @@ 0 0 350 - 50 + 60 @@ -18,6 +18,16 @@ + + + + + + + Qt::AlignCenter + + +