From 728e74df239bac0f61faea062bb5a45340ee6d24 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 10:40:27 +0100 Subject: Force focus on combobox in altcombobox in order to avoid the inner widget gaining focus even though it is hidden. --- client/widgets/altcombobox.cc | 6 ++++++ client/widgets/altcombobox.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'client/widgets') diff --git a/client/widgets/altcombobox.cc b/client/widgets/altcombobox.cc index 9956fff..082601a 100644 --- a/client/widgets/altcombobox.cc +++ b/client/widgets/altcombobox.cc @@ -107,6 +107,12 @@ AltComboBox::~AltComboBox() { } +bool AltComboBox::setKeyboardFocus() +{ + combobox->setFocus(); + return true; +} + QComboBox *AltComboBox::qcombobox() { return combobox; diff --git a/client/widgets/altcombobox.h b/client/widgets/altcombobox.h index e6a21d7..b0fb61c 100644 --- a/client/widgets/altcombobox.h +++ b/client/widgets/altcombobox.h @@ -94,6 +94,8 @@ public: QComboBox *qcombobox(); + bool setKeyboardFocus(); + public slots: void comboChanged(); void onChildChange(); -- cgit v1.2.3 From 8dbc6ee0fbc1dd4485ec0ff1cf4a48e24b0b41a8 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 1 Dec 2011 11:26:49 +0100 Subject: Make combobox selection list popup on spacebar or mousedown. --- client/widgets/combobox.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'client/widgets') diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc index eed2d10..935f620 100644 --- a/client/widgets/combobox.cc +++ b/client/widgets/combobox.cc @@ -93,6 +93,8 @@ ComboBox::ComboBox(QDomNode &node, MacroWindow *macrowindow) // Make empty default selection. combobox->setCurrentIndex(-1); + combobox->installEventFilter(this); + QDomElement elem = node.toElement(); combotype = SELECT; @@ -213,15 +215,26 @@ void ComboBox::changed() emit eventOnChange(); } +#include bool ComboBox::eventFilter(QObject *obj, QEvent *event) { if(ignoreChangeEvents == true) return false; + if(combotype == SELECT) { if(event->type() == QEvent::MouseButtonRelease) { if(enabled()) combobox->showPopup(); } } + if(event->type() == QEvent::KeyPress) { + QKeyEvent *ke = (QKeyEvent*)event; + // printf("KEY: %d\n", ke->key()); + // if(ke->key() == Qt::Key_Up || ke->key() == Qt::Key_Down) { + if(ke->key() == Qt::Key_Space) { + if(enabled()) combobox->showPopup(); + } + } + return QObject::eventFilter(obj, event); } -- cgit v1.2.3 From 12cce7eac519786066003173ab072505f2ad8bb0 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 13 Apr 2012 13:48:32 +0200 Subject: Documentation. --- client/widgets/altcombobox.h | 1 + client/widgets/button.h | 1 + client/widgets/checkbox.h | 1 + client/widgets/checkgroupbox.h | 1 + client/widgets/combobox.h | 1 + client/widgets/datetime.h | 1 + client/widgets/groupbox.h | 1 + client/widgets/label.h | 1 + client/widgets/lineedit.h | 1 + client/widgets/listbox.h | 1 + client/widgets/metawidget.h | 1 + client/widgets/multilist.h | 1 + client/widgets/radiobuttons.h | 1 + client/widgets/textedit.h | 1 + client/widgets/widget.h | 1 + client/widgets/window.h | 1 + 16 files changed, 16 insertions(+) (limited to 'client/widgets') diff --git a/client/widgets/altcombobox.h b/client/widgets/altcombobox.h index b0fb61c..73dee10 100644 --- a/client/widgets/altcombobox.h +++ b/client/widgets/altcombobox.h @@ -43,6 +43,7 @@ /*** * ComboBox Widget with Alternate Value * @tag altcombobox + * @clientside * @extends combobox * @screenshot Example: altitem selected. * diff --git a/client/widgets/button.h b/client/widgets/button.h index 0bd7db9..d9053a6 100644 --- a/client/widgets/button.h +++ b/client/widgets/button.h @@ -34,6 +34,7 @@ /*** * PushButton Widget * @tag button + * @clientside * @screenshot Example button *