improve regex filter UX
This commit is contained in:
parent
74383ee0d8
commit
9068228427
@ -1,5 +1,6 @@
|
|||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "ui_window.h"
|
#include "ui_window.h"
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
Window::Window(QWidget *parent) :
|
Window::Window(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
@ -15,7 +16,9 @@ Window::~Window()
|
|||||||
|
|
||||||
void Window::on_regexInput_textEdited(const QString& newRegex)
|
void Window::on_regexInput_textEdited(const QString& newRegex)
|
||||||
{
|
{
|
||||||
|
QLabel* info = findChild<QLabel*>("info");
|
||||||
std::lock_guard<std::mutex> l(m);
|
std::lock_guard<std::mutex> l(m);
|
||||||
try { regex = newRegex.toStdWString(); }
|
try { regex = newRegex.toStdWString(); }
|
||||||
catch (...) {}
|
catch (...) { return findChild<QLabel*>("info")->setText("Invalid regex"); }
|
||||||
|
findChild<QLabel*>("info")->setText("Currently filtering: " + newRegex);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>350</width>
|
<width>350</width>
|
||||||
<height>50</height>
|
<height>60</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -18,6 +18,16 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="regexInput"/>
|
<widget class="QLineEdit" name="regexInput"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="info">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
Reference in New Issue
Block a user