summaryrefslogtreecommitdiff
path: root/ui/completioncombobox.h
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2026-04-06 19:10:03 -0400
committerRusty Wagner <rusty.wagner@gmail.com>2026-05-22 17:52:21 -0400
commit8f2e99d1b6e814fcf7b9142889b7f2dfab5dd94e (patch)
treee11e1633c257b6973406b47f18a53ce9a41ba3d2 /ui/completioncombobox.h
parentf905a0133585fc7385c6e8ef0270bc6e0704cc2a (diff)
Function signature table in edit function dialog
Diffstat (limited to 'ui/completioncombobox.h')
-rw-r--r--ui/completioncombobox.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ui/completioncombobox.h b/ui/completioncombobox.h
new file mode 100644
index 00000000..1135d4e4
--- /dev/null
+++ b/ui/completioncombobox.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "uitypes.h"
+#include <QtGui/QKeyEvent>
+#include <QtWidgets/QComboBox>
+
+//! CompletionComboBox is a subclass of QComboBox intended to have a more
+//! familiar user experience when working with auto-completion.
+//!
+//! Most notably, the <TAB> keypress is intercepted so that the tab key can be
+//! used to cycle through completion options. This is similar the behavior found
+//! in most text editors and IDEs.
+//!
+//! Additionally, the combo box is editable and uses case-sensitive matching,
+//! popup-style completion, and a "no insert" policy by default.
+class BINARYNINJAUIAPI CompletionComboBox : public QComboBox {
+ Q_OBJECT
+
+ bool m_forwardReturnEvents = true;
+
+ //! Manually cycle the selected completion suggestion, forward by default.
+ bool cycleCompletion(bool forward = true);
+
+protected:
+ bool event(QEvent* event) override;
+
+public:
+ CompletionComboBox(QWidget* parent = nullptr);
+
+ void setForwardReturnEvents(bool forward) { m_forwardReturnEvents = forward; }
+
+Q_SIGNALS:
+ void enterPressed();
+};