gwenhywfar  5.14.1
qt5/w_groupbox.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 
12 public:
14  }
15 
16 
17 
19  }
20 
21 
22 
23  virtual int setup() {
24  QWidget *qw;
25  uint32_t flags;
26  GWEN_WIDGET *wParent;
27  QLayout *qLayout;
28  QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
29  QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
30  const char *s;
31  QString text;
32 
34  wParent=GWEN_Widget_Tree_GetParent(_widget);
36  if (s)
37  text=QString::fromUtf8(s);
38 
39  qw=new QGroupBox(text);
40  qLayout=new QVBoxLayout(qw);
41 
42  /* handle flags */
43  if (flags & GWEN_WIDGET_FLAGS_FILLX)
44  hpolicy=QSizePolicy::Expanding;
45  if (flags & GWEN_WIDGET_FLAGS_FILLY)
46  vpolicy=QSizePolicy::Expanding;
47  qw->setSizePolicy(hpolicy, vpolicy);
48 
49 
52 
53  if (wParent)
55  return 0;
56  }
57 
58 
59 
61  QWidget *qw;
62  QBoxLayout *qLayout;
63  QWidget *qChild;
64 
66  assert(qw);
67 
69  assert(qLayout);
70 
71  qChild=getQWidget(wChild);
72  assert(qChild);
73 
74  qChild->setParent(qw);
75  qLayout->addWidget(qChild);
76 
77  return 0;
78  }
79 
80 };
81 
82 
83 
84 
85 
86 
87 
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition: widget.c:149
void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.
Definition: widget.c:136
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition: widget.c:122
#define QT5_DIALOG_WIDGET_LAYOUT
int addChildGuiWidget(GWEN_WIDGET *wChild)
struct GWEN_WIDGET GWEN_WIDGET
Definition: widget_be.h:34
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition: widget.c:836
#define GWEN_WIDGET_FLAGS_FILLY
Definition: dialog.h:62
#define GWEN_WIDGET_FLAGS_FILLX
Definition: dialog.h:61
static QWidget * getQWidget(GWEN_WIDGET *w)
Qt5_W_GroupBox(GWEN_WIDGET *w)
GWEN_WIDGET * _widget
Definition: cppwidget.hpp:66
#define QT5_DIALOG_WIDGET_REAL
const char * GWEN_Widget_GetText(const GWEN_WIDGET *w, int idx)
Definition: widget.c:293
virtual int setup()