~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/gui/styles/qstyleoption.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the style module of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#include "qstyleoption.h"
 
30
#include "qapplication.h"
 
31
#ifdef Q_WS_MAC
 
32
# include "private/qt_mac_p.h"
 
33
#endif
 
34
#ifndef QT_NO_DEBUG
 
35
#include <qdebug.h>
 
36
#endif
 
37
 
 
38
/*!
 
39
    \class QStyleOption
 
40
    \brief The QStyleOption class stores the parameters used by QStyle functions.
 
41
 
 
42
    \ingroup appearance
 
43
 
 
44
    QStyleOption and its subclasses contain all the information that
 
45
    QStyle functions need to draw a graphical element.
 
46
 
 
47
    For performance reasons, there are few member functions and the
 
48
    access to the member variables is direct (i.e., using the \c . or
 
49
    \c -> operator). This low-level feel makes the structures
 
50
    straightforward to use and emphasizes that these are simply
 
51
    parameters used by the style functions.
 
52
 
 
53
    The caller of a QStyle function usually creates QStyleOption
 
54
    objects on the stack. This combined with Qt's extensive use of
 
55
    \l{implicit sharing} for types such as QString, QPalette, and
 
56
    QColor ensures that no memory allocation needlessly takes place.
 
57
 
 
58
    The following code snippet shows how to use a specific
 
59
    QStyleOption subclass to paint a push button:
 
60
 
 
61
    \code
 
62
        void MyPushButton::paintEvent()
 
63
        {
 
64
            QStyleOptionButton option;
 
65
            option.init(this);
 
66
            option.state = isDown() ? QStyle::State_Sunken : QStyle::State_Raised;
 
67
            if (isDefault())
 
68
                option.features |= QStyleOptionButton::DefaultButton;
 
69
            option.text = text();
 
70
            option.icon = icon();
 
71
 
 
72
            QPainter painter(this);
 
73
            style().drawControl(QStyle::CE_PushButton, &option, &painter, this);
 
74
        }
 
75
    \endcode
 
76
 
 
77
    In our example, the control is a QStyle::CE_PushButton, and
 
78
    according to the QStyle::drawControl() documentation the
 
79
    corresponding class is QStyleOptionButton.
 
80
 
 
81
    When reimplementing QStyle functions that take a QStyleOption
 
82
    parameter, you often need to cast the QStyleOption to a subclass.
 
83
    For safety, you can use qstyleoption_cast<T>() to ensure that the pointer
 
84
    type is correct. For example:
 
85
 
 
86
    \code
 
87
        void MyStyle::drawPrimitive(PrimitiveElement element,
 
88
                                    const QStyleOption *option,
 
89
                                    QPainter *painter,
 
90
                                    const QWidget *widget)
 
91
        {
 
92
            if (element == PE_FocusRect) {
 
93
                const QStyleOptionFocusRect *focusRectOption =
 
94
                        qstyleoption_cast<const QStyleOptionFocusRect *>(option);
 
95
                if (focusRectOption) {
 
96
                    ...
 
97
                }
 
98
            } else {
 
99
                ...
 
100
            }
 
101
        }
 
102
    \endcode
 
103
 
 
104
    qstyleoption_cast<T>() will return 0 if the object to which \c option
 
105
    points isn't of the correct type.
 
106
 
 
107
    \sa QStyle, QStylePainter
 
108
*/
 
109
 
 
110
/*!
 
111
    \enum QStyleOption::OptionType
 
112
 
 
113
    This enum is used internally by QStyleOption, its subclasses, and
 
114
    qstyleoption_cast() to determine the type of style option. In general you do not need
 
115
    to worry about this unless you want to create your own QStyleOption
 
116
    subclass and your own styles.
 
117
 
 
118
    \value SO_Default QStyleOption
 
119
    \value SO_FocusRect \l QStyleOptionFocusRect
 
120
    \value SO_Button \l QStyleOptionButton
 
121
    \value SO_Tab \l QStyleOptionTab
 
122
    \value SO_TabWidgetFrame \l QStyleOptionTabBarBase
 
123
    \value SO_TabBarBase \l QStyleOptionTabWidgetFrame
 
124
    \value SO_MenuItem \l QStyleOptionMenuItem
 
125
    \value SO_Complex \l QStyleOptionComplex
 
126
    \value SO_Slider \l QStyleOptionSlider
 
127
    \value SO_Frame \l QStyleOptionFrame
 
128
    \value SO_ProgressBar \l QStyleOptionProgressBar
 
129
    \value SO_Q3ListView \l QStyleOptionQ3ListView
 
130
    \value SO_Q3ListViewItem \l QStyleOptionQ3ListViewItem
 
131
    \value SO_Header \l QStyleOptionHeader
 
132
    \value SO_Q3DockWindow \l QStyleOptionQ3DockWindow
 
133
    \value SO_DockWidget \l QStyleOptionDockWidget
 
134
    \value SO_SpinBox \l QStyleOptionSpinBox
 
135
    \value SO_ToolButton \l QStyleOptionToolButton
 
136
    \value SO_ComboBox \l QStyleOptionComboBox
 
137
    \value SO_ToolBox \l QStyleOptionToolBox
 
138
    \value SO_RubberBand \l QStyleOptionRubberBand
 
139
    \value SO_TitleBar \l QStyleOptionTitleBar
 
140
    \value SO_ViewItem \l QStyleOptionViewItem (used in Interviews)
 
141
    \value SO_CustomBase Reserved for custom QStyleOptions;
 
142
                         all custom controls values must be above this value
 
143
    \value SO_ComplexCustomBase Reserved for custom QStyleOptions;
 
144
                         all custom complex controls values must be above this value
 
145
*/
 
146
 
 
147
/*!
 
148
    Constructs a QStyleOption with version \a version and type \a
 
149
    type.
 
150
 
 
151
    The version has no special meaning for QStyleOption; it can be
 
152
    used by subclasses to distinguish between different version of
 
153
    the same option type.
 
154
 
 
155
    The \l state member variable is initialized to
 
156
    QStyle::State_None.
 
157
 
 
158
    \sa version, type
 
159
*/
 
160
 
 
161
QStyleOption::QStyleOption(int version, int type)
 
162
    : version(version), type(type), state(QStyle::State_None),
 
163
      direction(QApplication::layoutDirection()), fontMetrics(QFont())
 
164
{
 
165
}
 
166
 
 
167
 
 
168
/*!
 
169
    Destroys the style option object.
 
170
*/
 
171
QStyleOption::~QStyleOption()
 
172
{
 
173
}
 
174
 
 
175
/*!
 
176
    Initializes the \l state, \l direction, \l rect, \l palette, and
 
177
    \l fontMetrics member variables based on \a widget.
 
178
 
 
179
    This function is provided only for convenience. You can also
 
180
    initialize the variables manually if you want.
 
181
*/
 
182
void QStyleOption::init(const QWidget *widget)
 
183
{
 
184
    state = QStyle::State_None;
 
185
    if (widget->isEnabled())
 
186
        state |= QStyle::State_Enabled;
 
187
    if (widget->hasFocus())
 
188
        state |= QStyle::State_HasFocus;
 
189
    if (widget->window()->testAttribute(Qt::WA_KeyboardFocusChange))
 
190
        state |= QStyle::State_KeyboardFocusChange;
 
191
    if (widget->underMouse())
 
192
        state |= QStyle::State_MouseOver;
 
193
    if (widget->window()->isActiveWindow())
 
194
        state |= QStyle::State_Active;
 
195
 
 
196
    direction = widget->layoutDirection();
 
197
    rect = widget->rect();
 
198
    palette = widget->palette();
 
199
    fontMetrics = widget->fontMetrics();
 
200
}
 
201
 
 
202
/*!
 
203
   Constructs a copy of \a other.
 
204
*/
 
205
QStyleOption::QStyleOption(const QStyleOption &other)
 
206
    : version(Version), type(Type), state(other.state),
 
207
      direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics),
 
208
      palette(other.palette)
 
209
{
 
210
}
 
211
 
 
212
/*!
 
213
    Assign \a other to this QStyleOption.
 
214
*/
 
215
QStyleOption &QStyleOption::operator=(const QStyleOption &other)
 
216
{
 
217
    state = other.state;
 
218
    direction = other.direction;
 
219
    rect = other.rect;
 
220
    fontMetrics = other.fontMetrics;
 
221
    palette = other.palette;
 
222
    return *this;
 
223
}
 
224
 
 
225
/*!
 
226
    \variable QStyleOption::Type
 
227
 
 
228
    Equals SO_Default.
 
229
*/
 
230
 
 
231
/*!
 
232
    \variable QStyleOption::Version
 
233
 
 
234
    Equals 1.
 
235
*/
 
236
 
 
237
/*!
 
238
    \variable QStyleOption::palette
 
239
    \brief the palette that should be used when painting the control
 
240
*/
 
241
 
 
242
/*!
 
243
    \variable QStyleOption::direction
 
244
    \brief the text layout direction that should be used when drawing text in the control
 
245
*/
 
246
 
 
247
/*!
 
248
    \variable QStyleOption::fontMetrics
 
249
    \brief the font metrics that should be used when drawing text in the control
 
250
*/
 
251
 
 
252
/*!
 
253
    \variable QStyleOption::rect
 
254
    \brief the area that should be used for various calculations and painting.
 
255
 
 
256
    This can have different meanings for different types of elements.
 
257
    For example, for \l QStyle::CE_PushButton it would be the
 
258
    rectangle for the entire button, while for \l
 
259
    QStyle::CE_PushButtonLabel it would be just the area for the push
 
260
    button label.
 
261
*/
 
262
 
 
263
/*!
 
264
    \variable QStyleOption::state
 
265
    \brief the style flags that are used when drawing the control
 
266
 
 
267
    \sa QStyle::drawPrimitive(), QStyle::drawControl(), QStyle::drawComplexControl(),
 
268
        QStyle::State
 
269
*/
 
270
 
 
271
/*!
 
272
    \variable QStyleOption::type
 
273
    \brief the option type of the style option
 
274
 
 
275
    \sa OptionType
 
276
*/
 
277
 
 
278
/*!
 
279
    \variable QStyleOption::version
 
280
    \brief the version of the style option
 
281
 
 
282
    This value can be used by subclasses to implement extensions
 
283
    without breaking compatibility. If you use qstyleoption_cast<T>(), you
 
284
    normally don't need to check it.
 
285
*/
 
286
 
 
287
/*!
 
288
    \class QStyleOptionFocusRect
 
289
    \brief The QStyleOptionFocusRect class is used to describe the
 
290
    parameters for drawing a focus rectangle with QStyle.
 
291
*/
 
292
 
 
293
/*!
 
294
    Constructs a QStyleOptionFocusRect. The members variables are
 
295
    initialized to default values.
 
296
*/
 
297
 
 
298
QStyleOptionFocusRect::QStyleOptionFocusRect()
 
299
    : QStyleOption(Version, SO_FocusRect)
 
300
{
 
301
    state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in init()
 
302
}
 
303
 
 
304
/*!
 
305
    \internal
 
306
*/
 
307
QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
 
308
    : QStyleOption(version, SO_FocusRect)
 
309
{
 
310
    state |= QStyle::State_KeyboardFocusChange;  // assume we had one, will be corrected in init()
 
311
}
 
312
 
 
313
/*!
 
314
    \variable QStyleOptionFocusRect::Type
 
315
 
 
316
    Equals SO_FocusRect.
 
317
*/
 
318
 
 
319
/*!
 
320
    \variable QStyleOptionFocusRect::Version
 
321
 
 
322
    Equals 1.
 
323
*/
 
324
 
 
325
/*!
 
326
    \fn QStyleOptionFocusRect::QStyleOptionFocusRect(const QStyleOptionFocusRect &other)
 
327
 
 
328
    Constructs a copy of the \a other style option.
 
329
*/
 
330
 
 
331
/*!
 
332
    \variable QStyleOptionFocusRect::backgroundColor
 
333
    \brief The background color on which the focus rectangle is being drawn.
 
334
*/
 
335
 
 
336
/*!
 
337
    \class QStyleOptionFrame
 
338
    \brief The QStyleOptionFrame class is used to describe the
 
339
    parameters for drawing a frame.
 
340
 
 
341
    QStyleOptionFrame is used for drawing several built-in Qt widget,
 
342
    including QFrame, QGroupBox, QLineEdit, and QMenu.
 
343
*/
 
344
 
 
345
/*!
 
346
    Constructs a QStyleOptionFrame. The members variables are
 
347
    initialized to default values.
 
348
*/
 
349
 
 
350
QStyleOptionFrame::QStyleOptionFrame()
 
351
    : QStyleOption(Version, SO_Frame), lineWidth(0), midLineWidth(0)
 
352
{
 
353
}
 
354
 
 
355
/*!
 
356
    \internal
 
357
*/
 
358
QStyleOptionFrame::QStyleOptionFrame(int version)
 
359
    : QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0)
 
360
{
 
361
}
 
362
 
 
363
/*!
 
364
    \fn QStyleOptionFrame::QStyleOptionFrame(const QStyleOptionFrame &other)
 
365
 
 
366
    Constructs a copy of the \a other style option.
 
367
*/
 
368
 
 
369
/*!
 
370
    \variable QStyleOptionFrame::Type
 
371
 
 
372
    Equals SO_Frame.
 
373
*/
 
374
 
 
375
/*!
 
376
    \variable QStyleOptionFrame::Version
 
377
 
 
378
    Equals 1.
 
379
*/
 
380
 
 
381
/*!
 
382
    \variable QStyleOptionFrame::lineWidth
 
383
    \brief The line width for drawing the panel.
 
384
*/
 
385
 
 
386
/*!
 
387
    \variable QStyleOptionFrame::midLineWidth
 
388
    \brief The mid-line width for drawing the panel. This is usually used in
 
389
    drawing sunken or raised frames.
 
390
*/
 
391
 
 
392
/*!
 
393
    \class QStyleOptionHeader
 
394
    \brief The QStyleOptionHeader class is used to describe the
 
395
    parameters for drawing a header.
 
396
 
 
397
    The QStyleOptionHeader class is used for drawing the item views'
 
398
    header pane, header sort arrow, and header label.
 
399
*/
 
400
 
 
401
/*!
 
402
    Constructs a QStyleOptionHeader. The members variables are
 
403
    initialized to default values.
 
404
*/
 
405
 
 
406
QStyleOptionHeader::QStyleOptionHeader()
 
407
    : QStyleOption(QStyleOptionHeader::Version, SO_Header),
 
408
      section(0), textAlignment(0), iconAlignment(0),
 
409
      position(QStyleOptionHeader::Beginning),
 
410
      selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
 
411
      orientation(Qt::Horizontal)
 
412
{
 
413
}
 
414
 
 
415
/*!
 
416
    \internal
 
417
*/
 
418
QStyleOptionHeader::QStyleOptionHeader(int version)
 
419
    : QStyleOption(version, SO_Header),
 
420
      section(0), textAlignment(0), iconAlignment(0),
 
421
      position(QStyleOptionHeader::Beginning),
 
422
      selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
 
423
      orientation(Qt::Horizontal)
 
424
{
 
425
}
 
426
 
 
427
/*!
 
428
    \variable QStyleOptionHeader::orientation
 
429
    \brief the header's orientation (horizontal or vertical)
 
430
 
 
431
    \sa Qt::Orientation
 
432
*/
 
433
 
 
434
/*!
 
435
    \fn QStyleOptionHeader::QStyleOptionHeader(const QStyleOptionHeader &other)
 
436
 
 
437
    Constructs a copy of the \a other style option.
 
438
*/
 
439
 
 
440
/*!
 
441
    \variable QStyleOptionHeader::Type
 
442
 
 
443
    Equals SO_Header.
 
444
*/
 
445
 
 
446
/*!
 
447
    \variable QStyleOptionHeader::Version
 
448
 
 
449
    Equals 1.
 
450
*/
 
451
 
 
452
/*!
 
453
    \variable QStyleOptionHeader::section
 
454
    \brief Which section of the header is being painted.
 
455
*/
 
456
 
 
457
/*!
 
458
    \variable QStyleOptionHeader::text
 
459
    \brief The text of the header.
 
460
*/
 
461
 
 
462
/*!
 
463
    \variable QStyleOptionHeader::textAlignment
 
464
    \brief The alignment flags for the text of the header.
 
465
 
 
466
    \sa Qt::Alignment
 
467
*/
 
468
 
 
469
/*!
 
470
    \variable QStyleOptionHeader::icon
 
471
    \brief The icon of the header.
 
472
*/
 
473
 
 
474
/*!
 
475
    \variable QStyleOptionHeader::iconAlignment
 
476
    \brief The alignment flags for the icon of the header.
 
477
 
 
478
    \sa Qt::Alignment
 
479
*/
 
480
 
 
481
/*!
 
482
    \variable QStyleOptionHeader::position
 
483
    \brief the section's position in relation to the other sections
 
484
*/
 
485
 
 
486
/*!
 
487
    \variable QStyleOptionHeader::selectedPosition
 
488
    \brief the section's position in relation to the selected section
 
489
*/
 
490
 
 
491
/*!
 
492
    \variable QStyleOptionHeader::sortIndicator
 
493
    \brief the direction the sort indicator should be drawn
 
494
*/
 
495
 
 
496
/*!
 
497
    \enum QStyleOptionHeader::SectionPosition
 
498
 
 
499
    This enum lets you know where the section's position is in relation to the other sections.
 
500
 
 
501
    \value Beginning At the beginining of the header
 
502
    \value Middle In the middle of the header
 
503
    \value End At the end of the header
 
504
    \value OnlyOneSection Only one header section
 
505
*/
 
506
 
 
507
/*!
 
508
    \enum QStyleOptionHeader::SelectedPosition
 
509
 
 
510
    This enum lets you know where the section's position is in relation to the selected section.
 
511
 
 
512
    \value NotAdjacent Not adjacent to the selected section
 
513
    \value NextIsSelected The next section is selected
 
514
    \value PreviousIsSelected The previous section is selected
 
515
    \value NextAndPreviousAreSelected Both the next and previous section are selected
 
516
*/
 
517
 
 
518
/*!
 
519
    \enum QStyleOptionHeader::SortIndicator
 
520
 
 
521
    Indicates which direction the sort indicator should be drawn
 
522
    \value None No sort indicator is needed
 
523
    \value SortUp Draw an up indicator
 
524
    \value SortDown Draw a down indicator
 
525
*/
 
526
 
 
527
/*!
 
528
    \class QStyleOptionButton
 
529
    \brief The QStyleOptionButton class is used to describe the
 
530
    parameters for drawing buttons.
 
531
 
 
532
    The QStyleOptionButton class is used to draw \l QPushButton, \l
 
533
    QCheckBox, and \l QRadioButton.
 
534
 
 
535
    \sa QStyleOptionToolButton
 
536
*/
 
537
 
 
538
/*!
 
539
    \enum QStyleOptionButton::ButtonFeature
 
540
 
 
541
    This enum describles the different types of features a push button can have.
 
542
 
 
543
    \value None Indicates a normal push button.
 
544
    \value Flat Indicates a flat push button.
 
545
    \value HasMenu Indicates that the button has a drop down menu.
 
546
    \value DefaultButton Indicates that the button is a default button.
 
547
    \value AutoDefaultButton Indicates that the button is an auto default button.
 
548
 
 
549
    \sa features
 
550
*/
 
551
 
 
552
/*!
 
553
    Constructs a QStyleOptionButton. The members variables are
 
554
    initialized to default values.
 
555
*/
 
556
 
 
557
QStyleOptionButton::QStyleOptionButton()
 
558
    : QStyleOption(QStyleOptionButton::Version, SO_Button), features(None)
 
559
{
 
560
}
 
561
 
 
562
/*!
 
563
    \internal
 
564
*/
 
565
QStyleOptionButton::QStyleOptionButton(int version)
 
566
    : QStyleOption(version, SO_Button), features(None)
 
567
{
 
568
}
 
569
 
 
570
/*!
 
571
    \fn QStyleOptionButton::QStyleOptionButton(const QStyleOptionButton &other)
 
572
 
 
573
    Constructs a copy of the \a other style option.
 
574
*/
 
575
 
 
576
/*!
 
577
    \variable QStyleOptionButton::Type
 
578
 
 
579
    Equals SO_Button.
 
580
*/
 
581
 
 
582
/*!
 
583
    \variable QStyleOptionButton::Version
 
584
 
 
585
    Equals 1.
 
586
*/
 
587
 
 
588
/*!
 
589
    \variable QStyleOptionButton::features
 
590
    \brief The features for the button
 
591
 
 
592
    This variable is a bitwise OR of the features that describe this button.
 
593
 
 
594
    \sa ButtonFeature
 
595
*/
 
596
 
 
597
/*!
 
598
    \variable QStyleOptionButton::text
 
599
    \brief The text of the button.
 
600
*/
 
601
 
 
602
/*!
 
603
    \variable QStyleOptionButton::icon
 
604
    \brief The icon of the button.
 
605
 
 
606
    \sa iconSize
 
607
*/
 
608
 
 
609
/*!
 
610
    \variable QStyleOptionButton::iconSize
 
611
    \brief The size of the icon for the button
 
612
*/
 
613
 
 
614
/*!
 
615
    \class QStyleOptionTab
 
616
    \brief The QStyleOptionTab class is used to describe the
 
617
    parameters for drawing a tab bar.
 
618
 
 
619
    The QStyleOptionTab class is used for drawing \l QTabBar and the
 
620
    pane for \l QTabWidget.
 
621
*/
 
622
 
 
623
/*!
 
624
    Constructs a QStyleOptionTab object. The members variables are
 
625
    initialized to default values.
 
626
*/
 
627
 
 
628
QStyleOptionTab::QStyleOptionTab()
 
629
    : QStyleOption(QStyleOptionTab::Version, SO_Tab),
 
630
      shape(QTabBar::RoundedNorth),
 
631
      row(0),
 
632
      position(Beginning),
 
633
      selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets)
 
634
{
 
635
}
 
636
 
 
637
/*!
 
638
    \internal
 
639
*/
 
640
QStyleOptionTab::QStyleOptionTab(int version)
 
641
    : QStyleOption(version, SO_Tab),
 
642
      shape(QTabBar::RoundedNorth),
 
643
      row(0),
 
644
      position(Beginning),
 
645
      selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets)
 
646
{
 
647
}
 
648
 
 
649
/*!
 
650
    \fn QStyleOptionTab::QStyleOptionTab(const QStyleOptionTab &other)
 
651
 
 
652
    Constructs a copy of the \a other style option.
 
653
*/
 
654
 
 
655
/*!
 
656
    \variable QStyleOptionTab::Type
 
657
 
 
658
    Equals SO_Tab.
 
659
*/
 
660
 
 
661
/*!
 
662
    \variable QStyleOptionTab::Version
 
663
 
 
664
    Equals 1.
 
665
*/
 
666
 
 
667
/*! \enum QStyleOptionTab::TabPosition
 
668
 
 
669
    \value Beginning The tab is the first tab in the tab bar.
 
670
    \value Middle The tab is neither the first nor the last tab in the tab bar.
 
671
    \value End The tab is the last tab in the tab bar.
 
672
    \value OnlyOneTab The tab is both the first and the last tab in the tab bar.
 
673
 
 
674
    \sa position
 
675
*/
 
676
 
 
677
/*!
 
678
    \enum QStyleOptionTab::CornerWidget
 
679
 
 
680
    These flags indicate the corner widgets in a tab.
 
681
 
 
682
    \value NoCornerWidgets  There are no corner widgets
 
683
    \value LeftCornerWidget  Left corner widget
 
684
    \value RightCornerWidget Right corner widget
 
685
 
 
686
    \sa cornerWidgets
 
687
*/
 
688
 
 
689
/*! \enum QStyleOptionTab::SelectedPosition
 
690
 
 
691
    \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
 
692
    \value NextIsSelected The next tab (typically the tab on the right) is selected.
 
693
    \value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
 
694
 
 
695
    \sa selectedPosition
 
696
*/
 
697
 
 
698
/*!
 
699
    \variable QStyleOptionTab::selectedPosition
 
700
 
 
701
    \brief The position of the selected tab in relation to this tab. Some styles
 
702
    need to draw a tab differently depending on whether or not it is adjacent
 
703
    to the selected tab.
 
704
*/
 
705
 
 
706
/*!
 
707
    \variable QStyleOptionTab::cornerWidgets
 
708
 
 
709
    \brief Information on the cornerwidgets of the tab bar.
 
710
 
 
711
    \sa CornerWidget
 
712
*/
 
713
 
 
714
 
 
715
/*!
 
716
    \variable QStyleOptionTab::shape
 
717
    \brief The tab shape used to draw the tab.
 
718
    \sa QTabBar::Shape
 
719
*/
 
720
 
 
721
/*!
 
722
    \variable QStyleOptionTab::text
 
723
    \brief The text of the tab.
 
724
*/
 
725
 
 
726
/*!
 
727
    \variable QStyleOptionTab::icon
 
728
    \brief The icon for the tab.
 
729
*/
 
730
 
 
731
/*!
 
732
    \variable QStyleOptionTab::row
 
733
    \brief which row the tab is currently in
 
734
 
 
735
    0 indicates the front row.
 
736
 
 
737
    Currently this property can only be 0.
 
738
*/
 
739
 
 
740
/*!
 
741
    \variable QStyleOptionTab::position
 
742
    \brief the position of the tab in the tab bar
 
743
*/
 
744
 
 
745
/*!
 
746
    \class QStyleOptionProgressBar
 
747
    \brief The QStyleOptionProgressBar class is used to describe the
 
748
    parameters necessary for drawing a progress bar.
 
749
 
 
750
    The QStyleOptionProgressBar class is used to draw \l QProgressBar.
 
751
*/
 
752
 
 
753
/*!
 
754
    Constructs a QStyleOptionProgressBar. The members variables are
 
755
    initialized to default values.
 
756
*/
 
757
 
 
758
QStyleOptionProgressBar::QStyleOptionProgressBar()
 
759
    : QStyleOption(QStyleOptionProgressBar::Version, SO_ProgressBar),
 
760
      minimum(0), maximum(0), progress(0), textAlignment(0), textVisible(false)
 
761
{
 
762
}
 
763
 
 
764
/*!
 
765
    \internal
 
766
*/
 
767
QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
 
768
    : QStyleOption(version, SO_ProgressBar),
 
769
      minimum(0), maximum(0), progress(0), textAlignment(0), textVisible(false)
 
770
{
 
771
}
 
772
 
 
773
/*!
 
774
    \fn QStyleOptionProgressBar::QStyleOptionProgressBar(const QStyleOptionProgressBar &other)
 
775
 
 
776
    Constructs a copy of the \a other style option.
 
777
*/
 
778
 
 
779
/*!
 
780
    \variable QStyleOptionProgressBar::Type
 
781
 
 
782
    Equals SO_ProgressBar.
 
783
*/
 
784
 
 
785
/*!
 
786
    \variable QStyleOptionProgressBar::Version
 
787
 
 
788
    Equals 1.
 
789
*/
 
790
 
 
791
/*!
 
792
    \variable QStyleOptionProgressBar::minimum
 
793
    \brief The minimum value for the progress bar
 
794
 
 
795
    This is the minimum value in the progress bar.
 
796
    \sa QProgressBar::minimum
 
797
*/
 
798
 
 
799
/*!
 
800
    \variable QStyleOptionProgressBar::maximum
 
801
    \brief The maximum value for the progress bar
 
802
 
 
803
    This is the maximum value in the progress bar.
 
804
    \sa QProgressBar::maximum
 
805
*/
 
806
 
 
807
/*!
 
808
    \variable QStyleOptionProgressBar::text
 
809
    \brief The text for the progress bar.
 
810
 
 
811
    The progress bar text is usually just the progress expressed as a string.
 
812
    An empty string indicates that the progress bar has not started yet.
 
813
 
 
814
    \sa QProgressBar::text
 
815
*/
 
816
 
 
817
/*!
 
818
    \variable QStyleOptionProgressBar::textVisible
 
819
    \brief A flag indicating whether or not text is visible.
 
820
 
 
821
    If this flag is true then the text is visible. Otherwise, the text is not visible.
 
822
 
 
823
    \sa QProgressBar::textVisible
 
824
*/
 
825
 
 
826
 
 
827
/*!
 
828
    \variable QStyleOptionProgressBar::textAlignment
 
829
    \brief The text alignment for the text in the QProgressBar
 
830
 
 
831
    This can be used as a guide on where the text should be in the progressbar.
 
832
*/
 
833
 
 
834
/*!
 
835
    \variable QStyleOptionProgressBar::progress
 
836
    \brief the current progress for the progress bar.
 
837
 
 
838
    The current progress. A value of QStyleOptionProgressBar::minimum - 1
 
839
    indicates that the progress hasn't started yet.
 
840
 
 
841
    \sa QProgressBar::value
 
842
*/
 
843
 
 
844
/*!
 
845
    \class QStyleOptionMenuItem
 
846
    \brief The QStyleOptionMenuItem class is used to describe the
 
847
    parameter necessary for drawing a menu item.
 
848
 
 
849
    The QStyleOptionMenuItem is used for drawing menu items from \l
 
850
    QMenu. It is also used for drawing other menu-related widgets.
 
851
*/
 
852
 
 
853
/*!
 
854
    Constructs a QStyleOptionMenuItem. The members variables are
 
855
    initialized to default values.
 
856
*/
 
857
 
 
858
QStyleOptionMenuItem::QStyleOptionMenuItem()
 
859
    : QStyleOption(QStyleOptionMenuItem::Version, SO_MenuItem), menuItemType(Normal),
 
860
      checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
 
861
{
 
862
}
 
863
 
 
864
/*!
 
865
    \internal
 
866
*/
 
867
QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
 
868
    : QStyleOption(version, SO_MenuItem), menuItemType(Normal),
 
869
      checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
 
870
{
 
871
}
 
872
 
 
873
/*!
 
874
    \fn QStyleOptionMenuItem::QStyleOptionMenuItem(const QStyleOptionMenuItem &other)
 
875
 
 
876
    Constructs a copy of the \a other style option.
 
877
*/
 
878
 
 
879
/*!
 
880
    \variable QStyleOptionMenuItem::Type
 
881
 
 
882
    Equals SO_MenuItem.
 
883
*/
 
884
 
 
885
/*!
 
886
    \variable QStyleOptionMenuItem::Version
 
887
 
 
888
    Equals 1.
 
889
*/
 
890
 
 
891
/*!
 
892
    \enum QStyleOptionMenuItem::MenuItemType
 
893
 
 
894
    These values indicate the type of menu item that the structure describes.
 
895
 
 
896
    \value Normal A normal menu item.
 
897
    \value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction().
 
898
    \value Separator A menu separator.
 
899
    \value SubMenu Indicates the menu item points to a sub-menu.
 
900
    \value Scroller A popup menu scroller (currently only used on Mac OS X).
 
901
    \value TearOff A tear-off handle for the menu.
 
902
    \value Margin The margin of the menu.
 
903
    \value EmptyArea The empty area of the menu.
 
904
*/
 
905
 
 
906
/*!
 
907
    \enum QStyleOptionMenuItem::CheckType
 
908
 
 
909
    These enums are used to indicate whether or not a check mark should be
 
910
    drawn for the item, or even if it should be drawn at all.
 
911
 
 
912
    \value NotCheckable The item is not checkable.
 
913
    \value Exclusive The item is an exclusive check item (like a radio button).
 
914
    \value NonExclusive The item is a non-exclusive check item (like a check box).
 
915
 
 
916
    \sa QAction::checkable, QAction::checked, QActionGroup::exclusive
 
917
*/
 
918
 
 
919
/*!
 
920
    \variable QStyleOptionMenuItem::menuItemType
 
921
 
 
922
    \brief the type of menu item
 
923
 
 
924
    \sa MenuItemType
 
925
*/
 
926
 
 
927
/*!
 
928
    \variable QStyleOptionMenuItem::checkType
 
929
    \brief The type of checkmark of the menu item
 
930
    \sa CheckType
 
931
*/
 
932
 
 
933
/*!
 
934
    \variable QStyleOptionMenuItem::checked
 
935
    \brief whether the menu item is checked or not.
 
936
*/
 
937
 
 
938
/*!
 
939
    \variable QStyleOptionMenuItem::menuHasCheckableItems
 
940
    \brief whether the menu as a whole has checkable items or not.
 
941
 
 
942
    If this option is set to false, then the menu has no checkable
 
943
    items. This makes it possible for GUI styles to save some
 
944
    horizontal space that would normally be used for the check column.
 
945
*/
 
946
 
 
947
/*!
 
948
    \variable QStyleOptionMenuItem::menuRect
 
949
    \brief The rectangle for the entire menu.
 
950
*/
 
951
 
 
952
/*!
 
953
    \variable QStyleOptionMenuItem::text
 
954
    \brief The text for the menu item.
 
955
 
 
956
    Note that the text format is something like this "Menu
 
957
    text\bold{\\t}Shortcut".
 
958
 
 
959
    If the menu item doesn't have a shortcut, it will just contain
 
960
    the menu item's text.
 
961
*/
 
962
 
 
963
/*!
 
964
    \variable QStyleOptionMenuItem::icon
 
965
    \brief The icon for the menu item.
 
966
*/
 
967
 
 
968
/*!
 
969
    \variable QStyleOptionMenuItem::maxIconWidth
 
970
    \brief the maximum icon width for the icon in the menu item.
 
971
 
 
972
    This can be used for drawing the icon into the correct place or
 
973
    properly aligning items. The variable must be set regardless of
 
974
    whether or not the menu item has an icon.
 
975
*/
 
976
 
 
977
/*!
 
978
    \variable QStyleOptionMenuItem::tabWidth
 
979
    \brief The tab width for the menu item.
 
980
 
 
981
    The tab width is the distance between the text of the menu item
 
982
    and the shortcut.
 
983
*/
 
984
 
 
985
 
 
986
/*!
 
987
    \variable QStyleOptionMenuItem::font
 
988
    \brief The font used for the menu item text.
 
989
 
 
990
    This is the font that should be used for drawing the menu text minus the
 
991
    shortcut. The shortcut is usually drawn using the painter's font.
 
992
*/
 
993
 
 
994
/*!
 
995
    \class QStyleOptionComplex
 
996
    \brief The QStyleOptionComplex class is used to hold parameters that are
 
997
    common to all complex controls.
 
998
 
 
999
    This class is not used on its own. Instead it is used to derive other
 
1000
    complex control options, for example \l QStyleOptionSlider and
 
1001
    \l QStyleOptionSpinBox.
 
1002
*/
 
1003
 
 
1004
/*!
 
1005
    Constructs a QStyleOptionComplex of type \a type and version \a
 
1006
    version. Usually this constructor is called by subclasses.
 
1007
 
 
1008
    The \l subControls member is initialized to \l QStyle::SC_All.
 
1009
    The \l activeSubControls member is initialized to \l
 
1010
    QStyle::SC_None.
 
1011
*/
 
1012
 
 
1013
QStyleOptionComplex::QStyleOptionComplex(int version, int type)
 
1014
    : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None)
 
1015
{
 
1016
}
 
1017
 
 
1018
/*!
 
1019
    \fn QStyleOptionComplex::QStyleOptionComplex(const QStyleOptionComplex &other)
 
1020
 
 
1021
    Constructs a copy of the \a other style option.
 
1022
*/
 
1023
 
 
1024
/*!
 
1025
    \variable QStyleOptionComplex::Type
 
1026
 
 
1027
    Equals SO_Complex.
 
1028
*/
 
1029
 
 
1030
/*!
 
1031
    \variable QStyleOptionComplex::Version
 
1032
 
 
1033
    Equals 1.
 
1034
*/
 
1035
 
 
1036
/*!
 
1037
    \variable QStyleOptionComplex::subControls
 
1038
    \brief The sub-controls that need to be painted.
 
1039
 
 
1040
    This is a bitwise OR of the various sub-controls that need to be drawn for the complex control.
 
1041
 
 
1042
    \sa QStyle::SubControl
 
1043
*/
 
1044
 
 
1045
/*!
 
1046
    \variable QStyleOptionComplex::activeSubControls
 
1047
    \brief The sub-controls that are active for the complex control.
 
1048
 
 
1049
    This a bitwise OR of the various sub-controls that are active (pressed) for the complex control.
 
1050
 
 
1051
    \sa QStyle::SubControl
 
1052
*/
 
1053
 
 
1054
/*!
 
1055
    \class QStyleOptionSlider
 
1056
    \brief The QStyleOptionSlider class is used to describe the
 
1057
    parameters needed for drawing a slider.
 
1058
 
 
1059
    The QStyleOptionSlider class is used for drawing \l QSlider and
 
1060
    \l QScrollBar.
 
1061
*/
 
1062
 
 
1063
/*!
 
1064
    Constructs a QStyleOptionSlider. The members variables are
 
1065
    initialized to default values.
 
1066
*/
 
1067
 
 
1068
QStyleOptionSlider::QStyleOptionSlider()
 
1069
    : QStyleOptionComplex(Version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
 
1070
      tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
 
1071
      sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
 
1072
      dialWrapping(false)
 
1073
{
 
1074
}
 
1075
 
 
1076
/*!
 
1077
    \internal
 
1078
*/
 
1079
QStyleOptionSlider::QStyleOptionSlider(int version)
 
1080
    : QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
 
1081
      tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
 
1082
      sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
 
1083
      dialWrapping(false)
 
1084
{
 
1085
}
 
1086
 
 
1087
/*!
 
1088
    \fn QStyleOptionSlider::QStyleOptionSlider(const QStyleOptionSlider &other)
 
1089
 
 
1090
    Constructs a copy of the \a other style option.
 
1091
*/
 
1092
 
 
1093
/*!
 
1094
    \variable QStyleOptionSlider::Type
 
1095
 
 
1096
    Equals SO_Slider.
 
1097
*/
 
1098
 
 
1099
/*!
 
1100
    \variable QStyleOptionSlider::Version
 
1101
 
 
1102
    Equals 1.
 
1103
*/
 
1104
 
 
1105
/*!
 
1106
    \variable QStyleOptionSlider::orientation
 
1107
    \brief the slider's orientation (horizontal or vertical)
 
1108
 
 
1109
    \sa Qt::Orientation
 
1110
*/
 
1111
 
 
1112
/*!
 
1113
    \variable QStyleOptionSlider::minimum
 
1114
    \brief The minimum value for the slider.
 
1115
*/
 
1116
 
 
1117
/*!
 
1118
    \variable QStyleOptionSlider::maximum
 
1119
    \brief The maximum value for the slider.
 
1120
*/
 
1121
 
 
1122
/*!
 
1123
    \variable QStyleOptionSlider::tickPosition
 
1124
    \brief the position of the slider's tick marks, if any.
 
1125
 
 
1126
    \sa QSlider::TickPosition
 
1127
*/
 
1128
 
 
1129
/*!
 
1130
    \variable QStyleOptionSlider::tickInterval
 
1131
    \brief The interval that should be drawn between tick marks.
 
1132
*/
 
1133
 
 
1134
/*!
 
1135
    \variable QStyleOptionSlider::notchTarget
 
1136
    \brief The number of pixel between notches
 
1137
 
 
1138
    \sa QDial::notchTarget()
 
1139
*/
 
1140
 
 
1141
/*!
 
1142
    \variable QStyleOptionSlider::dialWrapping
 
1143
    \brief Indicates whether or not the dial should wrap or not
 
1144
 
 
1145
    \sa QDial::wrapping()
 
1146
*/
 
1147
 
 
1148
/*!
 
1149
    \variable QStyleOptionSlider::upsideDown
 
1150
    \brief Indicates slider control orientation.
 
1151
 
 
1152
    Normally a slider increases as it moves up or to the right; upsideDown
 
1153
    indicates that it should do the opposite (increase as it moves down or to
 
1154
    the left).
 
1155
 
 
1156
    \sa QStyle::sliderPositionFromValue(), QStyle::sliderValueFromPosition(),
 
1157
        QAbstractSlider::invertedAppearance
 
1158
*/
 
1159
 
 
1160
/*!
 
1161
    \variable QStyleOptionSlider::sliderPosition
 
1162
    \brief The position of the slider handle.
 
1163
 
 
1164
    If the slider has active feedback (i.e.,
 
1165
    QAbstractSlider::tracking is true), this value will be the same
 
1166
    as \l sliderValue. Otherwise, it will have the current position
 
1167
    of the handle.
 
1168
 
 
1169
    \sa QAbstractSlider::tracking, sliderValue
 
1170
*/
 
1171
 
 
1172
/*!
 
1173
    \variable QStyleOptionSlider::sliderValue
 
1174
    \brief The value of the slider.
 
1175
 
 
1176
    If the slider has active feedback (i.e.,
 
1177
    QAbstractSlider::tracking is true), this value will be the same
 
1178
    as \l sliderPosition. Otherwise, it will have the value the
 
1179
    slider had before the mouse was pressed.
 
1180
 
 
1181
    \sa QAbstractSlider::tracking sliderPosition
 
1182
*/
 
1183
 
 
1184
/*!
 
1185
    \variable QStyleOptionSlider::singleStep
 
1186
    \brief The size of the single step of the slider.
 
1187
 
 
1188
    \sa QAbstractSlider::singleStep
 
1189
*/
 
1190
 
 
1191
/*!
 
1192
    \variable QStyleOptionSlider::pageStep
 
1193
    \brief The size of the page step of the slider.
 
1194
 
 
1195
    \sa QAbstractSlider::pageStep
 
1196
*/
 
1197
 
 
1198
/*!
 
1199
    \class QStyleOptionSpinBox
 
1200
    \brief The QStyleOptionSpinBox class is used to describe the
 
1201
    parameters necessary for drawing a spin box.
 
1202
 
 
1203
    The QStyleOptionSpinBox is used for drawing QSpinBox and QDateTimeEdit.
 
1204
*/
 
1205
 
 
1206
/*!
 
1207
    Constructs a QStyleOptionSpinBox. The members variables are
 
1208
    initialized to default values.
 
1209
*/
 
1210
 
 
1211
QStyleOptionSpinBox::QStyleOptionSpinBox()
 
1212
    : QStyleOptionComplex(Version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
 
1213
      stepEnabled(QAbstractSpinBox::StepNone), frame(false)
 
1214
{
 
1215
}
 
1216
 
 
1217
/*!
 
1218
    \internal
 
1219
*/
 
1220
QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
 
1221
    : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
 
1222
      stepEnabled(QAbstractSpinBox::StepNone), frame(false)
 
1223
{
 
1224
}
 
1225
 
 
1226
/*!
 
1227
    \fn QStyleOptionSpinBox::QStyleOptionSpinBox(const QStyleOptionSpinBox &other)
 
1228
 
 
1229
    Constructs a copy of the \a other style option.
 
1230
*/
 
1231
 
 
1232
/*!
 
1233
    \variable QStyleOptionSpinBox::Type
 
1234
 
 
1235
    Equals SO_SpinBox.
 
1236
*/
 
1237
 
 
1238
/*!
 
1239
    \variable QStyleOptionSpinBox::Version
 
1240
 
 
1241
    Equals 1.
 
1242
*/
 
1243
 
 
1244
/*!
 
1245
    \variable QStyleOptionSpinBox::buttonSymbols
 
1246
    \brief The type of button symbols to draw for the spin box.
 
1247
 
 
1248
    \sa QAbstractSpinBox::ButtonSymbols
 
1249
*/
 
1250
 
 
1251
/*!
 
1252
    \variable QStyleOptionSpinBox::stepEnabled
 
1253
    \brief Indicates which buttons of the spin box are enabled.
 
1254
 
 
1255
    \sa QAbstractSpinBox::StepEnabled
 
1256
*/
 
1257
 
 
1258
/*!
 
1259
    \variable QStyleOptionSpinBox::frame
 
1260
    \brief Indicates whether whether the spin box has a frame.
 
1261
 
 
1262
*/
 
1263
 
 
1264
/*!
 
1265
    \class QStyleOptionQ3ListViewItem
 
1266
    \brief The QStyleOptionQ3ListViewItem class is used to describe an
 
1267
    item drawn in a Q3ListView.
 
1268
 
 
1269
    This is used by the compatibility Q3ListView to draw its items.
 
1270
    It should be avoided for new classes.
 
1271
 
 
1272
    \sa Q3ListView, Q3ListViewItem
 
1273
*/
 
1274
 
 
1275
/*!
 
1276
    \enum QStyleOptionQ3ListViewItem::Q3ListViewItemFeature
 
1277
 
 
1278
    This enum describes the features a list view item can have.
 
1279
 
 
1280
    \value None A standard item.
 
1281
    \value Expandable The item has children that can be shown.
 
1282
    \value MultiLine The item is more than one line tall.
 
1283
    \value Visible The item is visible.
 
1284
    \value ParentControl The item's parent is a type of item control (Q3CheckListItem::Controller).
 
1285
 
 
1286
    \sa features, Q3ListViewItem::isVisible(), Q3ListViewItem::multiLinesEnabled(),
 
1287
        Q3ListViewItem::isExpandable()
 
1288
*/
 
1289
 
 
1290
/*!
 
1291
    Constructs a QStyleOptionQ3ListViewItem. The members variables are
 
1292
    initialized to default values.
 
1293
*/
 
1294
 
 
1295
QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem()
 
1296
    : QStyleOption(Version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
 
1297
      itemY(0), childCount(0)
 
1298
{
 
1299
}
 
1300
 
 
1301
/*!
 
1302
    \internal
 
1303
*/
 
1304
QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(int version)
 
1305
    : QStyleOption(version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
 
1306
      itemY(0), childCount(0)
 
1307
{
 
1308
}
 
1309
 
 
1310
/*!
 
1311
    \fn QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other)
 
1312
 
 
1313
    Constructs a copy of the \a other style option.
 
1314
*/
 
1315
 
 
1316
/*!
 
1317
    \variable QStyleOptionQ3ListViewItem::Type
 
1318
 
 
1319
    Equals SO_Q3ListViewItem.
 
1320
*/
 
1321
 
 
1322
/*!
 
1323
    \variable QStyleOptionQ3ListViewItem::Version
 
1324
 
 
1325
    Equals 1.
 
1326
*/
 
1327
 
 
1328
/*!
 
1329
    \variable QStyleOptionQ3ListViewItem::features
 
1330
    \brief The features for this item
 
1331
 
 
1332
    This variable is a bitwise OR of the features of the item.
 
1333
 
 
1334
    \sa Q3ListViewItemFeature
 
1335
*/
 
1336
 
 
1337
/*!
 
1338
    \variable QStyleOptionQ3ListViewItem::height
 
1339
    \brief The height of the item
 
1340
 
 
1341
    This doesn't include the height of the item's children.
 
1342
 
 
1343
    \sa Q3ListViewItem::height()
 
1344
*/
 
1345
 
 
1346
/*!
 
1347
    \variable QStyleOptionQ3ListViewItem::totalHeight
 
1348
    \brief The total height of the item, including its children
 
1349
 
 
1350
    \sa Q3ListViewItem::totalHeight()
 
1351
*/
 
1352
 
 
1353
/*!
 
1354
    \variable QStyleOptionQ3ListViewItem::itemY
 
1355
    \brief The Y-coordinate for the item
 
1356
 
 
1357
    \sa Q3ListViewItem::itemPos()
 
1358
*/
 
1359
 
 
1360
/*!
 
1361
    \variable QStyleOptionQ3ListViewItem::childCount
 
1362
    \brief The number of children the item has.
 
1363
*/
 
1364
 
 
1365
/*!
 
1366
    \class QStyleOptionQ3ListView
 
1367
    \brief The QStyleOptionQ3ListView class is used to describe the
 
1368
    parameters for drawing a Q3ListView.
 
1369
 
 
1370
    The class is used for drawing the compat \l Q3ListView. It is not
 
1371
    recommended for use in new code.
 
1372
*/
 
1373
 
 
1374
/*!
 
1375
    Creates a QStyleOptionQ3ListView. The members variables are
 
1376
    initialized to default values.
 
1377
*/
 
1378
 
 
1379
QStyleOptionQ3ListView::QStyleOptionQ3ListView()
 
1380
    : QStyleOptionComplex(Version, SO_Q3ListView), sortColumn(0), itemMargin(0), treeStepSize(0),
 
1381
      rootIsDecorated(false)
 
1382
{
 
1383
}
 
1384
 
 
1385
/*!
 
1386
    \internal
 
1387
*/
 
1388
QStyleOptionQ3ListView::QStyleOptionQ3ListView(int version)
 
1389
    : QStyleOptionComplex(version, SO_Q3ListView), sortColumn(0), itemMargin(0), treeStepSize(0),
 
1390
      rootIsDecorated(false)
 
1391
{
 
1392
}
 
1393
 
 
1394
/*!
 
1395
    \fn QStyleOptionQ3ListView::QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other)
 
1396
 
 
1397
    Constructs a copy of the \a other style option.
 
1398
*/
 
1399
 
 
1400
/*!
 
1401
    \variable QStyleOptionQ3ListView::Type
 
1402
 
 
1403
    Equals SO_Q3ListView.
 
1404
*/
 
1405
 
 
1406
/*!
 
1407
    \variable QStyleOptionQ3ListView::Version
 
1408
 
 
1409
    Equals 1.
 
1410
*/
 
1411
 
 
1412
/*!
 
1413
    \variable QStyleOptionQ3ListView::items
 
1414
    \brief A list of items in the \l Q3ListView.
 
1415
 
 
1416
    This is a list of \l {QStyleOptionQ3ListViewItem}s. The first item
 
1417
    can be used for most of the calculation that are needed for
 
1418
    drawing a list view. Any additional items are the children of
 
1419
    this first item, which may be used for additional information.
 
1420
 
 
1421
    \sa QStyleOptionQ3ListViewItem
 
1422
*/
 
1423
 
 
1424
/*!
 
1425
    \variable QStyleOptionQ3ListView::viewportPalette
 
1426
    \brief The palette of Q3ListView's viewport.
 
1427
*/
 
1428
 
 
1429
/*!
 
1430
    \variable QStyleOptionQ3ListView::viewportBGRole
 
1431
    \brief The background role of \l Q3ListView's viewport.
 
1432
 
 
1433
    \sa QWidget::backgroundRole()
 
1434
*/
 
1435
 
 
1436
/*!
 
1437
    \variable QStyleOptionQ3ListView::sortColumn
 
1438
    \brief The sort column of the list view.
 
1439
 
 
1440
    \sa Q3ListView::sortColumn()
 
1441
*/
 
1442
 
 
1443
/*!
 
1444
    \variable QStyleOptionQ3ListView::itemMargin
 
1445
    \brief The margin for items in the list view.
 
1446
 
 
1447
    \sa Q3ListView::itemMargin()
 
1448
*/
 
1449
 
 
1450
/*!
 
1451
    \variable QStyleOptionQ3ListView::treeStepSize
 
1452
    \brief The number of pixel to offset children items from their parents.
 
1453
 
 
1454
    \sa Q3ListView::treeStepSize()
 
1455
*/
 
1456
 
 
1457
/*!
 
1458
    \variable QStyleOptionQ3ListView::rootIsDecorated
 
1459
    \brief Whether root items are decorated
 
1460
 
 
1461
    \sa Q3ListView::rootIsDecorated()
 
1462
*/
 
1463
 
 
1464
/*!
 
1465
    \class QStyleOptionQ3DockWindow
 
1466
    \brief The QStyleOptionQ3DockWindow class is used to describe the
 
1467
    parameters for drawing various parts of a \l Q3DockWindow.
 
1468
 
 
1469
    This class is used for drawing the old Q3DockWindow and its
 
1470
    parts. It is not recommended for new classes.
 
1471
*/
 
1472
 
 
1473
/*!
 
1474
    Constructs a QStyleOptionQ3DockWindow. The member variables are
 
1475
    initialized to default values.
 
1476
*/
 
1477
 
 
1478
QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow()
 
1479
    : QStyleOption(Version, SO_Q3DockWindow), docked(false), closeEnabled(false)
 
1480
{
 
1481
}
 
1482
 
 
1483
/*!
 
1484
    \internal
 
1485
*/
 
1486
QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(int version)
 
1487
    : QStyleOption(version, SO_Q3DockWindow), docked(false), closeEnabled(false)
 
1488
{
 
1489
}
 
1490
 
 
1491
/*!
 
1492
    \fn QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other)
 
1493
 
 
1494
    Constructs a copy of the \a other style option.
 
1495
*/
 
1496
 
 
1497
/*!
 
1498
    \variable QStyleOptionQ3DockWindow::Type
 
1499
 
 
1500
    Equals SO_Q3DockWindow.
 
1501
*/
 
1502
 
 
1503
/*!
 
1504
    \variable QStyleOptionQ3DockWindow::Version
 
1505
 
 
1506
    Equals 1.
 
1507
*/
 
1508
 
 
1509
/*!
 
1510
    \variable QStyleOptionQ3DockWindow::docked
 
1511
    \brief Indicates that the dock window is currently docked.
 
1512
*/
 
1513
 
 
1514
/*!
 
1515
    \variable QStyleOptionQ3DockWindow::closeEnabled
 
1516
    \brief Indicates that the dock window has a close button.
 
1517
*/
 
1518
 
 
1519
/*!
 
1520
    \class QStyleOptionDockWidget
 
1521
    \brief The QStyleOptionDockWidget class is used to describe the
 
1522
    parameters for drawing a dock window.
 
1523
*/
 
1524
 
 
1525
/*!
 
1526
    Constructs a QStyleOptionDockWidget. The member variables are
 
1527
    initialized to default values.
 
1528
*/
 
1529
 
 
1530
QStyleOptionDockWidget::QStyleOptionDockWidget()
 
1531
    : QStyleOption(Version, SO_DockWidget), movable(false)
 
1532
{
 
1533
}
 
1534
 
 
1535
/*!
 
1536
    \internal
 
1537
*/
 
1538
QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
 
1539
    : QStyleOption(version, SO_DockWidget), closable(false),
 
1540
      movable(false), floatable(false)
 
1541
{
 
1542
}
 
1543
 
 
1544
/*!
 
1545
    \fn QStyleOptionDockWidget::QStyleOptionDockWidget(const QStyleOptionDockWidget &other)
 
1546
 
 
1547
    Constructs a copy of the \a other style option.
 
1548
*/
 
1549
 
 
1550
/*!
 
1551
    \variable QStyleOptionDockWidget::Type
 
1552
 
 
1553
    Equals SO_DockWidget.
 
1554
*/
 
1555
 
 
1556
/*!
 
1557
    \variable QStyleOptionDockWidget::Version
 
1558
 
 
1559
    Equals 1.
 
1560
*/
 
1561
 
 
1562
/*!
 
1563
    \variable QStyleOptionDockWidget::title
 
1564
    \brief The title of the dock window
 
1565
*/
 
1566
 
 
1567
/*!
 
1568
    \variable QStyleOptionDockWidget::closable
 
1569
    \brief Indicates that the dock window is closable.
 
1570
*/
 
1571
 
 
1572
/*!
 
1573
    \variable QStyleOptionDockWidget::movable
 
1574
    \brief Indicates that the dock window is movable.
 
1575
*/
 
1576
 
 
1577
/*!
 
1578
    \variable QStyleOptionDockWidget::floatable
 
1579
    \brief Indicates that the dock window is floatable.
 
1580
*/
 
1581
 
 
1582
/*!
 
1583
    \class QStyleOptionToolButton
 
1584
    \brief The QStyleOptionToolButton class is used to describe the
 
1585
    parameters for drawing a tool button.
 
1586
 
 
1587
    The QStyleOptionToolButton class is used for drawing QToolButton.
 
1588
*/
 
1589
 
 
1590
/*!
 
1591
    \enum QStyleOptionToolButton::ToolButtonFeature
 
1592
    Describes the various features that a tool button can have.
 
1593
 
 
1594
    \value None A normal tool button.
 
1595
    \value Arrow The tool button is an arrow.
 
1596
    \value Menu The tool button has a menu.
 
1597
    \value PopupDelay There is a delay to showing the menu.
 
1598
 
 
1599
    \sa features, QToolButton::toolButtonStyle(), QToolButton::popupMode()
 
1600
*/
 
1601
 
 
1602
/*!
 
1603
    Constructs a QStyleOptionToolButton. The members variables are
 
1604
    initialized to default values.
 
1605
*/
 
1606
 
 
1607
QStyleOptionToolButton::QStyleOptionToolButton()
 
1608
    : QStyleOptionComplex(Version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
 
1609
    , toolButtonStyle(Qt::ToolButtonIconOnly)
 
1610
{
 
1611
}
 
1612
 
 
1613
/*!
 
1614
    \internal
 
1615
*/
 
1616
QStyleOptionToolButton::QStyleOptionToolButton(int version)
 
1617
    : QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
 
1618
    , toolButtonStyle(Qt::ToolButtonIconOnly)
 
1619
 
 
1620
{
 
1621
}
 
1622
 
 
1623
/*!
 
1624
    \fn QStyleOptionToolButton::QStyleOptionToolButton(const QStyleOptionToolButton &other)
 
1625
 
 
1626
    Constructs a copy of the \a other style option.
 
1627
*/
 
1628
 
 
1629
/*!
 
1630
    \variable QStyleOptionToolButton::Type
 
1631
 
 
1632
    Equals SO_ToolButton.
 
1633
*/
 
1634
 
 
1635
/*!
 
1636
    \variable QStyleOptionToolButton::Version
 
1637
 
 
1638
    Equals 1.
 
1639
*/
 
1640
 
 
1641
/*!
 
1642
    \variable QStyleOptionToolButton::features
 
1643
    \brief The features of the tool button.
 
1644
 
 
1645
    This variable is a bitwise OR describing the features of the button.
 
1646
 
 
1647
    \sa ToolButtonFeature
 
1648
*/
 
1649
 
 
1650
/*!
 
1651
    \variable QStyleOptionToolButton::icon
 
1652
    \brief The icon for the tool button.
 
1653
 
 
1654
    \sa iconSize
 
1655
*/
 
1656
 
 
1657
/*!
 
1658
    \variable QStyleOptionToolButton::iconSize
 
1659
    \brief the size of the icon for the tool button
 
1660
*/
 
1661
 
 
1662
/*!
 
1663
    \variable QStyleOptionToolButton::text
 
1664
    \brief The text of the tool button.
 
1665
 
 
1666
    This value is only used if toolButtonStyle is Qt::ToolButtonTextUnderIcon,
 
1667
    Qt::ToolButtonTextBesideIcon, or Qt::ToolButtonTextOnly
 
1668
*/
 
1669
 
 
1670
/*!
 
1671
    \variable QStyleOptionToolButton::arrowType
 
1672
    \brief The direction of the arrow for the tool button
 
1673
 
 
1674
    This value is only used if \l features includes \l Arrow.
 
1675
*/
 
1676
 
 
1677
/*!
 
1678
    \variable QStyleOptionToolButton::toolButtonStyle
 
1679
    \brief Used to describe the appearance of a tool button
 
1680
 
 
1681
    \sa QToolButton::toolButtonStyle()
 
1682
*/
 
1683
 
 
1684
/*!
 
1685
    \variable QStyleOptionToolButton::pos
 
1686
    \brief The position of the tool button
 
1687
*/
 
1688
 
 
1689
/*!
 
1690
    \variable QStyleOptionToolButton::font
 
1691
    \brief The font that is used for the text.
 
1692
 
 
1693
    This value is only used if toolButtonStyle is Qt::ToolButtonTextUnderIcon,
 
1694
    Qt::ToolButtonTextBesideIcon, or Qt::ToolButtonTextOnly
 
1695
*/
 
1696
 
 
1697
/*!
 
1698
    \class QStyleOptionComboBox
 
1699
    \brief The QStyleOptionComboBox class is used to describe the
 
1700
    parameter for drawing a combobox.
 
1701
 
 
1702
    The QStyleOptionComboBox class is used for drawing QComboBox.
 
1703
*/
 
1704
 
 
1705
/*!
 
1706
    Creates a QStyleOptionComboBox. The members variables are
 
1707
    initialized to default values.
 
1708
*/
 
1709
 
 
1710
QStyleOptionComboBox::QStyleOptionComboBox()
 
1711
    : QStyleOptionComplex(Version, SO_ComboBox), editable(false), frame(true)
 
1712
{
 
1713
}
 
1714
 
 
1715
/*!
 
1716
    \internal
 
1717
*/
 
1718
QStyleOptionComboBox::QStyleOptionComboBox(int version)
 
1719
    : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true)
 
1720
{
 
1721
}
 
1722
 
 
1723
/*!
 
1724
    \fn QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)
 
1725
 
 
1726
    Constructs a copy of the \a other style option.
 
1727
*/
 
1728
 
 
1729
/*!
 
1730
    \variable QStyleOptionComboBox::Type
 
1731
 
 
1732
    Equals SO_ComboBox.
 
1733
*/
 
1734
 
 
1735
/*!
 
1736
    \variable QStyleOptionComboBox::Version
 
1737
 
 
1738
    Equals 1.
 
1739
*/
 
1740
 
 
1741
/*!
 
1742
    \variable QStyleOptionComboBox::editable
 
1743
    \brief whether or not the combobox is editable or not.
 
1744
 
 
1745
    \sa QComboBox::isEditable()
 
1746
*/
 
1747
 
 
1748
 
 
1749
/*!
 
1750
    \variable QStyleOptionComboBox::frame
 
1751
    \brief Indicates whether whether the combo box has a frame.
 
1752
*/
 
1753
 
 
1754
/*!
 
1755
    \variable QStyleOptionComboBox::currentText
 
1756
    \brief The text for the current item of the combo box
 
1757
*/
 
1758
 
 
1759
/*!
 
1760
    \variable QStyleOptionComboBox::currentIcon
 
1761
    \brief The icon for the current item of the combo box
 
1762
*/
 
1763
 
 
1764
/*!
 
1765
    \variable QStyleOptionComboBox::iconSize
 
1766
    \brief The icon size for the current item of the combo box
 
1767
*/
 
1768
 
 
1769
/*!
 
1770
    \variable QStyleOptionComboBox::popupRect
 
1771
    \brief The popup rectangle for the combobox.
 
1772
*/
 
1773
 
 
1774
/*!
 
1775
    \class QStyleOptionToolBox
 
1776
    \brief The QStyleOptionToolBox class is used to describe the
 
1777
    parameters needed for drawing a tool box.
 
1778
 
 
1779
    The QStyleOptionToolBox class is used for drawing QToolBox.
 
1780
*/
 
1781
 
 
1782
/*!
 
1783
    Creates a QStyleOptionToolBox. The members variables are
 
1784
    initialized to default values.
 
1785
*/
 
1786
 
 
1787
QStyleOptionToolBox::QStyleOptionToolBox()
 
1788
    : QStyleOption(Version, SO_ToolBox)
 
1789
{
 
1790
}
 
1791
 
 
1792
/*!
 
1793
    \internal
 
1794
*/
 
1795
QStyleOptionToolBox::QStyleOptionToolBox(int version)
 
1796
    : QStyleOption(version, SO_ToolBox)
 
1797
{
 
1798
}
 
1799
 
 
1800
/*!
 
1801
    \fn QStyleOptionToolBox::QStyleOptionToolBox(const QStyleOptionToolBox &other)
 
1802
 
 
1803
    Constructs a copy of the \a other style option.
 
1804
*/
 
1805
 
 
1806
/*!
 
1807
    \variable QStyleOptionToolBox::Type
 
1808
 
 
1809
    Equals SO_ToolBox.
 
1810
*/
 
1811
 
 
1812
/*!
 
1813
    \variable QStyleOptionToolBox::Version
 
1814
 
 
1815
    Equals 1.
 
1816
*/
 
1817
 
 
1818
/*!
 
1819
    \variable QStyleOptionToolBox::icon
 
1820
    \brief The icon for the tool box tab.
 
1821
*/
 
1822
 
 
1823
/*!
 
1824
    \variable QStyleOptionToolBox::text
 
1825
    \brief The text for the tool box tab.
 
1826
*/
 
1827
 
 
1828
 
 
1829
/*!
 
1830
    \class QStyleOptionRubberBand
 
1831
    \brief The QStyleOptionRubberBand class is used to describe the
 
1832
    parameters needed for drawing a rubber band.
 
1833
 
 
1834
    The QStyleOptionRubberBand class is used for drawing QRubberBand.
 
1835
*/
 
1836
 
 
1837
/*!
 
1838
    Creates a QStyleOptionRubberBand. The members variables are
 
1839
    initialized to default values.
 
1840
*/
 
1841
 
 
1842
QStyleOptionRubberBand::QStyleOptionRubberBand()
 
1843
    : QStyleOption(Version, SO_RubberBand)
 
1844
{
 
1845
}
 
1846
 
 
1847
/*!
 
1848
    \internal
 
1849
*/
 
1850
QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
 
1851
    : QStyleOption(version, SO_RubberBand)
 
1852
{
 
1853
}
 
1854
 
 
1855
/*!
 
1856
    \fn QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other)
 
1857
 
 
1858
    Constructs a copy of the \a other style option.
 
1859
*/
 
1860
 
 
1861
/*!
 
1862
    \variable QStyleOptionRubberBand::Type
 
1863
 
 
1864
    Equals SO_RubberBand.
 
1865
*/
 
1866
 
 
1867
/*!
 
1868
    \variable QStyleOptionRubberBand::Version
 
1869
 
 
1870
    Equals 1.
 
1871
*/
 
1872
 
 
1873
/*!
 
1874
    \variable QStyleOptionRubberBand::shape
 
1875
    \brief The shape of the rubber band.
 
1876
*/
 
1877
 
 
1878
/*!
 
1879
    \variable QStyleOptionRubberBand::opaque
 
1880
    \brief Whether the rubber band is required to be drawn in an opque style.
 
1881
*/
 
1882
 
 
1883
/*!
 
1884
    \class QStyleOptionTitleBar
 
1885
    \brief The QStyleOptionTitleBar class is used to describe the
 
1886
    parameters for drawing a title bar.
 
1887
 
 
1888
    The QStyleOptionTitleBar class is used to draw the title bars of
 
1889
    QWorkspace's MDI children.
 
1890
*/
 
1891
 
 
1892
/*!
 
1893
    Constructs a QStyleOptionTitleBar. The members variables are
 
1894
    initialized to default values.
 
1895
*/
 
1896
 
 
1897
QStyleOptionTitleBar::QStyleOptionTitleBar()
 
1898
    : QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
 
1899
{
 
1900
}
 
1901
 
 
1902
/*!
 
1903
    \fn QStyleOptionTitleBar::QStyleOptionTitleBar(const QStyleOptionTitleBar &other)
 
1904
 
 
1905
    Constructs a copy of the \a other style option.
 
1906
*/
 
1907
 
 
1908
/*!
 
1909
    \variable QStyleOptionTitleBar::Type
 
1910
 
 
1911
    Equals SO_TitleBar.
 
1912
*/
 
1913
 
 
1914
/*!
 
1915
    \variable QStyleOptionTitleBar::Version
 
1916
 
 
1917
    Equals 1.
 
1918
*/
 
1919
 
 
1920
/*!
 
1921
    \internal
 
1922
*/
 
1923
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
 
1924
    : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
 
1925
{
 
1926
}
 
1927
 
 
1928
 
 
1929
/*!
 
1930
    \variable QStyleOptionTitleBar::text
 
1931
    \brief The text of the title bar.
 
1932
*/
 
1933
 
 
1934
/*!
 
1935
    \variable QStyleOptionTitleBar::icon
 
1936
    \brief The icon for the title bar.
 
1937
*/
 
1938
 
 
1939
/*!
 
1940
    \variable QStyleOptionTitleBar::titleBarState
 
1941
    \brief The state of the title bar.
 
1942
 
 
1943
    This is basically the window state of the underlying widget.
 
1944
 
 
1945
    \sa QWidget::windowState()
 
1946
*/
 
1947
 
 
1948
/*!
 
1949
    \variable QStyleOptionTitleBar::titleBarFlags
 
1950
    \brief The widget flags for the title bar.
 
1951
 
 
1952
    \sa Qt::WFlags
 
1953
*/
 
1954
 
 
1955
/*!
 
1956
    \class QStyleOptionViewItem
 
1957
    \brief The QStyleOptionViewItem class is used to describe the
 
1958
    parameters used to draw an item in a view widget.
 
1959
 
 
1960
    The QStyleOptionViewItem class is used by Qt's model/view classes
 
1961
    to draw their items.
 
1962
 
 
1963
    \sa {model-view-programming.html}{Model/View Programming}
 
1964
*/
 
1965
 
 
1966
/*!
 
1967
    \enum QStyleOptionViewItem::Position
 
1968
 
 
1969
    This enum describes the position of the item's decoration.
 
1970
 
 
1971
    \value Left On the left of the text.
 
1972
    \value Right On the right of the text.
 
1973
    \value Top Above the text.
 
1974
    \value Bottom Below the text.
 
1975
 
 
1976
    \sa decorationPosition
 
1977
*/
 
1978
 
 
1979
/*!
 
1980
    \variable QStyleOptionViewItem::showDecorationSelected
 
1981
 
 
1982
    \brief Whether the decoration should be highlighted on selected items.
 
1983
 
 
1984
    If this option is true, the branch and any decorations on selected items
 
1985
    should be highlighted, indicating that the item is selected; otherwise, no
 
1986
    highlighting is required.
 
1987
 
 
1988
    \sa QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView
 
1989
*/
 
1990
 
 
1991
/*!
 
1992
    \variable QStyleOptionViewItem::textElideMode
 
1993
 
 
1994
    \brief Where ellipsis should be added for text that is too long to fit
 
1995
    into an item.
 
1996
 
 
1997
    \sa Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation
 
1998
*/
 
1999
 
 
2000
/*!
 
2001
    Constructs a QStyleOptionViewItem. The members variables are
 
2002
    initialized to default values.
 
2003
*/
 
2004
 
 
2005
QStyleOptionViewItem::QStyleOptionViewItem()
 
2006
    : QStyleOption(Version, SO_ViewItem),
 
2007
      displayAlignment(0), decorationAlignment(0),
 
2008
      textElideMode(Qt::ElideMiddle), decorationPosition(Left),
 
2009
      showDecorationSelected(false)
 
2010
{
 
2011
}
 
2012
 
 
2013
/*!
 
2014
    \internal
 
2015
*/
 
2016
QStyleOptionViewItem::QStyleOptionViewItem(int version)
 
2017
    : QStyleOption(version, SO_ViewItem),
 
2018
      displayAlignment(0), decorationAlignment(0),
 
2019
      textElideMode(Qt::ElideMiddle), decorationPosition(Left),
 
2020
      showDecorationSelected(false)
 
2021
{
 
2022
}
 
2023
 
 
2024
/*!
 
2025
    \fn QStyleOptionViewItem::QStyleOptionViewItem(const QStyleOptionViewItem &other)
 
2026
 
 
2027
    Constructs a copy of the \a other style option.
 
2028
*/
 
2029
 
 
2030
/*!
 
2031
    \variable QStyleOptionViewItem::Type
 
2032
 
 
2033
    Equals SO_ViewItem.
 
2034
*/
 
2035
 
 
2036
/*!
 
2037
    \variable QStyleOptionViewItem::Version
 
2038
 
 
2039
    Equals 1.
 
2040
*/
 
2041
 
 
2042
/*!
 
2043
    \variable QStyleOptionViewItem::displayAlignment
 
2044
    \brief The alignment of the display value for the item.
 
2045
*/
 
2046
 
 
2047
/*!
 
2048
    \variable QStyleOptionViewItem::decorationAlignment
 
2049
    \brief The alignment of the decoration for the item.
 
2050
*/
 
2051
 
 
2052
/*!
 
2053
    \variable QStyleOptionViewItem::decorationPosition
 
2054
    \brief The position of the decoration for the item.
 
2055
 
 
2056
    \sa Position
 
2057
*/
 
2058
 
 
2059
/*!
 
2060
    \variable QStyleOptionViewItem::decorationSize
 
2061
    \brief The size of the decoration for the item.
 
2062
 
 
2063
    \sa decorationAlignment, decorationPosition
 
2064
*/
 
2065
 
 
2066
/*!
 
2067
    \variable QStyleOptionViewItem::font
 
2068
    \brief The font used for the item
 
2069
 
 
2070
    \sa QFont
 
2071
*/
 
2072
 
 
2073
/*!
 
2074
    \fn T qstyleoption_cast<T>(const QStyleOption *option)
 
2075
    \relates QStyleOption
 
2076
 
 
2077
    Returns a T or 0 depending on the \l{QStyleOption::type}{type}
 
2078
    and \l{QStyleOption::version}{version} of \a option.
 
2079
 
 
2080
    Example:
 
2081
 
 
2082
    \code
 
2083
        void MyStyle::drawPrimitive(PrimitiveElement element,
 
2084
                                    const QStyleOption *option,
 
2085
                                    QPainter *painter,
 
2086
                                    const QWidget *widget)
 
2087
        {
 
2088
            if (element == PE_FocusRect) {
 
2089
                const QStyleOptionFocusRect *focusRectOption =
 
2090
                        qstyleoption_cast<const QStyleOptionFocusRect *>(option);
 
2091
                if (focusRectOption) {
 
2092
                    ...
 
2093
                }
 
2094
            }
 
2095
            ...
 
2096
        }
 
2097
    \endcode
 
2098
 
 
2099
    \sa QStyleOption::type, QStyleOption::version
 
2100
*/
 
2101
 
 
2102
/*!
 
2103
    \fn T qstyleoption_cast<T>(QStyleOption *option)
 
2104
    \overload
 
2105
    \relates QStyleOption
 
2106
 
 
2107
    Returns a T or 0 depending on the type of \a option.
 
2108
*/
 
2109
 
 
2110
/*!
 
2111
    \class QStyleOptionTabWidgetFrame
 
2112
    \brief The QStyleOptionTabWidgetFrame class is used to describe the
 
2113
    parameters for drawing the frame around a tab widget.
 
2114
 
 
2115
    QStyleOptionTabWidgetFrame is used for drawing QTabWidget.
 
2116
*/
 
2117
 
 
2118
/*!
 
2119
    Constructs a QStyleOptionTabWidgetFrame. The members variables
 
2120
    are initialized to default values.
 
2121
*/
 
2122
QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame()
 
2123
    : QStyleOption(Version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
 
2124
      shape(QTabBar::RoundedNorth)
 
2125
{
 
2126
}
 
2127
 
 
2128
/*!
 
2129
    \fn QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
 
2130
 
 
2131
    Constructs a copy of \a other.
 
2132
*/
 
2133
 
 
2134
/*! \internal */
 
2135
QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version)
 
2136
    : QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
 
2137
      shape(QTabBar::RoundedNorth)
 
2138
{
 
2139
}
 
2140
 
 
2141
/*!
 
2142
    \variable QStyleOptionTabWidgetFrame::Type
 
2143
 
 
2144
    Equals SO_TabWidgetFrame.
 
2145
*/
 
2146
 
 
2147
/*!
 
2148
    \variable QStyleOptionTabWidgetFrame::Version
 
2149
 
 
2150
    Equals 1.
 
2151
*/
 
2152
 
 
2153
/*!
 
2154
    \variable QStyleOptionTabWidgetFrame::lineWidth
 
2155
    \brief The line width for drawing the panel.
 
2156
*/
 
2157
 
 
2158
/*!
 
2159
    \variable QStyleOptionTabWidgetFrame::midLineWidth
 
2160
    \brief The mid-line width for drawing the panel. This is usually used in
 
2161
    drawing sunken or raised frames.
 
2162
*/
 
2163
 
 
2164
/*!
 
2165
    \variable QStyleOptionTabWidgetFrame::shape
 
2166
    \brief The tab shape used to draw the tabs.
 
2167
*/
 
2168
 
 
2169
/*!
 
2170
    \variable QStyleOptionTabWidgetFrame::tabBarSize
 
2171
    \brief The size of the tab bar.
 
2172
*/
 
2173
 
 
2174
/*!
 
2175
    \variable QStyleOptionTabWidgetFrame::rightCornerWidgetSize
 
2176
    \brief The size of the right-corner widget.
 
2177
*/
 
2178
 
 
2179
/*! \variable QStyleOptionTabWidgetFrame::leftCornerWidgetSize
 
2180
    \brief The size of the left-corner widget.
 
2181
*/
 
2182
 
 
2183
QStyleOptionTabBarBase::QStyleOptionTabBarBase()
 
2184
    : QStyleOption(Version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
 
2185
{
 
2186
}
 
2187
 
 
2188
/*! \internal */
 
2189
QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
 
2190
    : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
 
2191
{
 
2192
}
 
2193
 
 
2194
/*!
 
2195
    \variable QStyleOptionTabBarBase::Type
 
2196
 
 
2197
    Equals SO_TabBarBase.
 
2198
*/
 
2199
 
 
2200
/*!
 
2201
    \variable QStyleOptionTabBarBase::Version
 
2202
 
 
2203
    Equals 1.
 
2204
*/
 
2205
 
 
2206
/*!
 
2207
    \class QStyleHintReturn
 
2208
    \brief The QStyleHintReturn class provides style hints that return more
 
2209
    than basic data types.
 
2210
 
 
2211
    \ingroup appearance
 
2212
 
 
2213
    QStyleHintReturn and its subclasses are used to pass information
 
2214
    from a style back to the querying widget. This is most useful
 
2215
    when the return value from QStyle::styleHint() does not provide enough
 
2216
    detail; for example, when a mask is to be returned.
 
2217
 
 
2218
    \omit
 
2219
    ### --Sam
 
2220
    \endomit
 
2221
*/
 
2222
 
 
2223
/*!
 
2224
    \enum QStyleHintReturn::HintReturnType
 
2225
 
 
2226
    \value SH_Default QStyleHintReturn
 
2227
    \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
 
2228
*/
 
2229
 
 
2230
/*!
 
2231
    \variable QStyleHintReturn::Type
 
2232
 
 
2233
    Equals SH_Default.
 
2234
*/
 
2235
 
 
2236
/*!
 
2237
    \variable QStyleHintReturn::Version
 
2238
 
 
2239
    Equals 1.
 
2240
*/
 
2241
 
 
2242
/*!
 
2243
    \variable QStyleHintReturn::type
 
2244
    \brief the type of the style hint container
 
2245
 
 
2246
    \sa HintReturnType
 
2247
*/
 
2248
 
 
2249
/*!
 
2250
    \variable QStyleHintReturn::version
 
2251
    \brief the version of the style hint return container
 
2252
 
 
2253
    This value can be used by subclasses to implement extensions
 
2254
    without breaking compatibility. If you use qstyleoption_cast<T>(), you
 
2255
    normally don't need to check it.
 
2256
*/
 
2257
 
 
2258
/*!
 
2259
    Constructs a QStyleHintReturn with version \a version and type \a
 
2260
    type.
 
2261
 
 
2262
    The version has no special meaning for QStyleHintReturn; it can be
 
2263
    used by subclasses to distinguish between different version of
 
2264
    the same hint type.
 
2265
 
 
2266
    \sa QStyleOption::version, QStyleOption::type
 
2267
*/
 
2268
 
 
2269
QStyleHintReturn::QStyleHintReturn(int version, int type)
 
2270
    : version(version), type(type)
 
2271
{
 
2272
}
 
2273
 
 
2274
/*!
 
2275
    \internal
 
2276
*/
 
2277
 
 
2278
QStyleHintReturn::~QStyleHintReturn()
 
2279
{
 
2280
 
 
2281
}
 
2282
 
 
2283
/*!
 
2284
    \class QStyleHintReturnMask
 
2285
    \brief The QStyleHintReturnMask class provides style hints that return a QRegion.
 
2286
 
 
2287
    \ingroup appearance
 
2288
 
 
2289
    \omit
 
2290
    ### --Sam
 
2291
    \endomit
 
2292
*/
 
2293
 
 
2294
/*!
 
2295
    \variable QStyleHintReturnMask::region
 
2296
 
 
2297
    \brief The returned region.
 
2298
 
 
2299
    This variable contains the region for style hints that return a QRegion.
 
2300
*/
 
2301
 
 
2302
/*!
 
2303
    Constructs a QStyleHintReturnMask. The member variables are
 
2304
    initialized to default values.
 
2305
*/
 
2306
QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type)
 
2307
{
 
2308
}
 
2309
 
 
2310
/*!
 
2311
    \variable QStyleHintReturnMask::Type
 
2312
 
 
2313
    Equals SH_Mask.
 
2314
*/
 
2315
 
 
2316
/*!
 
2317
    \variable QStyleHintReturnMask::Version
 
2318
 
 
2319
    Equals 1.
 
2320
*/
 
2321
 
 
2322
/*!
 
2323
    \fn T qstyleoption_cast<T>(const QStyleHintReturn *hint)
 
2324
    \relates QStyleHintReturn
 
2325
 
 
2326
    Returns a T or 0 depending on the \l{QStyleHintReturn::type}{type}
 
2327
    and \l{QStyleHintReturn::version}{version} of \a hint.
 
2328
 
 
2329
    Example:
 
2330
 
 
2331
    \code
 
2332
        int MyStyle::styleHint(StyleHint stylehint, const QStyleOption *opt,
 
2333
                               const QWidget *widget, QStyleHintReturn* returnData) const;
 
2334
        {
 
2335
            if (stylehint == SH_RubberBand_Mask) {
 
2336
                const QStyleHintReturnMask *maskReturn =
 
2337
                        qstyleoption_cast<const QStyleHintReturnMask *>(hint);
 
2338
                if (maskReturn) {
 
2339
                    ...
 
2340
                }
 
2341
            }
 
2342
            ...
 
2343
        }
 
2344
    \endcode
 
2345
 
 
2346
    \sa QStyleHintReturn::type, QStyleHintReturn::version
 
2347
*/
 
2348
 
 
2349
/*!
 
2350
    \fn T qstyleoption_cast<T>(QStyleHintReturn *hint)
 
2351
    \overload
 
2352
    \relates QStyleHintReturn
 
2353
 
 
2354
    Returns a T or 0 depending on the type of \a hint.
 
2355
*/
 
2356
 
 
2357
#ifndef QT_NO_DEBUG
 
2358
QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
 
2359
{
 
2360
    switch (optionType) {
 
2361
    case QStyleOption::SO_Default:
 
2362
        debug << "SO_Default"; break;
 
2363
    case QStyleOption::SO_FocusRect:
 
2364
        debug << "SO_FocusRect"; break;
 
2365
    case QStyleOption::SO_Button:
 
2366
        debug << "SO_Button"; break;
 
2367
    case QStyleOption::SO_Tab:
 
2368
        debug << "SO_Tab"; break;
 
2369
    case QStyleOption::SO_MenuItem:
 
2370
        debug << "SO_MenuItem"; break;
 
2371
    case QStyleOption::SO_Frame:
 
2372
        debug << "SO_Frame"; break;
 
2373
    case QStyleOption::SO_ProgressBar:
 
2374
        debug << "SO_ProgressBar"; break;
 
2375
    case QStyleOption::SO_ToolBox:
 
2376
        debug << "SO_ToolBox"; break;
 
2377
    case QStyleOption::SO_Header:
 
2378
        debug << "SO_Header"; break;
 
2379
    case QStyleOption::SO_Q3DockWindow:
 
2380
        debug << "SO_Q3DockWindow"; break;
 
2381
    case QStyleOption::SO_DockWidget:
 
2382
        debug << "SO_DockWidget"; break;
 
2383
    case QStyleOption::SO_Q3ListViewItem:
 
2384
        debug << "SO_Q3ListViewItem"; break;
 
2385
    case QStyleOption::SO_ViewItem:
 
2386
        debug << "SO_ViewItem"; break;
 
2387
    case QStyleOption::SO_TabWidgetFrame:
 
2388
        debug << "SO_TabWidgetFrame"; break;
 
2389
    case QStyleOption::SO_TabBarBase:
 
2390
        debug << "SO_TabBarBase"; break;
 
2391
    case QStyleOption::SO_RubberBand:
 
2392
        debug << "SO_RubberBand"; break;
 
2393
    case QStyleOption::SO_Complex:
 
2394
        debug << "SO_Complex"; break;
 
2395
    case QStyleOption::SO_Slider:
 
2396
        debug << "SO_Slider"; break;
 
2397
    case QStyleOption::SO_SpinBox:
 
2398
        debug << "SO_SpinBox"; break;
 
2399
    case QStyleOption::SO_ToolButton:
 
2400
        debug << "SO_ToolButton"; break;
 
2401
    case QStyleOption::SO_ComboBox:
 
2402
        debug << "SO_ComboBox"; break;
 
2403
    case QStyleOption::SO_Q3ListView:
 
2404
        debug << "SO_Q3ListView"; break;
 
2405
    case QStyleOption::SO_TitleBar:
 
2406
        debug << "SO_TitleBar"; break;
 
2407
    case QStyleOption::SO_CustomBase:
 
2408
        debug << "SO_CustomBase"; break;
 
2409
    case QStyleOption::SO_ComplexCustomBase:
 
2410
        debug << "SO_ComplexCustomBase"; break;
 
2411
        break;
 
2412
    }
 
2413
    return debug;
 
2414
}
 
2415
 
 
2416
QDebug operator<<(QDebug debug, const QStyleOption &option)
 
2417
{
 
2418
    debug << "QStyleOption(";
 
2419
    debug << QStyleOption::OptionType(option.type);
 
2420
    debug << "," << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
 
2421
    debug << "," << option.state;
 
2422
    debug << "," << option.rect;
 
2423
    debug << ")";
 
2424
    return debug;
 
2425
}
 
2426
#endif