gwenhywfar  4.6.0beta
w_dialog.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon Feb 15 2010
3  copyright : (C) 2010 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 #include <gwen-gui-cpp/cppwidget.hpp>
12 
13 
14 class Qt4_W_Dialog: public Qt4_W_Widget {
15 public:
17  }
18 
19 
20 
22  }
23 
24 
25 
26  virtual int setup() {
27  QWidget *qw;
28  uint32_t flags;
29  GWEN_WIDGET *wParent;
30  QLayout *qLayout;
31  QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
32  QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
33 
35  wParent=GWEN_Widget_Tree_GetParent(_widget);
36 
37  qw=new QT4_DialogBox(dynamic_cast<QT4_GuiDialog*>(getDialog()), QApplication::activeModalWidget());
38  qLayout=new QVBoxLayout(qw);
39 
40  /* handle flags */
41  if (flags & GWEN_WIDGET_FLAGS_FILLX)
42  hpolicy=QSizePolicy::Expanding;
43  if (flags & GWEN_WIDGET_FLAGS_FILLY)
44  vpolicy=QSizePolicy::Expanding;
45  qw->setSizePolicy(hpolicy, vpolicy);
46 
47 
50 
51  if (wParent)
53  return 0;
54  }
55 
56 
57 
59  QWidget *qw;
60  QBoxLayout *qLayout;
61  QWidget *qChild;
62 
64  assert(qw);
65 
67  assert(qLayout);
68 
69  qChild=getQWidget(wChild);
70  assert(qChild);
71 
72  qChild->setParent(qw);
73  qLayout->addWidget(qChild);
74 
75  return 0;
76  }
77 
78 
79 
81  int index,
82  const char *value,
83  int doSignal) {
84  QWidget *qw;
85 
87  assert(qw);
88 
89  switch(prop) {
91  qw->setWindowTitle(QString::fromUtf8(value));
92  return 0;
93  default:
94  break;
95  }
96 
98  "Function is not appropriate for this type of widget (%s)",
100  return GWEN_ERROR_INVALID;
101  };
102 
103 
104 
106  int index,
107  const char *defaultValue) {
108  QWidget *qw;
109  QString str;
110 
112  assert(qw);
113 
114  switch(prop) {
116  str=qw->windowTitle();
117  if (str.isEmpty())
118  return defaultValue;
119  else {
122  }
123  break;
124 
125  default:
126  break;
127  }
128 
130  "Function is not appropriate for this type of widget (%s)",
132  return defaultValue;
133  };
134 
135 };
136 
137 
138 
139 
140 
141 
142