summaryrefslogtreecommitdiff
path: root/client/widgets/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/widget.cc')
-rw-r--r--client/widgets/widget.cc27
1 files changed, 17 insertions, 10 deletions
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index f3247a0..cd29d0a 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -33,10 +33,15 @@
#include <QLayout>
#include <QObject>
+//#define DEBUG(fmt...) printf(fmt)
+#define DEBUG(ftm...)
+
Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
{
widget = NULL;
+ hideChildren = false;
+
QDomElement elem = node.toElement();
this->macrowindow = macrowindow;
@@ -65,16 +70,16 @@ Widget::Widget(QDomNode &node, MacroWindow *macrowindow)
is_valid = true;
- printf("Create Widget '%s' of type '%s'\n",
- name().toStdString().c_str(),
- type().toStdString().c_str());
+ DEBUG("Create Widget '%s' of type '%s'\n",
+ name().toStdString().c_str(),
+ type().toStdString().c_str());
}
Widget::~Widget()
{
- printf("Delete Widget '%s' of type '%s'\n",
- name().toStdString().c_str(),
- type().toStdString().c_str());
+ DEBUG("Delete Widget '%s' of type '%s'\n",
+ name().toStdString().c_str(),
+ type().toStdString().c_str());
QVector< Widget* >::iterator i = children.begin();
while(i != children.end()) {
@@ -178,7 +183,7 @@ bool Widget::setKeyboardFocus()
Widget *Widget::findWidget(QString n, bool deep)
{
- printf("Find Widget %p\n", this); fflush(stdout);
+ DEBUG("Find Widget %p\n", this); fflush(stdout);
if(n == name()) return this;
@@ -198,9 +203,11 @@ Widget *Widget::findWidget(QString n, bool deep)
QVector< Widget* > Widget::widgetList(bool deep)
{
- printf("Widget List %p\n", this); fflush(stdout);
+ DEBUG("Widget List %p\n", this); fflush(stdout);
+
+ QVector< Widget* > lst;
- QVector< Widget* > lst = children;
+ lst.push_back(this);
if(hideChildren && deep == false) return lst;
@@ -221,7 +228,7 @@ void Widget::childWasChanged()
void Widget::addChild(Widget *widget)
{
if(widget == NULL) {
- printf("Trying to add NULL child to '%s'\n", name().toStdString().c_str());
+ DEBUG("Trying to add NULL child to '%s'\n", name().toStdString().c_str());
return;
}
children.push_back(widget);