Place the completion popup under the search widget
This commit is contained in:
parent
2644e4acca
commit
c6ec20fa40
2 changed files with 74 additions and 27 deletions
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QFrame>
|
||||
#include <QKeyEvent>
|
||||
#include <QVBoxLayout>
|
||||
|
|
@ -29,8 +30,14 @@ class RoomSearchInput : public TextField
|
|||
public:
|
||||
explicit RoomSearchInput(QWidget *parent = nullptr);
|
||||
|
||||
signals:
|
||||
void selectNextCompletion();
|
||||
void selectPreviousCompletion();
|
||||
void hiding();
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
bool focusNextPrevChild(bool next) override;
|
||||
};
|
||||
|
||||
|
|
@ -51,8 +58,12 @@ protected:
|
|||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private:
|
||||
// Current highlighted selection from the completer.
|
||||
int selection_ = -1;
|
||||
|
||||
QVBoxLayout *topLayout_;
|
||||
RoomSearchInput *roomSearch_;
|
||||
QCompleter *completer_;
|
||||
|
||||
QMap<QString, QString> rooms_;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue