author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/kdeui/kbuttonbox.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'microkde/kdeui/kbuttonbox.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | microkde/kdeui/kbuttonbox.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp index 83d622a..3ea6703 100644 --- a/microkde/kdeui/kbuttonbox.cpp +++ b/microkde/kdeui/kbuttonbox.cpp | |||
@@ -48,9 +48,11 @@ | |||
48 | //US #include "kbuttonbox.moc" | 48 | //US #include "kbuttonbox.moc" |
49 | 49 | ||
50 | #include <kbuttonbox.h> | 50 | #include <kbuttonbox.h> |
51 | #include <qpushbutton.h> | 51 | #include <qpushbutton.h> |
52 | #include <qptrlist.h> | 52 | #include <q3ptrlist.h> |
53 | //Added by qt3to4: | ||
54 | #include <QResizeEvent> | ||
53 | #include <assert.h> | 55 | #include <assert.h> |
54 | 56 | ||
55 | #define minButtonWidth 50 | 57 | #define minButtonWidth 50 |
56 | 58 | ||
@@ -61,20 +63,20 @@ public: | |||
61 | unsigned short stretch; | 63 | unsigned short stretch; |
62 | unsigned short actual_size; | 64 | unsigned short actual_size; |
63 | }; | 65 | }; |
64 | 66 | ||
65 | template class QPtrList<KButtonBox::Item>; | 67 | template class Q3PtrList<KButtonBox::Item>; |
66 | 68 | ||
67 | class KButtonBoxPrivate { | 69 | class KButtonBoxPrivate { |
68 | public: | 70 | public: |
69 | unsigned short border; | 71 | unsigned short border; |
70 | unsigned short autoborder; | 72 | unsigned short autoborder; |
71 | unsigned short orientation; | 73 | unsigned short orientation; |
72 | bool activated; | 74 | bool activated; |
73 | QPtrList<KButtonBox::Item> buttons; | 75 | Q3PtrList<KButtonBox::Item> buttons; |
74 | }; | 76 | }; |
75 | 77 | ||
76 | KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, | 78 | KButtonBox::KButtonBox(QWidget *parent, Qt::Orientation _orientation, |
77 | int border, int autoborder) | 79 | int border, int autoborder) |
78 | : QWidget(parent) | 80 | : QWidget(parent) |
79 | { | 81 | { |
80 | data = new KButtonBoxPrivate; | 82 | data = new KButtonBoxPrivate; |
@@ -148,9 +150,9 @@ void KButtonBox::layout() { | |||
148 | 150 | ||
149 | void KButtonBox::placeButtons() { | 151 | void KButtonBox::placeButtons() { |
150 | unsigned int i; | 152 | unsigned int i; |
151 | 153 | ||
152 | if(data->orientation == Horizontal) { | 154 | if(data->orientation == Qt::Horizontal) { |
153 | // calculate free size and stretches | 155 | // calculate free size and stretches |
154 | int fs = width() - 2 * data->border; | 156 | int fs = width() - 2 * data->border; |
155 | int stretch = 0; | 157 | int stretch = 0; |
156 | for(i = 0; i < data->buttons.count(); i++) { | 158 | for(i = 0; i < data->buttons.count(); i++) { |
@@ -250,9 +252,9 @@ QSize KButtonBox::sizeHint() const { | |||
250 | s = that->buttonSizeHint(b); | 252 | s = that->buttonSizeHint(b); |
251 | else | 253 | else |
252 | s = bs; | 254 | s = bs; |
253 | 255 | ||
254 | if(data->orientation == Horizontal) | 256 | if(data->orientation == Qt::Horizontal) |
255 | dw += s.width(); | 257 | dw += s.width(); |
256 | else | 258 | else |
257 | dw += s.height(); | 259 | dw += s.height(); |
258 | 260 | ||
@@ -260,18 +262,18 @@ QSize KButtonBox::sizeHint() const { | |||
260 | dw += data->autoborder; | 262 | dw += data->autoborder; |
261 | } | 263 | } |
262 | } | 264 | } |
263 | 265 | ||
264 | if(data->orientation == Horizontal) | 266 | if(data->orientation == Qt::Horizontal) |
265 | return QSize(dw, bs.height() + 2 * data->border); | 267 | return QSize(dw, bs.height() + 2 * data->border); |
266 | else | 268 | else |
267 | return QSize(bs.width() + 2 * data->border, dw); | 269 | return QSize(bs.width() + 2 * data->border, dw); |
268 | } | 270 | } |
269 | } | 271 | } |
270 | 272 | ||
271 | QSizePolicy KButtonBox::sizePolicy() const | 273 | QSizePolicy KButtonBox::sizePolicy() const |
272 | { | 274 | { |
273 | return data->orientation == Horizontal? | 275 | return data->orientation == Qt::Horizontal? |
274 | QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : | 276 | QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ) : |
275 | QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); | 277 | QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Minimum ); |
276 | } | 278 | } |
277 | 279 | ||