gwenhywfar  5.14.1
qt5/w_progressbar.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  QProgressBar *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 QProgressBar();
34  qw->setTextVisible(true);
35 
36  /* handle flags */
37  if (flags & GWEN_WIDGET_FLAGS_FILLX)
38  hpolicy=QSizePolicy::Expanding;
39  if (flags & GWEN_WIDGET_FLAGS_FILLY)
40  vpolicy=QSizePolicy::Expanding;
41  qw->setSizePolicy(hpolicy, vpolicy);
42 
44 
45  if (wParent)
47  return 0;
48  }
49 
50 
51 
53  int index,
54  int value,
55  int doSignal) {
56  QProgressBar *qw;
57 
59  assert(qw);
60 
61  switch(prop) {
63  qw->setValue(value);
64  return 0;
65 
67  qw->setMinimum(value);
68  return 0;
69 
71  qw->setMaximum(value);
72  return 0;
73 
74  default:
75  return Qt5_W_Widget::setIntProperty(prop, index, value, doSignal);
76  }
77  };
78 
79 
80 
82  int index,
83  int defaultValue) {
84  QProgressBar *qw;
85 
87  assert(qw);
88 
89  switch(prop) {
91  return qw->value();
92 
94  return qw->minimum();
95 
97  return qw->maximum();
98 
99  default:
100  return Qt5_W_Widget::getIntProperty(prop, index, defaultValue);
101  }
102  };
103 
104 };
105 
106 
107 
108 
109 
110 
111 
GWEN_DIALOG_PROPERTY
Definition: dialog.h:260
Qt5_W_ProgressBar(GWEN_WIDGET *w)
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)
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)