gwenhywfar  4.6.0beta
w_scrollarea.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 
15 public:
17  }
18 
19 
20 
22  }
23 
24 
25 
26  virtual int setup() {
27  QScrollArea *qw;
28  QWidget *qChild;
29  uint32_t flags;
30  GWEN_WIDGET *wParent;
31  QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
32  QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
33  QLayout *qLayout;
34 
36  wParent=GWEN_Widget_Tree_GetParent(_widget);
37 
38  qw=new QScrollArea();
39 
40  qChild=new QWidget();
41  qChild->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
42  qw->setWidget(qChild);
43  qLayout=new QVBoxLayout(qChild);
44 
45  qw->setWidgetResizable(true);
46 
47  /* handle flags */
48  if (flags & GWEN_WIDGET_FLAGS_FILLX)
49  hpolicy=QSizePolicy::Expanding;
50  if (flags & GWEN_WIDGET_FLAGS_FILLY)
51  vpolicy=QSizePolicy::Expanding;
52  qw->setSizePolicy(hpolicy, vpolicy);
53 
56 
57  if (wParent)
59  return 0;
60  }
61 
62 
64  QWidget *qw;
65  QBoxLayout *qLayout;
66  QWidget *qChild;
67 
69  assert(qw);
70 
72  assert(qLayout);
73 
74  qChild=getQWidget(wChild);
75  assert(qChild);
76 
77  qChild->setParent(qw);
78  qLayout->addWidget(qChild);
79 
80  return 0;
81  };
82 
83 };
84 
85 
86 
87 
88 
89 
90