gwenhywfar  5.14.1
qt5/w_widgetstack.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  QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
28  QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
29 
31  wParent=GWEN_Widget_Tree_GetParent(_widget);
32 
33  qw=new QStackedWidget();
34 
35  /* handle flags */
36  if (flags & GWEN_WIDGET_FLAGS_FILLX)
37  hpolicy=QSizePolicy::Expanding;
38  if (flags & GWEN_WIDGET_FLAGS_FILLY)
39  vpolicy=QSizePolicy::Expanding;
40  qw->setSizePolicy(hpolicy, vpolicy);
41 
43 
44  if (wParent)
46  return 0;
47  }
48 
49 
50 
52  int index,
53  int value,
54  int doSignal) {
55  QStackedWidget *qw;
56 
58  assert(qw);
59 
60  switch(prop) {
62  qw->setCurrentIndex(value);
63  return 0;
64 
65  default:
66  return Qt5_W_Widget::setIntProperty(prop, index, value, doSignal);
67  }
68  };
69 
70 
71 
73  int index,
74  int defaultValue) {
75  QStackedWidget *qw;
76 
78  assert(qw);
79 
80  switch(prop) {
82  return qw->currentIndex();
83 
84  default:
85  return Qt5_W_Widget::getIntProperty(prop, index, defaultValue);
86  }
87  };
88 
89 
91  QStackedWidget *qw;
92  QWidget *qChild;
93 
95  assert(qw);
96 
97  qChild=getQWidget(wChild);
98  assert(qChild);
99 
100  qw->addWidget(qChild);
101 
102  return 0;
103  };
104 
105 
106 };
107 
108 
109 
110 
111 
112 
113 
Qt5_W_WidgetStack(GWEN_WIDGET *w)
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
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
int getIntProperty(GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
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
int setIntProperty(GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int value, GWEN_UNUSED int doSignal)
int addChildGuiWidget(GWEN_WIDGET *wChild)
static QWidget * getQWidget(GWEN_WIDGET *w)
GWEN_WIDGET * _widget
Definition: cppwidget.hpp:66
int getIntProperty(GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int defaultValue)
#define QT5_DIALOG_WIDGET_REAL
int setIntProperty(GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)