12#include <QApplication>
31 const bool isRtl = QApplication::layoutDirection () == Qt::RightToLeft;
36 Button_->setIconSize (
QSize (16, 16));
37 Button_->setIcon (
icon);
38 Button_->setCursor (Qt::ArrowCursor);
39 Button_->setStyleSheet (
QStringLiteral (
"QToolButton { border: none; padding: 0px; }"));
43 &QToolButton::clicked,
48 &QLineEdit::textChanged,
50 [
this] (
const QString&
str) { Button_->setVisible (!
str.isEmpty ()); });
51 Button_->setVisible (!
edit->text ().isEmpty ());
58 EscShortcut_->setEnabled (
clears);
Provides a "clear text" action for line edits.
void SetEscClearsEdit(bool clears)
Toggles whether Esc button clears the line edit.
ClearLineEditAddon(const ICoreProxy_ptr &proxy, QLineEdit *edit)
Creates the addon and installs it on the given edit.
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Container< T > Filter(const Container< T > &c, F f)