diff options
-rw-r--r-- | client/macrowindow.cc | 13 | ||||
-rw-r--r-- | client/widgets/checkgroupbox.cc | 14 | ||||
-rw-r--r-- | client/widgets/checkgroupbox.h | 2 | ||||
-rw-r--r-- | client/widgets/frame.cc | 14 | ||||
-rw-r--r-- | client/widgets/frame.h | 2 | ||||
-rw-r--r-- | client/widgets/groupbox.cc | 14 | ||||
-rw-r--r-- | client/widgets/groupbox.h | 2 | ||||
-rw-r--r-- | client/widgets/widget.h | 1 | ||||
-rw-r--r-- | client/widgets/window.cc | 14 | ||||
-rw-r--r-- | client/widgets/window.h | 2 |
10 files changed, 62 insertions, 16 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc index d96facb..3776a6b 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -289,18 +289,7 @@ void MacroWindow::animated(QWidget *w) if(is_static) return; - printf("SetFocus:\n"); // Set keyboard focus on the first focusable widget in the macro. - QVector< Widget* > widgets; - widgets = mainwidget->widgetList(true); - QVector< Widget* >::iterator i = widgets.begin(); - while(i != widgets.end()) { - Widget *w = *i; - if(w) { - printf("\t%s\n", w->type().toStdString().c_str()); - } - if(w && w->setKeyboardFocus()) break; - i++; - } + mainwidget->setKeyboardFocus(); } } diff --git a/client/widgets/checkgroupbox.cc b/client/widgets/checkgroupbox.cc index 8020a45..7204418 100644 --- a/client/widgets/checkgroupbox.cc +++ b/client/widgets/checkgroupbox.cc @@ -137,3 +137,17 @@ void CheckGroupBox::setWdgValid(bool valid) groupbox->setPalette(palette); } + +bool CheckGroupBox::setKeyboardFocus() +{ + QVector< Widget* >::iterator i = children.begin(); + while(i != children.end()) { + Widget *w = *i; + if(w) { + if(w->setKeyboardFocus()) return true; + } + i++; + } + + return false; +} diff --git a/client/widgets/checkgroupbox.h b/client/widgets/checkgroupbox.h index e526092..7088832 100644 --- a/client/widgets/checkgroupbox.h +++ b/client/widgets/checkgroupbox.h @@ -47,6 +47,8 @@ public: bool checked(); void setChecked(bool checked); + bool setKeyboardFocus(); + public slots: void state_change(bool); diff --git a/client/widgets/frame.cc b/client/widgets/frame.cc index d6f8187..076816a 100644 --- a/client/widgets/frame.cc +++ b/client/widgets/frame.cc @@ -50,3 +50,17 @@ Frame::~Frame() { // delete frame; } + +bool Frame::setKeyboardFocus() +{ + QVector< Widget* >::iterator i = children.begin(); + while(i != children.end()) { + Widget *w = *i; + if(w) { + if(w->setKeyboardFocus()) return true; + } + i++; + } + + return false; +} diff --git a/client/widgets/frame.h b/client/widgets/frame.h index 219ecf8..04e6b9e 100644 --- a/client/widgets/frame.h +++ b/client/widgets/frame.h @@ -43,7 +43,7 @@ public: void setWdgValid(bool) {} - bool setKeyboardFocus() { return false; } + bool setKeyboardFocus(); private: QFrame *frame; diff --git a/client/widgets/groupbox.cc b/client/widgets/groupbox.cc index 3c00fa4..0d720ea 100644 --- a/client/widgets/groupbox.cc +++ b/client/widgets/groupbox.cc @@ -56,3 +56,17 @@ GroupBox::~GroupBox() { // delete groupbox; } + +bool GroupBox::setKeyboardFocus() +{ + QVector< Widget* >::iterator i = children.begin(); + while(i != children.end()) { + Widget *w = *i; + if(w) { + if(w->setKeyboardFocus()) return true; + } + i++; + } + + return false; +} diff --git a/client/widgets/groupbox.h b/client/widgets/groupbox.h index 22aa644..f2da306 100644 --- a/client/widgets/groupbox.h +++ b/client/widgets/groupbox.h @@ -43,7 +43,7 @@ public: void setWdgValid(bool) {} - bool setKeyboardFocus() { return false; } + bool setKeyboardFocus(); private: QGroupBox *groupbox; diff --git a/client/widgets/widget.h b/client/widgets/widget.h index 37a365f..3d06ef3 100644 --- a/client/widgets/widget.h +++ b/client/widgets/widget.h @@ -100,7 +100,6 @@ protected: LUA *lua; -private: void createWidget(QDomNode &xml_node, QLayout *layout); QVector< Widget* > children; diff --git a/client/widgets/window.cc b/client/widgets/window.cc index b480189..a305171 100644 --- a/client/widgets/window.cc +++ b/client/widgets/window.cc @@ -69,3 +69,17 @@ Window::~Window() //delete widget; } + +bool Window::setKeyboardFocus() +{ + QVector< Widget* >::iterator i = children.begin(); + while(i != children.end()) { + Widget *w = *i; + if(w) { + if(w->setKeyboardFocus()) return true; + } + i++; + } + + return false; +} diff --git a/client/widgets/window.h b/client/widgets/window.h index 2214b16..109cf11 100644 --- a/client/widgets/window.h +++ b/client/widgets/window.h @@ -41,7 +41,7 @@ public: void setWdgValid(bool) {} - bool setKeyboardFocus() { return false; } + bool setKeyboardFocus(); }; #endif/*__PRACRO_WINDOW_H__*/ |