#include <FilterTextEdit.hpp>
Allows filtering of text in a text edit. This will keep track of the 'original' text so that changes to the filter will be redone on that text. Example:
fte.
setPlainText(
"This is a first line\nThis is a second line");
void setPlainText(const QString &text)
It now shows:
This is a first line
This is a second line
One can for example filter on the word 'first'
void setFilter(const QString &filter)
It now shows:
This is a first line
If another filter is set the 'original' text is re-filtered:
It now shows:
This is a second line
Definition at line 46 of file FilterTextEdit.hpp.
◆ FilterTextEdit()
daq::QTUtils::FilterTextEdit::FilterTextEdit |
( |
QWidget * | parent | ) |
|
|
inline |
◆ ~FilterTextEdit()
virtual daq::QTUtils::FilterTextEdit::~FilterTextEdit |
( |
| ) |
|
|
inlinevirtual |
◆ append()
void daq::QTUtils::FilterTextEdit::append |
( |
const QString & | text | ) |
|
|
inline |
◆ clear
void daq::QTUtils::FilterTextEdit::clear |
( |
| ) |
|
|
inlineprivateslot |
◆ filterAndSet()
void daq::QTUtils::FilterTextEdit::filterAndSet |
( |
const QString & | text | ) |
|
|
inlineprivate |
Definition at line 80 of file FilterTextEdit.hpp.
80 {
82 QStringList strings= text.split("\n");
85 } else {
86 QStringList result;
87 foreach(QString str, strings) {
90 }
91 }
92 strings = result;
93 }
94 QString filtered= strings.join("\n");
95 QTextEdit::setPlainText(filtered);
96 } else {
97 QTextEdit::setPlainText(text);
98 }
99 }
◆ setFilter()
void daq::QTUtils::FilterTextEdit::setFilter |
( |
const QString & | filter | ) |
|
|
inline |
◆ setInversion()
void daq::QTUtils::FilterTextEdit::setInversion |
( |
bool | invert | ) |
|
|
inline |
◆ setPlainText()
void daq::QTUtils::FilterTextEdit::setPlainText |
( |
const QString & | text | ) |
|
|
inline |
◆ m_filter
QString daq::QTUtils::FilterTextEdit::m_filter |
|
private |
◆ m_invert
bool daq::QTUtils::FilterTextEdit::m_invert |
|
private |
◆ m_original
QString daq::QTUtils::FilterTextEdit::m_original |
|
private |
The documentation for this class was generated from the following file: