Skip to content

Commit

Permalink
Autocomplete changes (hope to solve focus grab)
Browse files Browse the repository at this point in the history
setFocusPolicy on QMenu an adding `setAttribute(Qt::WA_ShowWithoutActivating)` to every widget
  • Loading branch information
gamecreature committed Nov 15, 2024
1 parent f92ddf5 commit 066d551
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

edbee.lib:

- Autocomplete changes, setFocusPolicy on QMenu an adding `setAttribute(Qt::WA_ShowWithoutActivating)`
- PR #147, Add ctrl-a / ctrl-e support for macOS
- fix, Autocomplete Improvements
- autocomplete is now really canceled with the escape key. It only appears again if the word becomes blank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@ TextEditorAutoCompleteComponent::TextEditorAutoCompleteComponent(TextEditorContr
layout->setContentsMargins(0, 0, 0, 0);

this->setFocusPolicy(Qt::NoFocus);
this->setAttribute(Qt::WA_ShowWithoutActivating);

menuRef_ = new QMenu(this);
menuRef_->setFocusPolicy(Qt::NoFocus);
menuRef_->setAttribute(Qt::WA_ShowWithoutActivating);

listWidgetRef_ = new QListWidget(menuRef_);
listWidgetRef_->setFocusPolicy(Qt::NoFocus);
listWidgetRef_->setAttribute(Qt::WA_ShowWithoutActivating);

listWidgetRef_->installEventFilter(this);

menuRef_->installEventFilter(this);
menuRef_->setStyleSheet("QMenu { border: 1px solid black; }");
listWidgetRef_->setObjectName("listWidgetRef");
Expand Down

0 comments on commit 066d551

Please sign in to comment.