diff options
-rw-r--r-- | usersdialog.cpp | 10 | ||||
-rw-r--r-- | usersdialog.h | 1 | ||||
-rw-r--r-- | usersdialog.ui | 18 |
3 files changed, 15 insertions, 14 deletions
diff --git a/usersdialog.cpp b/usersdialog.cpp index 424524ec..64b0a807 100644 --- a/usersdialog.cpp +++ b/usersdialog.cpp @@ -94,3 +94,13 @@ void UsersDialog::closeEvent(QCloseEvent *event) { } void UsersDialog::on_checkBox_clicked() { populateList(ui->lineEdit->text()); } + +void UsersDialog::keyPressEvent(QKeyEvent * event) { + switch (event->key()) { + case Qt::Key_Escape: + ui->lineEdit->clear(); + break; + default: + break; + } +} diff --git a/usersdialog.h b/usersdialog.h index 23eb9c7e..d51981a4 100644 --- a/usersdialog.h +++ b/usersdialog.h @@ -35,6 +35,7 @@ class UsersDialog : public QDialog { protected: void closeEvent(QCloseEvent *event); + void keyPressEvent(QKeyEvent * event); private slots: void itemChange(QListWidgetItem *item); diff --git a/usersdialog.ui b/usersdialog.ui index 1ae15138..62fcad16 100644 --- a/usersdialog.ui +++ b/usersdialog.ui @@ -61,20 +61,11 @@ Red entries are not valid, you will not be able to encrypt to these.</string> <height>26</height> </size> </property> - </widget> - </item> - <item> - <widget class="QToolButton" name="clearButton"> - <property name="toolTip"> - <string>Clear search</string> - </property> - <property name="text"> - <string>X</string> + <property name="placeholderText"> + <string>Search Users</string> </property> - <property name="icon"> - <iconset theme="edit-clear"> - <normalon>:/icons/edit-clear.svg</normalon> - </iconset> + <property name="clearButtonEnabled"> + <bool>true</bool> </property> </widget> </item> @@ -111,7 +102,6 @@ Red entries are not valid, you will not be able to encrypt to these.</string> </widget> <tabstops> <tabstop>lineEdit</tabstop> - <tabstop>clearButton</tabstop> <tabstop>listWidget</tabstop> </tabstops> <resources/> |