33 #include "ui_findnotification.h"
42 , EscShortcut_ (new QShortcut (QString (
"Esc"), this, SLOT (reject ())))
46 setFocusProxy (Ui_->Pattern_);
48 EscShortcut_->setContext (Qt::WidgetWithChildrenShortcut);
60 EscShortcut_->setEnabled (close);
65 Ui_->Pattern_->setText (text);
70 return Ui_->Pattern_->text ();
75 QString ss = QString (
"QLineEdit {"
76 "background-color:rgb(");
78 ss.append (
"255,0,0");
81 auto color = QApplication::palette ().color (QPalette::Base);
82 color.setRedF (color.redF () / 2);
83 color.setBlueF (color.blueF () / 2);
85 int r = 0, g = 0, b = 0;
86 color.getRgb (&r, &g, &b);
88 ss.append (QString (
"%1,%2,%3")
94 Ui_->Pattern_->setStyleSheet (ss);
100 if (Ui_->MatchCase_->checkState () == Qt::Checked)
102 if (Ui_->WrapAround_->checkState () == Qt::Checked)
130 void FindNotification::on_Pattern__textChanged (
const QString& newText)
132 Ui_->FindButton_->setEnabled (!newText.isEmpty ());
135 void FindNotification::on_FindButton__released ()
138 if (Ui_->SearchBackwards_->checkState () == Qt::Checked)
144 void FindNotification::reject ()
146 Ui_->Pattern_->clear ();
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
void SetText(const QString &text)
Sets the text in the find field.
void findPrevious()
Search for the previous occurrence of the current search.
void SetSuccessful(bool successful)
Updates the widget to show whether the search has been successful.
QString GetText() const
Returns the currently entered text in the find field.
virtual void handleNext(const QString &text, FindFlags flags)=0
Called each time the user requests a search.
void findNext()
Search for the next occurrence of the current search.
FindFlags GetFlags() const
Returns the current find flags except the direction.
A horizontal widget embedding into the parent layout of the passed parent widget. ...
A horizontal bar with typical widgets for text search.
void SetEscCloses(bool close)
Sets whether Esc closes the widget.
Provides a "clear text" action for line edits.
FindNotification(ICoreProxy_ptr proxy, QWidget *near)
Creates the search widget in parent layout of near.
void clear()
Clears the text in the find field.