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
11#include <gwen-gui-cpp/cppwidget.hpp>
12
13
15public:
18
19
20
23
24
25
26 virtual int setup() {
27 QProgressBar *qw;
28 uint32_t flags;
29 GWEN_WIDGET *wParent;
30 QSizePolicy::Policy hpolicy=QSizePolicy::Minimum;
31 QSizePolicy::Policy vpolicy=QSizePolicy::Minimum;
32
34 wParent=GWEN_Widget_Tree_GetParent(_widget);
35
36 qw=new QProgressBar();
37 qw->setTextVisible(true);
38
39 /* handle flags */
40 if (flags & GWEN_WIDGET_FLAGS_FILLX)
41 hpolicy=QSizePolicy::Expanding;
42 if (flags & GWEN_WIDGET_FLAGS_FILLY)
43 vpolicy=QSizePolicy::Expanding;
44 qw->setSizePolicy(hpolicy, vpolicy);
45
47
48 if (wParent)
50 return 0;
51 }
52
53
54
56 int index,
57 int value,
58 int doSignal) {
59 QProgressBar *qw;
60
62 assert(qw);
63
64 switch(prop) {
66 qw->setValue(value);
67 return 0;
68
70 qw->setMinimum(value);
71 return 0;
72
74 qw->setMaximum(value);
75 return 0;
76
77 default:
78 return Qt5_W_Widget::setIntProperty(prop, index, value, doSignal);
79 }
80 };
81
82
83
85 int index,
86 int defaultValue) {
87 QProgressBar *qw;
88
90 assert(qw);
91
92 switch(prop) {
94 return qw->value();
95
97 return qw->minimum();
98
100 return qw->maximum();
101
102 default:
103 return Qt5_W_Widget::getIntProperty(prop, index, defaultValue);
104 }
105 };
106
107};
108
109
110
111
112
113
114
GWEN_WIDGET * _widget
Definition cppwidget.hpp:66
int setIntProperty(GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
int getIntProperty(GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
Qt5_W_ProgressBar(GWEN_WIDGET *w)
Qt5_W_Widget(GWEN_WIDGET *w)
int setIntProperty(GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int value, GWEN_UNUSED int doSignal)
int getIntProperty(GWEN_DIALOG_PROPERTY prop, GWEN_UNUSED int index, int defaultValue)
#define GWEN_WIDGET_FLAGS_FILLY
Definition dialog.h:62
#define GWEN_WIDGET_FLAGS_FILLX
Definition dialog.h:61
GWEN_DIALOG_PROPERTY
Definition dialog.h:260
@ GWEN_DialogProperty_MinValue
Definition dialog.h:265
@ GWEN_DialogProperty_MaxValue
Definition dialog.h:266
@ GWEN_DialogProperty_Value
Definition dialog.h:264
#define QT5_DIALOG_WIDGET_REAL
int GWEN_Widget_AddChildGuiWidget(GWEN_WIDGET *w, GWEN_WIDGET *wChild)
Definition widget.c:836
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
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition widget.c:149
struct GWEN_WIDGET GWEN_WIDGET
Definition widget_be.h:34