mirror of
https://github.com/Artikash/Textractor.git
synced 2024-12-23 17:04:12 +08:00
improve regex filter UX
This commit is contained in:
parent
74383ee0d8
commit
9068228427
@ -1,5 +1,6 @@
|
||||
#include "window.h"
|
||||
#include "ui_window.h"
|
||||
#include <QLabel>
|
||||
|
||||
Window::Window(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
@ -15,7 +16,9 @@ Window::~Window()
|
||||
|
||||
void Window::on_regexInput_textEdited(const QString& newRegex)
|
||||
{
|
||||
QLabel* info = findChild<QLabel*>("info");
|
||||
std::lock_guard<std::mutex> l(m);
|
||||
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>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>50</height>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -18,6 +18,16 @@
|
||||
<item>
|
||||
<widget class="QLineEdit" name="regexInput"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="info">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user