| 1 | // Copyright (C) 2016 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
| 5 | #include "private/qstylehelper_p.h" |
| 6 | #include "qstyleoption.h" |
| 7 | #include "qapplication.h" |
| 8 | #include <qdebug.h> |
| 9 | #include <QtCore/qmath.h> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | /*! |
| 14 | \class QStyleOption |
| 15 | \brief The QStyleOption class stores the parameters used by QStyle functions. |
| 16 | |
| 17 | \ingroup appearance |
| 18 | \inmodule QtWidgets |
| 19 | |
| 20 | QStyleOption and its subclasses contain all the information that |
| 21 | QStyle functions need to draw a graphical element. |
| 22 | |
| 23 | For performance reasons, there are few member functions and the |
| 24 | access to the member variables is direct (i.e., using the \c . or |
| 25 | \c -> operator). This makes the structures straightforward to use |
| 26 | and emphasizes that these are simply parameters used by the style |
| 27 | functions. |
| 28 | |
| 29 | The caller of a QStyle function usually creates QStyleOption |
| 30 | objects on the stack. This combined with Qt's extensive use of |
| 31 | \l{implicit sharing} for types such as QString, QPalette, and |
| 32 | QColor ensures that no memory allocation needlessly takes place. |
| 33 | |
| 34 | The following code snippet shows how to use a specific |
| 35 | QStyleOption subclass to paint a push button: |
| 36 | |
| 37 | \snippet qstyleoption/main.cpp 0 |
| 38 | |
| 39 | In our example, the control is a QStyle::CE_PushButton, and |
| 40 | according to the QStyle::drawControl() documentation the |
| 41 | corresponding class is QStyleOptionButton. |
| 42 | |
| 43 | When reimplementing QStyle functions that take a QStyleOption |
| 44 | parameter, you often need to cast the QStyleOption to a subclass. |
| 45 | For safety, you can use qstyleoption_cast() to ensure that the |
| 46 | pointer type is correct. For example: |
| 47 | |
| 48 | \snippet qstyleoption/main.cpp 4 |
| 49 | |
| 50 | The qstyleoption_cast() function will return 0 if the object to |
| 51 | which \c option points is not of the correct type. |
| 52 | |
| 53 | \sa QStyle, QStylePainter |
| 54 | */ |
| 55 | |
| 56 | /*! |
| 57 | \enum QStyleOption::OptionType |
| 58 | |
| 59 | This enum is used internally by QStyleOption, its subclasses, and |
| 60 | qstyleoption_cast() to determine the type of style option. In |
| 61 | general you do not need to worry about this unless you want to |
| 62 | create your own QStyleOption subclass and your own styles. |
| 63 | |
| 64 | \value SO_Button \l QStyleOptionButton |
| 65 | \value SO_ComboBox \l QStyleOptionComboBox |
| 66 | \value SO_Complex \l QStyleOptionComplex |
| 67 | \value SO_Default QStyleOption |
| 68 | \value SO_DockWidget \l QStyleOptionDockWidget |
| 69 | \value SO_FocusRect \l QStyleOptionFocusRect |
| 70 | \value SO_Frame \l QStyleOptionFrame |
| 71 | \value SO_GraphicsItem \l QStyleOptionGraphicsItem |
| 72 | \value SO_GroupBox \l QStyleOptionGroupBox |
| 73 | \value SO_Header \l QStyleOptionHeader |
| 74 | \value SO_MenuItem \l QStyleOptionMenuItem |
| 75 | \value SO_ProgressBar \l QStyleOptionProgressBar |
| 76 | \value SO_RubberBand \l QStyleOptionRubberBand |
| 77 | \value SO_SizeGrip \l QStyleOptionSizeGrip |
| 78 | \value SO_Slider \l QStyleOptionSlider |
| 79 | \value SO_SpinBox \l QStyleOptionSpinBox |
| 80 | \value SO_Tab \l QStyleOptionTab |
| 81 | \value SO_TabBarBase \l QStyleOptionTabBarBase |
| 82 | \value SO_TabWidgetFrame \l QStyleOptionTabWidgetFrame |
| 83 | \value SO_TitleBar \l QStyleOptionTitleBar |
| 84 | \value SO_ToolBar \l QStyleOptionToolBar |
| 85 | \value SO_ToolBox \l QStyleOptionToolBox |
| 86 | \value SO_ToolButton \l QStyleOptionToolButton |
| 87 | \value SO_ViewItem \l QStyleOptionViewItem (used in Interviews) |
| 88 | |
| 89 | The following values are used for custom controls: |
| 90 | |
| 91 | \value SO_CustomBase Reserved for custom QStyleOptions; |
| 92 | all custom controls values must be above this value |
| 93 | \value SO_ComplexCustomBase Reserved for custom QStyleOptions; |
| 94 | all custom complex controls values must be above this value |
| 95 | |
| 96 | \sa type |
| 97 | */ |
| 98 | |
| 99 | /*! |
| 100 | Constructs a QStyleOption with the specified \a version and \a |
| 101 | type. |
| 102 | |
| 103 | The version has no special meaning for QStyleOption; it can be |
| 104 | used by subclasses to distinguish between different version of |
| 105 | the same option type. |
| 106 | |
| 107 | The \l state member variable is initialized to |
| 108 | QStyle::State_None. |
| 109 | |
| 110 | \sa version, type |
| 111 | */ |
| 112 | |
| 113 | QStyleOption::QStyleOption(int version, int type) |
| 114 | : version(version), type(type), state(QStyle::State_None), |
| 115 | direction(QGuiApplication::layoutDirection()), fontMetrics(QFont()), styleObject(nullptr) |
| 116 | { |
| 117 | } |
| 118 | |
| 119 | |
| 120 | /*! |
| 121 | Destroys this style option object. |
| 122 | */ |
| 123 | QStyleOption::~QStyleOption() |
| 124 | { |
| 125 | } |
| 126 | |
| 127 | /*! |
| 128 | \fn void QStyleOption::initFrom(const QWidget *widget) |
| 129 | \since 4.1 |
| 130 | |
| 131 | Initializes the \l state, \l direction, \l rect, \l palette, \l fontMetrics |
| 132 | and \l styleObject member variables based on the specified \a widget. |
| 133 | |
| 134 | This is a convenience function; the member variables can also be |
| 135 | initialized manually. |
| 136 | |
| 137 | \sa QWidget::layoutDirection(), QWidget::rect(), |
| 138 | QWidget::palette(), QWidget::fontMetrics() |
| 139 | */ |
| 140 | void QStyleOption::initFrom(const QWidget *widget) |
| 141 | { |
| 142 | QWidget *window = widget->window(); |
| 143 | state = QStyle::State_None; |
| 144 | if (widget->isEnabled()) |
| 145 | state |= QStyle::State_Enabled; |
| 146 | if (widget->hasFocus()) |
| 147 | state |= QStyle::State_HasFocus; |
| 148 | if (window->testAttribute(attribute: Qt::WA_KeyboardFocusChange)) |
| 149 | state |= QStyle::State_KeyboardFocusChange; |
| 150 | if (widget->underMouse()) |
| 151 | state |= QStyle::State_MouseOver; |
| 152 | if (window->isActiveWindow()) |
| 153 | state |= QStyle::State_Active; |
| 154 | if (widget->isWindow()) |
| 155 | state |= QStyle::State_Window; |
| 156 | switch (QStyleHelper::widgetSizePolicy(w: widget)) { |
| 157 | case QStyleHelper::SizeSmall: |
| 158 | state |= QStyle::State_Small; |
| 159 | break; |
| 160 | case QStyleHelper::SizeMini: |
| 161 | state |= QStyle::State_Mini; |
| 162 | break; |
| 163 | default: |
| 164 | ; |
| 165 | } |
| 166 | #ifdef QT_KEYPAD_NAVIGATION |
| 167 | if (widget->hasEditFocus()) |
| 168 | state |= QStyle::State_HasEditFocus; |
| 169 | #endif |
| 170 | |
| 171 | direction = widget->layoutDirection(); |
| 172 | rect = widget->rect(); |
| 173 | palette = widget->palette(); |
| 174 | fontMetrics = widget->fontMetrics(); |
| 175 | styleObject = const_cast<QWidget*>(widget); |
| 176 | } |
| 177 | |
| 178 | /*! |
| 179 | Constructs a copy of \a other. |
| 180 | */ |
| 181 | QStyleOption::QStyleOption(const QStyleOption &other) |
| 182 | : version(Version), type(Type), state(other.state), |
| 183 | direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics), |
| 184 | palette(other.palette), styleObject(other.styleObject) |
| 185 | { |
| 186 | } |
| 187 | |
| 188 | /*! |
| 189 | Assign \a other to this QStyleOption. |
| 190 | */ |
| 191 | QStyleOption &QStyleOption::operator=(const QStyleOption &other) |
| 192 | { |
| 193 | state = other.state; |
| 194 | direction = other.direction; |
| 195 | rect = other.rect; |
| 196 | fontMetrics = other.fontMetrics; |
| 197 | palette = other.palette; |
| 198 | styleObject = other.styleObject; |
| 199 | return *this; |
| 200 | } |
| 201 | |
| 202 | /*! |
| 203 | \enum QStyleOption::StyleOptionType |
| 204 | |
| 205 | This enum is used to hold information about the type of the style option, and |
| 206 | is defined for each QStyleOption subclass. |
| 207 | |
| 208 | \value Type The type of style option provided (\l{SO_Default} for |
| 209 | this class). |
| 210 | |
| 211 | The type is used internally by QStyleOption, its subclasses, and |
| 212 | qstyleoption_cast() to determine the type of style option. In |
| 213 | general you do not need to worry about this unless you want to |
| 214 | create your own QStyleOption subclass and your own styles. |
| 215 | |
| 216 | \sa StyleOptionVersion |
| 217 | */ |
| 218 | |
| 219 | /*! |
| 220 | \enum QStyleOption::StyleOptionVersion |
| 221 | |
| 222 | This enum is used to hold information about the version of the style option, and |
| 223 | is defined for each QStyleOption subclass. |
| 224 | |
| 225 | \value Version 1 |
| 226 | |
| 227 | The version is used by QStyleOption subclasses to implement |
| 228 | extensions without breaking compatibility. If you use |
| 229 | qstyleoption_cast(), you normally do not need to check it. |
| 230 | |
| 231 | \sa StyleOptionType |
| 232 | */ |
| 233 | |
| 234 | /*! |
| 235 | \variable QStyleOption::palette |
| 236 | \brief the palette that should be used when painting the control |
| 237 | |
| 238 | By default, the application's default palette is used. |
| 239 | |
| 240 | \sa initFrom() |
| 241 | */ |
| 242 | |
| 243 | /*! |
| 244 | \variable QStyleOption::direction |
| 245 | \brief the text layout direction that should be used when drawing text in the control |
| 246 | |
| 247 | By default, the layout direction is Qt::LeftToRight. |
| 248 | |
| 249 | \sa initFrom() |
| 250 | */ |
| 251 | |
| 252 | /*! |
| 253 | \variable QStyleOption::fontMetrics |
| 254 | \brief the font metrics that should be used when drawing text in the control |
| 255 | |
| 256 | By default, the application's default font is used. |
| 257 | |
| 258 | \sa initFrom() |
| 259 | */ |
| 260 | |
| 261 | /*! |
| 262 | \variable QStyleOption::styleObject |
| 263 | \brief the object being styled |
| 264 | |
| 265 | The built-in styles support the following types: QWidget, QGraphicsObject and QQuickItem. |
| 266 | |
| 267 | \sa initFrom() |
| 268 | */ |
| 269 | |
| 270 | /*! |
| 271 | \variable QStyleOption::rect |
| 272 | \brief the area that should be used for various calculations and painting |
| 273 | |
| 274 | This can have different meanings for different types of elements. |
| 275 | For example, for a \l QStyle::CE_PushButton element it would be |
| 276 | the rectangle for the entire button, while for a \l |
| 277 | QStyle::CE_PushButtonLabel element it would be just the area for |
| 278 | the push button label. |
| 279 | |
| 280 | The default value is a null rectangle, i.e. a rectangle with both |
| 281 | the width and the height set to 0. |
| 282 | |
| 283 | \sa initFrom() |
| 284 | */ |
| 285 | |
| 286 | /*! |
| 287 | \variable QStyleOption::state |
| 288 | \brief the style flags that are used when drawing the control |
| 289 | |
| 290 | The default value is QStyle::State_None. |
| 291 | |
| 292 | \sa initFrom(), QStyle::drawPrimitive(), QStyle::drawControl(), |
| 293 | QStyle::drawComplexControl(), QStyle::State |
| 294 | */ |
| 295 | |
| 296 | /*! |
| 297 | \variable QStyleOption::type |
| 298 | \brief the option type of the style option |
| 299 | |
| 300 | The default value is SO_Default. |
| 301 | |
| 302 | \sa OptionType |
| 303 | */ |
| 304 | |
| 305 | /*! |
| 306 | \variable QStyleOption::version |
| 307 | \brief the version of the style option |
| 308 | |
| 309 | This value can be used by subclasses to implement extensions |
| 310 | without breaking compatibility. If you use the qstyleoption_cast() |
| 311 | function, you normally do not need to check it. |
| 312 | |
| 313 | The default value is 1. |
| 314 | */ |
| 315 | |
| 316 | /*! |
| 317 | \class QStyleOptionFocusRect |
| 318 | \brief The QStyleOptionFocusRect class is used to describe the |
| 319 | parameters for drawing a focus rectangle with QStyle. |
| 320 | |
| 321 | \inmodule QtWidgets |
| 322 | |
| 323 | For performance reasons, there are few member functions and the |
| 324 | access to the member variables is direct (i.e., using the \c . or |
| 325 | \c -> operator). This makes the structures straightforward to use |
| 326 | and emphasizes that these are simply parameters used by the style |
| 327 | functions. |
| 328 | |
| 329 | \sa QStyleOption |
| 330 | */ |
| 331 | |
| 332 | /*! |
| 333 | Constructs a QStyleOptionFocusRect, initializing the members |
| 334 | variables to their default values. |
| 335 | */ |
| 336 | |
| 337 | QStyleOptionFocusRect::QStyleOptionFocusRect() |
| 338 | : QStyleOptionFocusRect(Version) |
| 339 | { |
| 340 | } |
| 341 | |
| 342 | /*! |
| 343 | \internal |
| 344 | */ |
| 345 | QStyleOptionFocusRect::QStyleOptionFocusRect(int version) |
| 346 | : QStyleOption(version, SO_FocusRect) |
| 347 | { |
| 348 | state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom() |
| 349 | } |
| 350 | |
| 351 | /*! |
| 352 | \enum QStyleOptionFocusRect::StyleOptionType |
| 353 | |
| 354 | This enum is used to hold information about the type of the style option, and |
| 355 | is defined for each QStyleOption subclass. |
| 356 | |
| 357 | \value Type The type of style option provided (\l{SO_FocusRect} for this class). |
| 358 | |
| 359 | The type is used internally by QStyleOption, its subclasses, and |
| 360 | qstyleoption_cast() to determine the type of style option. In |
| 361 | general you do not need to worry about this unless you want to |
| 362 | create your own QStyleOption subclass and your own styles. |
| 363 | |
| 364 | \sa StyleOptionVersion |
| 365 | */ |
| 366 | |
| 367 | /*! |
| 368 | \enum QStyleOptionFocusRect::StyleOptionVersion |
| 369 | |
| 370 | This enum is used to hold information about the version of the style option, and |
| 371 | is defined for each QStyleOption subclass. |
| 372 | |
| 373 | \value Version 1 |
| 374 | |
| 375 | The version is used by QStyleOption subclasses to implement |
| 376 | extensions without breaking compatibility. If you use |
| 377 | qstyleoption_cast(), you normally do not need to check it. |
| 378 | |
| 379 | \sa StyleOptionType |
| 380 | */ |
| 381 | |
| 382 | /*! |
| 383 | \fn QStyleOptionFocusRect::QStyleOptionFocusRect(const QStyleOptionFocusRect &other) |
| 384 | |
| 385 | Constructs a copy of the \a other style option. |
| 386 | */ |
| 387 | |
| 388 | /*! |
| 389 | \variable QStyleOptionFocusRect::backgroundColor |
| 390 | \brief the background color on which the focus rectangle is being drawn |
| 391 | |
| 392 | The default value is an invalid color with the RGB value (0, 0, |
| 393 | 0). An invalid color is a color that is not properly set up for |
| 394 | the underlying window system. |
| 395 | */ |
| 396 | |
| 397 | /*! |
| 398 | \class QStyleOptionFrame |
| 399 | \brief The QStyleOptionFrame class is used to describe the |
| 400 | parameters for drawing a frame. |
| 401 | |
| 402 | \inmodule QtWidgets |
| 403 | |
| 404 | QStyleOptionFrame is used for drawing several built-in Qt widgets, |
| 405 | including QFrame, QGroupBox, QLineEdit, and QMenu. |
| 406 | |
| 407 | For performance reasons, there are few member functions and the |
| 408 | access to the member variables is direct (i.e., using the \c . or |
| 409 | \c -> operator). This makes the structures straightforward to use |
| 410 | and emphasizes that these are simply parameters used by the style |
| 411 | functions. |
| 412 | |
| 413 | An instance of the QStyleOptionFrame class has |
| 414 | \l{QStyleOption::type} {type} SO_Frame and \l{QStyleOption::version} |
| 415 | {version} 3. |
| 416 | |
| 417 | The type is used internally by QStyleOption, its subclasses, and |
| 418 | qstyleoption_cast() to determine the type of style option. In |
| 419 | general you do not need to worry about this unless you want to |
| 420 | create your own QStyleOption subclass and your own styles. The |
| 421 | version is used by QStyleOption subclasses to implement extensions |
| 422 | without breaking compatibility. If you use qstyleoption_cast(), |
| 423 | you normally do not need to check it. |
| 424 | |
| 425 | \sa QStyleOption |
| 426 | */ |
| 427 | |
| 428 | /*! |
| 429 | Constructs a QStyleOptionFrame, initializing the members |
| 430 | variables to their default values. |
| 431 | */ |
| 432 | |
| 433 | QStyleOptionFrame::QStyleOptionFrame() |
| 434 | : QStyleOptionFrame(Version) |
| 435 | { |
| 436 | } |
| 437 | |
| 438 | /*! |
| 439 | \internal |
| 440 | */ |
| 441 | QStyleOptionFrame::QStyleOptionFrame(int version) |
| 442 | : QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0), |
| 443 | features(None), frameShape(QFrame::NoFrame) |
| 444 | { |
| 445 | } |
| 446 | |
| 447 | /*! |
| 448 | \fn QStyleOptionFrame::QStyleOptionFrame(const QStyleOptionFrame &other) |
| 449 | |
| 450 | Constructs a copy of the \a other style option. |
| 451 | */ |
| 452 | |
| 453 | /*! |
| 454 | \enum QStyleOptionFrame::StyleOptionType |
| 455 | |
| 456 | This enum is used to hold information about the type of the style option, and |
| 457 | is defined for each QStyleOption subclass. |
| 458 | |
| 459 | \value Type The type of style option provided (\l{SO_Frame} for this class). |
| 460 | |
| 461 | The type is used internally by QStyleOption, its subclasses, and |
| 462 | qstyleoption_cast() to determine the type of style option. In |
| 463 | general you do not need to worry about this unless you want to |
| 464 | create your own QStyleOption subclass and your own styles. |
| 465 | |
| 466 | \sa StyleOptionVersion |
| 467 | */ |
| 468 | |
| 469 | /*! |
| 470 | \enum QStyleOptionFrame::StyleOptionVersion |
| 471 | |
| 472 | This enum is used to hold information about the version of the style option, and |
| 473 | is defined for each QStyleOption subclass. |
| 474 | |
| 475 | \value Version 3 |
| 476 | |
| 477 | The version is used by QStyleOption subclasses to implement |
| 478 | extensions without breaking compatibility. If you use |
| 479 | qstyleoption_cast(), you normally do not need to check it. |
| 480 | |
| 481 | \sa StyleOptionType |
| 482 | */ |
| 483 | |
| 484 | /*! |
| 485 | \variable QStyleOptionFrame::lineWidth |
| 486 | \brief the line width for drawing the frame |
| 487 | |
| 488 | The default value is 0. |
| 489 | |
| 490 | \sa QFrame::lineWidth |
| 491 | */ |
| 492 | |
| 493 | /*! |
| 494 | \variable QStyleOptionFrame::midLineWidth |
| 495 | \brief the mid-line width for drawing the frame |
| 496 | |
| 497 | This is usually used in drawing sunken or raised frames. |
| 498 | |
| 499 | The default value is 0. |
| 500 | |
| 501 | \sa QFrame::midLineWidth |
| 502 | */ |
| 503 | |
| 504 | /*! |
| 505 | \enum QStyleOptionFrame::FrameFeature |
| 506 | |
| 507 | This enum describes the different types of features a frame can have. |
| 508 | |
| 509 | \value None Indicates a normal frame. |
| 510 | \value Flat Indicates a flat frame. |
| 511 | \value Rounded Indicates a rounded frame. |
| 512 | */ |
| 513 | |
| 514 | /*! |
| 515 | \variable QStyleOptionFrame::features |
| 516 | \brief a bitwise OR of the features that describe this frame. |
| 517 | |
| 518 | \sa FrameFeature |
| 519 | */ |
| 520 | |
| 521 | /*! |
| 522 | \variable QStyleOptionFrame::frameShape |
| 523 | \brief This property holds the frame shape value of the frame. |
| 524 | |
| 525 | \sa QFrame::frameShape |
| 526 | */ |
| 527 | |
| 528 | /*! |
| 529 | \class QStyleOptionGroupBox |
| 530 | \brief The QStyleOptionGroupBox class describes the parameters for |
| 531 | drawing a group box. |
| 532 | |
| 533 | \since 4.1 |
| 534 | \inmodule QtWidgets |
| 535 | |
| 536 | QStyleOptionButton contains all the information that QStyle |
| 537 | functions need the various graphical elements of a group box. |
| 538 | |
| 539 | It holds the lineWidth and the midLineWidth for drawing the panel, |
| 540 | the group box's \l {text}{title} and the title's \l |
| 541 | {textAlignment}{alignment} and \l {textColor}{color}. |
| 542 | |
| 543 | For performance reasons, there are few member functions and the |
| 544 | access to the member variables is direct (i.e., using the \c . or |
| 545 | \c -> operator). This makes the structures straightforward to use |
| 546 | and emphasizes that these are simply parameters used by the style |
| 547 | functions. |
| 548 | |
| 549 | \sa QStyleOption, QStyleOptionComplex, QGroupBox |
| 550 | */ |
| 551 | |
| 552 | /*! |
| 553 | \enum QStyleOptionGroupBox::StyleOptionType |
| 554 | |
| 555 | This enum is used to hold information about the type of the style option, and |
| 556 | is defined for each QStyleOption subclass. |
| 557 | |
| 558 | \value Type The type of style option provided (\l{SO_GroupBox} for this class). |
| 559 | |
| 560 | The type is used internally by QStyleOption, its subclasses, and |
| 561 | qstyleoption_cast() to determine the type of style option. In |
| 562 | general you do not need to worry about this unless you want to |
| 563 | create your own QStyleOption subclass and your own styles. |
| 564 | |
| 565 | \sa StyleOptionVersion |
| 566 | */ |
| 567 | |
| 568 | /*! |
| 569 | \enum QStyleOptionGroupBox::StyleOptionVersion |
| 570 | |
| 571 | This enum is used to hold information about the version of the style option, and |
| 572 | is defined for each QStyleOption subclass. |
| 573 | |
| 574 | \value Version 1 |
| 575 | |
| 576 | The version is used by QStyleOption subclasses to implement |
| 577 | extensions without breaking compatibility. If you use |
| 578 | qstyleoption_cast(), you normally do not need to check it. |
| 579 | |
| 580 | \sa StyleOptionType |
| 581 | */ |
| 582 | |
| 583 | /*! |
| 584 | \variable QStyleOptionGroupBox::lineWidth |
| 585 | \brief the line width for drawing the panel |
| 586 | |
| 587 | The value of this variable is, currently, always 1. |
| 588 | |
| 589 | \sa QFrame::lineWidth |
| 590 | */ |
| 591 | |
| 592 | /*! |
| 593 | \variable QStyleOptionGroupBox::midLineWidth |
| 594 | \brief the mid-line width for drawing the panel |
| 595 | |
| 596 | The mid-line width is usually used when drawing sunken or raised |
| 597 | group box frames. The value of this variable is, currently, always 0. |
| 598 | |
| 599 | \sa QFrame::midLineWidth |
| 600 | */ |
| 601 | |
| 602 | /*! |
| 603 | \variable QStyleOptionGroupBox::text |
| 604 | \brief the text of the group box |
| 605 | |
| 606 | The default value is an empty string. |
| 607 | |
| 608 | \sa QGroupBox::title |
| 609 | */ |
| 610 | |
| 611 | /*! |
| 612 | \variable QStyleOptionGroupBox::textAlignment |
| 613 | \brief the alignment of the group box title |
| 614 | |
| 615 | The default value is Qt::AlignLeft. |
| 616 | |
| 617 | \sa QGroupBox::alignment |
| 618 | */ |
| 619 | |
| 620 | /*! |
| 621 | \variable QStyleOptionGroupBox::features |
| 622 | \brief the features of the group box frame |
| 623 | |
| 624 | The frame is flat by default. |
| 625 | |
| 626 | \sa QStyleOptionFrame::FrameFeature |
| 627 | */ |
| 628 | |
| 629 | /*! |
| 630 | \variable QStyleOptionGroupBox::textColor |
| 631 | \brief the color of the group box title |
| 632 | |
| 633 | The default value is an invalid color with the RGB value (0, 0, |
| 634 | 0). An invalid color is a color that is not properly set up for |
| 635 | the underlying window system. |
| 636 | */ |
| 637 | |
| 638 | /*! |
| 639 | Constructs a QStyleOptionGroupBox, initializing the members |
| 640 | variables to their default values. |
| 641 | */ |
| 642 | QStyleOptionGroupBox::QStyleOptionGroupBox() |
| 643 | : QStyleOptionGroupBox(Version) |
| 644 | { |
| 645 | } |
| 646 | |
| 647 | /*! |
| 648 | \fn QStyleOptionGroupBox::QStyleOptionGroupBox(const QStyleOptionGroupBox &other) |
| 649 | |
| 650 | Constructs a copy of the \a other style option. |
| 651 | */ |
| 652 | |
| 653 | /*! |
| 654 | \internal |
| 655 | */ |
| 656 | QStyleOptionGroupBox::QStyleOptionGroupBox(int version) |
| 657 | : QStyleOptionComplex(version, Type), features(QStyleOptionFrame::None), |
| 658 | textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0) |
| 659 | { |
| 660 | } |
| 661 | |
| 662 | /*! |
| 663 | \class QStyleOptionHeader |
| 664 | \brief The QStyleOptionHeader class is used to describe the |
| 665 | parameters for drawing a header. |
| 666 | |
| 667 | \inmodule QtWidgets |
| 668 | |
| 669 | QStyleOptionHeader contains all the information that QStyle |
| 670 | functions need to draw the item views' header pane, header sort |
| 671 | arrow, and header label. |
| 672 | |
| 673 | For performance reasons, there are few member functions and the |
| 674 | access to the member variables is direct (i.e., using the \c . or |
| 675 | \c -> operator). This makes the structures straightforward to use |
| 676 | and emphasizes that these are simply parameters used by the style |
| 677 | functions. |
| 678 | |
| 679 | \sa QStyleOption |
| 680 | */ |
| 681 | |
| 682 | /*! |
| 683 | Constructs a QStyleOptionHeader, initializing the members |
| 684 | variables to their default values. |
| 685 | */ |
| 686 | |
| 687 | QStyleOptionHeader::() |
| 688 | : QStyleOptionHeader(QStyleOptionHeader::Version) |
| 689 | { |
| 690 | } |
| 691 | |
| 692 | /*! |
| 693 | \internal |
| 694 | */ |
| 695 | QStyleOptionHeader::(int version) |
| 696 | : QStyleOption(version, SO_Header), |
| 697 | section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft), |
| 698 | position(QStyleOptionHeader::Beginning), |
| 699 | selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None), |
| 700 | orientation(Qt::Horizontal) |
| 701 | { |
| 702 | } |
| 703 | |
| 704 | /*! |
| 705 | \variable QStyleOptionHeader::orientation |
| 706 | \brief the header's orientation (horizontal or vertical) |
| 707 | |
| 708 | The default orientation is Qt::Horizontal |
| 709 | */ |
| 710 | |
| 711 | /*! |
| 712 | \fn QStyleOptionHeader::QStyleOptionHeader(const QStyleOptionHeader &other) |
| 713 | |
| 714 | Constructs a copy of the \a other style option. |
| 715 | */ |
| 716 | |
| 717 | /*! |
| 718 | \enum QStyleOptionHeader::StyleOptionType |
| 719 | |
| 720 | This enum is used to hold information about the type of the style option, and |
| 721 | is defined for each QStyleOption subclass. |
| 722 | |
| 723 | \value Type The type of style option provided (\l{SO_Header} for this class). |
| 724 | |
| 725 | The type is used internally by QStyleOption, its subclasses, and |
| 726 | qstyleoption_cast() to determine the type of style option. In |
| 727 | general you do not need to worry about this unless you want to |
| 728 | create your own QStyleOption subclass and your own styles. |
| 729 | |
| 730 | \sa StyleOptionVersion |
| 731 | */ |
| 732 | |
| 733 | /*! |
| 734 | \enum QStyleOptionHeader::StyleOptionVersion |
| 735 | |
| 736 | This enum is used to hold information about the version of the style option, and |
| 737 | is defined for each QStyleOption subclass. |
| 738 | |
| 739 | \value Version 1 |
| 740 | |
| 741 | The version is used by QStyleOption subclasses to implement |
| 742 | extensions without breaking compatibility. If you use |
| 743 | qstyleoption_cast(), you normally do not need to check it. |
| 744 | |
| 745 | \sa StyleOptionType |
| 746 | */ |
| 747 | |
| 748 | /*! |
| 749 | \variable QStyleOptionHeader::section |
| 750 | \brief which section of the header is being painted |
| 751 | |
| 752 | The default value is 0. |
| 753 | */ |
| 754 | |
| 755 | /*! |
| 756 | \variable QStyleOptionHeader::text |
| 757 | \brief the text of the header |
| 758 | |
| 759 | The default value is an empty string. |
| 760 | */ |
| 761 | |
| 762 | /*! |
| 763 | \variable QStyleOptionHeader::textAlignment |
| 764 | \brief the alignment flags for the text of the header |
| 765 | |
| 766 | The default value is Qt::AlignLeft. |
| 767 | */ |
| 768 | |
| 769 | /*! |
| 770 | \variable QStyleOptionHeader::icon |
| 771 | \brief the icon of the header |
| 772 | |
| 773 | The default value is an empty icon, i.e. an icon with neither a |
| 774 | pixmap nor a filename. |
| 775 | */ |
| 776 | |
| 777 | /*! |
| 778 | \variable QStyleOptionHeader::iconAlignment |
| 779 | \brief the alignment flags for the icon of the header |
| 780 | |
| 781 | The default value is Qt::AlignLeft. |
| 782 | */ |
| 783 | |
| 784 | /*! |
| 785 | \variable QStyleOptionHeader::position |
| 786 | \brief the section's position in relation to the other sections |
| 787 | |
| 788 | The default value is QStyleOptionHeader::Beginning. |
| 789 | */ |
| 790 | |
| 791 | /*! |
| 792 | \variable QStyleOptionHeader::selectedPosition |
| 793 | \brief the section's position in relation to the selected section |
| 794 | |
| 795 | The default value is QStyleOptionHeader::NotAdjacent |
| 796 | */ |
| 797 | |
| 798 | /*! |
| 799 | \variable QStyleOptionHeader::sortIndicator |
| 800 | \brief the direction the sort indicator should be drawn |
| 801 | |
| 802 | The default value is QStyleOptionHeader::None. |
| 803 | */ |
| 804 | |
| 805 | /*! |
| 806 | \enum QStyleOptionHeader::SectionPosition |
| 807 | |
| 808 | This enum lets you know where the section's position is in relation to the other sections. |
| 809 | |
| 810 | \value Beginning At the beginining of the header |
| 811 | \value Middle In the middle of the header |
| 812 | \value End At the end of the header |
| 813 | \value OnlyOneSection Only one header section |
| 814 | |
| 815 | \sa position |
| 816 | */ |
| 817 | |
| 818 | /*! |
| 819 | \enum QStyleOptionHeader::SelectedPosition |
| 820 | |
| 821 | This enum lets you know where the section's position is in relation to the selected section. |
| 822 | |
| 823 | \value NotAdjacent Not adjacent to the selected section |
| 824 | \value NextIsSelected The next section is selected |
| 825 | \value PreviousIsSelected The previous section is selected |
| 826 | \value NextAndPreviousAreSelected Both the next and previous section are selected |
| 827 | |
| 828 | \sa selectedPosition |
| 829 | */ |
| 830 | |
| 831 | /*! |
| 832 | \enum QStyleOptionHeader::SortIndicator |
| 833 | |
| 834 | Indicates which direction the sort indicator should be drawn |
| 835 | |
| 836 | \value None No sort indicator is needed |
| 837 | \value SortUp Draw an up indicator |
| 838 | \value SortDown Draw a down indicator |
| 839 | |
| 840 | \sa sortIndicator |
| 841 | */ |
| 842 | |
| 843 | /*! |
| 844 | \class QStyleOptionHeaderV2 |
| 845 | \brief The QStyleOptionHeaderV2 class is used to describe the |
| 846 | parameters for drawing a header. |
| 847 | |
| 848 | \inmodule QtWidgets |
| 849 | */ |
| 850 | |
| 851 | /*! |
| 852 | Constructs a QStyleOptionHeaderV2, initializing the members |
| 853 | variables to their default values. |
| 854 | */ |
| 855 | QStyleOptionHeaderV2::() |
| 856 | : QStyleOptionHeaderV2(QStyleOptionHeaderV2::Version) |
| 857 | { |
| 858 | } |
| 859 | |
| 860 | /*! |
| 861 | \internal |
| 862 | */ |
| 863 | QStyleOptionHeaderV2::(int version) |
| 864 | : QStyleOptionHeader(version), textElideMode(Qt::ElideNone), isSectionDragTarget(false), unused(0) |
| 865 | {} |
| 866 | |
| 867 | /*! |
| 868 | \variable QStyleOptionHeaderV2::textElideMode |
| 869 | \brief where ellipsis should be added for text that is too long to fit |
| 870 | into an item |
| 871 | |
| 872 | The default value is Qt::ElideNone. |
| 873 | |
| 874 | \sa Qt::TextElideMode |
| 875 | */ |
| 876 | |
| 877 | /*! |
| 878 | \variable QStyleOptionHeaderV2::isSectionDragTarget |
| 879 | |
| 880 | \brief whether the section is the location at which a dragged section |
| 881 | will be inserted |
| 882 | |
| 883 | \sa QHeaderView::setSectionsMovable |
| 884 | */ |
| 885 | |
| 886 | /*! |
| 887 | \class QStyleOptionButton |
| 888 | \brief The QStyleOptionButton class is used to describe the |
| 889 | parameters for drawing buttons. |
| 890 | |
| 891 | \inmodule QtWidgets |
| 892 | |
| 893 | QStyleOptionButton contains all the information that QStyle |
| 894 | functions need to draw graphical elements like QPushButton, |
| 895 | QCheckBox, and QRadioButton. |
| 896 | |
| 897 | For performance reasons, there are few member functions and the |
| 898 | access to the member variables is direct (i.e., using the \c . or |
| 899 | \c -> operator). This makes the structures straightforward to use |
| 900 | and emphasizes that these are simply parameters used by the style |
| 901 | functions. |
| 902 | |
| 903 | \sa QStyleOption, QStyleOptionToolButton |
| 904 | */ |
| 905 | |
| 906 | /*! |
| 907 | \enum QStyleOptionButton::ButtonFeature |
| 908 | |
| 909 | This enum describes the different types of features a push button can have. |
| 910 | |
| 911 | \value None Indicates a normal push button. |
| 912 | \value Flat Indicates a flat push button. |
| 913 | \value HasMenu Indicates that the button has a drop down menu. |
| 914 | \value DefaultButton Indicates that the button is a default button. |
| 915 | \value AutoDefaultButton Indicates that the button is an auto default button. |
| 916 | \value CommandLinkButton Indicates that the button is a Windows Vista type command link. |
| 917 | |
| 918 | \sa features |
| 919 | */ |
| 920 | |
| 921 | /*! |
| 922 | Constructs a QStyleOptionButton, initializing the members |
| 923 | variables to their default values. |
| 924 | */ |
| 925 | |
| 926 | QStyleOptionButton::QStyleOptionButton() |
| 927 | : QStyleOptionButton(QStyleOptionButton::Version) |
| 928 | { |
| 929 | } |
| 930 | |
| 931 | /*! |
| 932 | \internal |
| 933 | */ |
| 934 | QStyleOptionButton::QStyleOptionButton(int version) |
| 935 | : QStyleOption(version, SO_Button), features(None) |
| 936 | { |
| 937 | } |
| 938 | |
| 939 | /*! |
| 940 | \fn QStyleOptionButton::QStyleOptionButton(const QStyleOptionButton &other) |
| 941 | |
| 942 | Constructs a copy of the \a other style option. |
| 943 | */ |
| 944 | |
| 945 | /*! |
| 946 | \enum QStyleOptionButton::StyleOptionType |
| 947 | |
| 948 | This enum is used to hold information about the type of the style option, and |
| 949 | is defined for each QStyleOption subclass. |
| 950 | |
| 951 | \value Type The type of style option provided (\l{SO_Button} for this class). |
| 952 | |
| 953 | The type is used internally by QStyleOption, its subclasses, and |
| 954 | qstyleoption_cast() to determine the type of style option. In |
| 955 | general you do not need to worry about this unless you want to |
| 956 | create your own QStyleOption subclass and your own styles. |
| 957 | |
| 958 | \sa StyleOptionVersion |
| 959 | */ |
| 960 | |
| 961 | /*! |
| 962 | \enum QStyleOptionButton::StyleOptionVersion |
| 963 | |
| 964 | This enum is used to hold information about the version of the style option, and |
| 965 | is defined for each QStyleOption subclass. |
| 966 | |
| 967 | \value Version 1 |
| 968 | |
| 969 | The version is used by QStyleOption subclasses to implement |
| 970 | extensions without breaking compatibility. If you use |
| 971 | qstyleoption_cast(), you normally do not need to check it. |
| 972 | |
| 973 | \sa StyleOptionType |
| 974 | */ |
| 975 | |
| 976 | /*! |
| 977 | \variable QStyleOptionButton::features |
| 978 | \brief a bitwise OR of the features that describe this button |
| 979 | |
| 980 | \sa ButtonFeature |
| 981 | */ |
| 982 | |
| 983 | /*! |
| 984 | \variable QStyleOptionButton::text |
| 985 | \brief the text of the button |
| 986 | |
| 987 | The default value is an empty string. |
| 988 | */ |
| 989 | |
| 990 | /*! |
| 991 | \variable QStyleOptionButton::icon |
| 992 | \brief the icon of the button |
| 993 | |
| 994 | The default value is an empty icon, i.e. an icon with neither a |
| 995 | pixmap nor a filename. |
| 996 | |
| 997 | \sa iconSize |
| 998 | */ |
| 999 | |
| 1000 | /*! |
| 1001 | \variable QStyleOptionButton::iconSize |
| 1002 | \brief the size of the icon for the button |
| 1003 | |
| 1004 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 1005 | */ |
| 1006 | |
| 1007 | |
| 1008 | #if QT_CONFIG(toolbar) |
| 1009 | /*! |
| 1010 | \class QStyleOptionToolBar |
| 1011 | \brief The QStyleOptionToolBar class is used to describe the |
| 1012 | parameters for drawing a toolbar. |
| 1013 | |
| 1014 | \since 4.1 |
| 1015 | \inmodule QtWidgets |
| 1016 | |
| 1017 | QStyleOptionToolBar contains all the information that QStyle |
| 1018 | functions need to draw QToolBar. |
| 1019 | |
| 1020 | The QStyleOptionToolBar class holds the lineWidth and the |
| 1021 | midLineWidth for drawing the widget. It also stores information |
| 1022 | about which \l {toolBarArea}{area} the toolbar should be located |
| 1023 | in, whether it is movable or not, which position the toolbar line |
| 1024 | should have (positionOfLine), and the toolbar's position within |
| 1025 | the line (positionWithinLine). |
| 1026 | |
| 1027 | In addition, the class provides a couple of enums: The |
| 1028 | ToolBarFeature enum is used to describe whether a toolbar is |
| 1029 | movable or not, and the ToolBarPosition enum is used to describe |
| 1030 | the position of a toolbar line, as well as the toolbar's position |
| 1031 | within the line. |
| 1032 | |
| 1033 | For performance reasons, there are few member functions and the |
| 1034 | access to the member variables is direct (i.e., using the \c . or |
| 1035 | \c -> operator). This makes the structures straightforward to use |
| 1036 | and emphasizes that these are simply parameters used by the style |
| 1037 | functions. |
| 1038 | |
| 1039 | \sa QStyleOption |
| 1040 | */ |
| 1041 | |
| 1042 | /*! |
| 1043 | Constructs a QStyleOptionToolBar, initializing the members |
| 1044 | variables to their default values. |
| 1045 | */ |
| 1046 | |
| 1047 | QStyleOptionToolBar::QStyleOptionToolBar() |
| 1048 | : QStyleOptionToolBar(Version) |
| 1049 | { |
| 1050 | } |
| 1051 | |
| 1052 | /*! |
| 1053 | \fn QStyleOptionToolBar::QStyleOptionToolBar(const QStyleOptionToolBar &other) |
| 1054 | |
| 1055 | Constructs a copy of the \a other style option. |
| 1056 | */ |
| 1057 | |
| 1058 | /*! |
| 1059 | \internal |
| 1060 | */ |
| 1061 | QStyleOptionToolBar::QStyleOptionToolBar(int version) |
| 1062 | : QStyleOption(version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne), |
| 1063 | toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0) |
| 1064 | { |
| 1065 | |
| 1066 | } |
| 1067 | |
| 1068 | /*! |
| 1069 | \enum QStyleOptionToolBar::ToolBarPosition |
| 1070 | |
| 1071 | \image qstyleoptiontoolbar-position.png |
| 1072 | |
| 1073 | This enum is used to describe the position of a toolbar line, as |
| 1074 | well as the toolbar's position within the line. |
| 1075 | |
| 1076 | The order of the positions within a line starts at the top of a |
| 1077 | vertical line, and from the left within a horizontal line. The |
| 1078 | order of the positions for the lines is always from the |
| 1079 | parent widget's boundary edges. |
| 1080 | |
| 1081 | \value Beginning The toolbar is located at the beginning of the line, |
| 1082 | or the toolbar line is the first of several lines. There can |
| 1083 | only be one toolbar (and only one line) with this position. |
| 1084 | \value Middle The toolbar is located in the middle of the line, |
| 1085 | or the toolbar line is in the middle of several lines. There can |
| 1086 | several toolbars (and lines) with this position. |
| 1087 | \value End The toolbar is located at the end of the line, |
| 1088 | or the toolbar line is the last of several lines. There can |
| 1089 | only be one toolbar (and only one line) with this position. |
| 1090 | \value OnlyOne There is only one toolbar or line. This is the default value |
| 1091 | of the positionOfLine and positionWithinLine variables. |
| 1092 | |
| 1093 | \sa positionWithinLine, positionOfLine |
| 1094 | */ |
| 1095 | |
| 1096 | /*! |
| 1097 | \enum QStyleOptionToolBar::ToolBarFeature |
| 1098 | |
| 1099 | This enum is used to describe whether a toolbar is movable or not. |
| 1100 | |
| 1101 | \value None The toolbar cannot be moved. The default value. |
| 1102 | \value Movable The toolbar is movable, and a handle will appear when |
| 1103 | holding the cursor over the toolbar's boundary. |
| 1104 | |
| 1105 | \sa features, QToolBar::isMovable() |
| 1106 | */ |
| 1107 | |
| 1108 | /*! |
| 1109 | \variable QStyleOptionToolBar::positionOfLine |
| 1110 | |
| 1111 | This variable holds the position of the toolbar line. |
| 1112 | |
| 1113 | The default value is QStyleOptionToolBar::OnlyOne. |
| 1114 | */ |
| 1115 | |
| 1116 | /*! |
| 1117 | \variable QStyleOptionToolBar::positionWithinLine |
| 1118 | |
| 1119 | This variable holds the position of the toolbar within a line. |
| 1120 | |
| 1121 | The default value is QStyleOptionToolBar::OnlyOne. |
| 1122 | */ |
| 1123 | |
| 1124 | /*! |
| 1125 | \variable QStyleOptionToolBar::toolBarArea |
| 1126 | |
| 1127 | This variable holds the location for drawing the toolbar. |
| 1128 | |
| 1129 | The default value is Qt::TopToolBarArea. |
| 1130 | |
| 1131 | \sa Qt::ToolBarArea |
| 1132 | */ |
| 1133 | |
| 1134 | /*! |
| 1135 | \variable QStyleOptionToolBar::features |
| 1136 | |
| 1137 | This variable holds whether the toolbar is movable or not. |
| 1138 | |
| 1139 | The default value is \l None. |
| 1140 | */ |
| 1141 | |
| 1142 | /*! |
| 1143 | \variable QStyleOptionToolBar::lineWidth |
| 1144 | |
| 1145 | This variable holds the line width for drawing the toolbar. |
| 1146 | |
| 1147 | The default value is 0. |
| 1148 | */ |
| 1149 | |
| 1150 | /*! |
| 1151 | \variable QStyleOptionToolBar::midLineWidth |
| 1152 | |
| 1153 | This variable holds the mid-line width for drawing the toolbar. |
| 1154 | |
| 1155 | The default value is 0. |
| 1156 | */ |
| 1157 | |
| 1158 | /*! |
| 1159 | \enum QStyleOptionToolBar::StyleOptionType |
| 1160 | |
| 1161 | This enum is used to hold information about the type of the style |
| 1162 | option, and is defined for each QStyleOption subclass. |
| 1163 | |
| 1164 | \value Type The type of style option provided (\l{SO_ToolBar} for |
| 1165 | this class). |
| 1166 | |
| 1167 | The type is used internally by QStyleOption, its subclasses, and |
| 1168 | qstyleoption_cast() to determine the type of style option. In |
| 1169 | general you do not need to worry about this unless you want to |
| 1170 | create your own QStyleOption subclass and your own styles. |
| 1171 | |
| 1172 | \sa StyleOptionVersion |
| 1173 | */ |
| 1174 | |
| 1175 | /*! |
| 1176 | \enum QStyleOptionToolBar::StyleOptionVersion |
| 1177 | |
| 1178 | This enum is used to hold information about the version of the |
| 1179 | style option, and is defined for each QStyleOption subclass. |
| 1180 | |
| 1181 | \value Version 1 |
| 1182 | |
| 1183 | The version is used by QStyleOption subclasses to implement |
| 1184 | extensions without breaking compatibility. If you use |
| 1185 | qstyleoption_cast(), you normally do not need to check it. |
| 1186 | |
| 1187 | \sa StyleOptionType |
| 1188 | */ |
| 1189 | |
| 1190 | #endif |
| 1191 | |
| 1192 | #if QT_CONFIG(tabbar) |
| 1193 | /*! |
| 1194 | \class QStyleOptionTab |
| 1195 | \brief The QStyleOptionTab class is used to describe the |
| 1196 | parameters for drawing a tab bar. |
| 1197 | |
| 1198 | \inmodule QtWidgets |
| 1199 | |
| 1200 | The QStyleOptionTab class is used for drawing several built-in Qt |
| 1201 | widgets including \l QTabBar and the panel for \l QTabWidget. |
| 1202 | |
| 1203 | An instance of the QStyleOptionTab class has |
| 1204 | \l{QStyleOption::type} {type} \l SO_Tab and |
| 1205 | \l{QStyleOption::version} {version} 3. The type is used internally |
| 1206 | by QStyleOption, its subclasses, and qstyleoption_cast() to |
| 1207 | determine the type of style option. In general you do not need to |
| 1208 | worry about this unless you want to create your own QStyleOption |
| 1209 | subclass and your own styles. The version is used by QStyleOption |
| 1210 | subclasses to implement extensions without breaking |
| 1211 | compatibility. If you use qstyleoption_cast(), you normally do not |
| 1212 | need to check it. |
| 1213 | |
| 1214 | For performance reasons, there are few member functions and the |
| 1215 | access to the member variables is direct (i.e., using the \c . or |
| 1216 | \c -> operator). This makes the structures straightforward to use |
| 1217 | and emphasizes that these are simply parameters used by the style |
| 1218 | functions. |
| 1219 | |
| 1220 | \sa QStyleOption |
| 1221 | */ |
| 1222 | |
| 1223 | /*! |
| 1224 | Constructs a QStyleOptionTab object, initializing the members |
| 1225 | variables to their default values. |
| 1226 | */ |
| 1227 | |
| 1228 | QStyleOptionTab::QStyleOptionTab() |
| 1229 | : QStyleOptionTab(QStyleOptionTab::Version) |
| 1230 | { |
| 1231 | } |
| 1232 | |
| 1233 | /*! |
| 1234 | \internal |
| 1235 | */ |
| 1236 | QStyleOptionTab::QStyleOptionTab(int version) |
| 1237 | : QStyleOption(version, SO_Tab), |
| 1238 | shape(QTabBar::RoundedNorth), |
| 1239 | row(0), |
| 1240 | position(Beginning), |
| 1241 | selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets), |
| 1242 | documentMode(false), |
| 1243 | features(QStyleOptionTab::None) |
| 1244 | { |
| 1245 | } |
| 1246 | |
| 1247 | /*! |
| 1248 | \fn QStyleOptionTab::QStyleOptionTab(const QStyleOptionTab &other) |
| 1249 | |
| 1250 | Constructs a copy of the \a other style option. |
| 1251 | */ |
| 1252 | |
| 1253 | /*! |
| 1254 | \enum QStyleOptionTab::StyleOptionType |
| 1255 | |
| 1256 | This enum is used to hold information about the type of the style option, and |
| 1257 | is defined for each QStyleOption subclass. |
| 1258 | |
| 1259 | \value Type The type of style option provided (\l{SO_Tab} for this class). |
| 1260 | |
| 1261 | The type is used internally by QStyleOption, its subclasses, and |
| 1262 | qstyleoption_cast() to determine the type of style option. In |
| 1263 | general you do not need to worry about this unless you want to |
| 1264 | create your own QStyleOption subclass and your own styles. |
| 1265 | |
| 1266 | \sa StyleOptionVersion |
| 1267 | */ |
| 1268 | |
| 1269 | /*! |
| 1270 | \enum QStyleOptionTab::StyleOptionVersion |
| 1271 | |
| 1272 | This enum is used to hold information about the version of the style option, and |
| 1273 | is defined for each QStyleOption subclass. |
| 1274 | |
| 1275 | \value Version 3 |
| 1276 | |
| 1277 | The version is used by QStyleOption subclasses to implement |
| 1278 | extensions without breaking compatibility. If you use |
| 1279 | qstyleoption_cast(), you normally do not need to check it. |
| 1280 | |
| 1281 | \sa StyleOptionType |
| 1282 | */ |
| 1283 | |
| 1284 | /*! |
| 1285 | \enum QStyleOptionTab::TabPosition |
| 1286 | |
| 1287 | This enum describes the position of the tab. |
| 1288 | |
| 1289 | \value Beginning The tab is the first tab in the tab bar. |
| 1290 | \value Middle The tab is neither the first nor the last tab in the tab bar. |
| 1291 | \value End The tab is the last tab in the tab bar. |
| 1292 | \value OnlyOneTab The tab is both the first and the last tab in the tab bar. |
| 1293 | \value [since 6.6] Moving The tab is moving by mouse drag or animation. |
| 1294 | |
| 1295 | \sa position |
| 1296 | */ |
| 1297 | |
| 1298 | /*! |
| 1299 | \enum QStyleOptionTab::CornerWidget |
| 1300 | |
| 1301 | These flags indicate the corner widgets in a tab. |
| 1302 | |
| 1303 | \value NoCornerWidgets There are no corner widgets |
| 1304 | \value LeftCornerWidget Left corner widget |
| 1305 | \value RightCornerWidget Right corner widget |
| 1306 | |
| 1307 | \sa cornerWidgets |
| 1308 | */ |
| 1309 | |
| 1310 | /*! \enum QStyleOptionTab::SelectedPosition |
| 1311 | |
| 1312 | This enum describes the position of the selected tab. Some styles |
| 1313 | need to draw a tab differently depending on whether or not it is |
| 1314 | adjacent to the selected tab. |
| 1315 | |
| 1316 | \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab). |
| 1317 | \value NextIsSelected The next tab (typically the tab on the right) is selected. |
| 1318 | \value PreviousIsSelected The previous tab (typically the tab on the left) is selected. |
| 1319 | |
| 1320 | \sa selectedPosition |
| 1321 | */ |
| 1322 | |
| 1323 | /*! |
| 1324 | \variable QStyleOptionTab::selectedPosition |
| 1325 | \brief the position of the selected tab in relation to this tab |
| 1326 | |
| 1327 | The default value is NotAdjacent, i.e. the tab is not adjacent to |
| 1328 | a selected tab nor is it the selected tab. |
| 1329 | */ |
| 1330 | |
| 1331 | /*! |
| 1332 | \variable QStyleOptionTab::cornerWidgets |
| 1333 | \brief an OR combination of CornerWidget values indicating the |
| 1334 | corner widgets of the tab bar |
| 1335 | |
| 1336 | The default value is NoCornerWidgets. |
| 1337 | |
| 1338 | \sa CornerWidget |
| 1339 | */ |
| 1340 | |
| 1341 | |
| 1342 | /*! |
| 1343 | \variable QStyleOptionTab::shape |
| 1344 | \brief the tab shape used to draw the tab; by default |
| 1345 | QTabBar::RoundedNorth. |
| 1346 | |
| 1347 | \sa QTabBar::Shape |
| 1348 | */ |
| 1349 | |
| 1350 | /*! |
| 1351 | \variable QStyleOptionTab::text |
| 1352 | \brief the text of the tab |
| 1353 | |
| 1354 | The default value is an empty string. |
| 1355 | */ |
| 1356 | |
| 1357 | /*! |
| 1358 | \variable QStyleOptionTab::icon |
| 1359 | \brief the icon for the tab |
| 1360 | |
| 1361 | The default value is an empty icon, i.e. an icon with neither a |
| 1362 | pixmap nor a filename. |
| 1363 | */ |
| 1364 | |
| 1365 | /*! |
| 1366 | \variable QStyleOptionTab::row |
| 1367 | \brief which row the tab is currently in |
| 1368 | |
| 1369 | The default value is 0, indicating the front row. Currently this |
| 1370 | property can only be 0. |
| 1371 | */ |
| 1372 | |
| 1373 | /*! |
| 1374 | \variable QStyleOptionTab::position |
| 1375 | \brief the position of the tab in the tab bar |
| 1376 | |
| 1377 | The default value is \l Beginning, i.e. the tab is the first tab |
| 1378 | in the tab bar. |
| 1379 | */ |
| 1380 | /*! |
| 1381 | \variable QStyleOptionTab::iconSize |
| 1382 | \brief the size for the icons |
| 1383 | |
| 1384 | The default value is QSize(-1, -1), i.e. an invalid size; use |
| 1385 | QStyle::pixelMetric() to find the default icon size for tab bars. |
| 1386 | |
| 1387 | \sa QTabBar::iconSize() |
| 1388 | */ |
| 1389 | |
| 1390 | /*! |
| 1391 | \variable QStyleOptionTab::documentMode |
| 1392 | \brief whether the tabbar is in document mode. |
| 1393 | |
| 1394 | The default value is false; |
| 1395 | */ |
| 1396 | |
| 1397 | /*! |
| 1398 | \enum QStyleOptionTab::TabFeature |
| 1399 | |
| 1400 | Describes the various features that a tab button can have. |
| 1401 | |
| 1402 | \value None A normal tab button. |
| 1403 | \value HasFrame The tab button is positioned on a tab frame |
| 1404 | |
| 1405 | \sa QStyleOptionToolBar::features |
| 1406 | */ |
| 1407 | |
| 1408 | /*! |
| 1409 | \variable QStyleOptionTab::leftButtonSize |
| 1410 | \brief the size for the left widget on the tab. |
| 1411 | |
| 1412 | The default value is QSize(-1, -1), i.e. an invalid size; |
| 1413 | */ |
| 1414 | |
| 1415 | /*! |
| 1416 | \variable QStyleOptionTab::rightButtonSize |
| 1417 | \brief the size for the right widget on the tab. |
| 1418 | |
| 1419 | The default value is QSize(-1, -1), i.e. an invalid size; |
| 1420 | */ |
| 1421 | |
| 1422 | /*! |
| 1423 | \variable QStyleOptionTab::tabIndex |
| 1424 | \brief the index for the tab being represented. |
| 1425 | |
| 1426 | The default value is -1, i.e. a tab not on a tabbar; |
| 1427 | */ |
| 1428 | |
| 1429 | #endif // QT_CONFIG(tabbar) |
| 1430 | |
| 1431 | /*! |
| 1432 | \class QStyleOptionProgressBar |
| 1433 | \brief The QStyleOptionProgressBar class is used to describe the |
| 1434 | parameters necessary for drawing a progress bar. |
| 1435 | |
| 1436 | \inmodule QtWidgets |
| 1437 | |
| 1438 | An instance of the QStyleOptionProgressBar class has type |
| 1439 | SO_ProgressBar and version 2. |
| 1440 | |
| 1441 | The type is used internally by QStyleOption, its subclasses, and |
| 1442 | qstyleoption_cast() to determine the type of style option. In |
| 1443 | general you do not need to worry about this unless you want to |
| 1444 | create your own QStyleOption subclass and your own styles. The |
| 1445 | version is used by QStyleOption subclasses to implement extensions |
| 1446 | without breaking compatibility. If you use qstyleoption_cast(), |
| 1447 | you normally do not need to check it. |
| 1448 | |
| 1449 | For performance reasons, there are few member functions and the |
| 1450 | access to the member variables is direct (i.e., using the \c . or |
| 1451 | \c -> operator). This makes the structures straightforward to use |
| 1452 | and emphasizes that these are simply parameters used by the style |
| 1453 | functions. |
| 1454 | |
| 1455 | \sa QStyleOption |
| 1456 | */ |
| 1457 | |
| 1458 | /*! |
| 1459 | Constructs a QStyleOptionProgressBar, initializing the members |
| 1460 | variables to their default values. |
| 1461 | */ |
| 1462 | |
| 1463 | QStyleOptionProgressBar::QStyleOptionProgressBar() |
| 1464 | : QStyleOptionProgressBar(QStyleOptionProgressBar::Version) |
| 1465 | { |
| 1466 | } |
| 1467 | |
| 1468 | /*! |
| 1469 | \internal |
| 1470 | */ |
| 1471 | QStyleOptionProgressBar::QStyleOptionProgressBar(int version) |
| 1472 | : QStyleOption(version, SO_ProgressBar), |
| 1473 | minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false), |
| 1474 | invertedAppearance(false), bottomToTop(false) |
| 1475 | { |
| 1476 | state |= QStyle::State_Horizontal; |
| 1477 | } |
| 1478 | |
| 1479 | /*! |
| 1480 | \fn QStyleOptionProgressBar::QStyleOptionProgressBar(const QStyleOptionProgressBar &other) |
| 1481 | |
| 1482 | Constructs a copy of the \a other style option. |
| 1483 | */ |
| 1484 | |
| 1485 | /*! |
| 1486 | \enum QStyleOptionProgressBar::StyleOptionType |
| 1487 | |
| 1488 | This enum is used to hold information about the type of the style option, and |
| 1489 | is defined for each QStyleOption subclass. |
| 1490 | |
| 1491 | \value Type The type of style option provided (\l{SO_ProgressBar} for this class). |
| 1492 | |
| 1493 | The type is used internally by QStyleOption, its subclasses, and |
| 1494 | qstyleoption_cast() to determine the type of style option. In |
| 1495 | general you do not need to worry about this unless you want to |
| 1496 | create your own QStyleOption subclass and your own styles. |
| 1497 | |
| 1498 | \sa StyleOptionVersion |
| 1499 | */ |
| 1500 | |
| 1501 | /*! |
| 1502 | \enum QStyleOptionProgressBar::StyleOptionVersion |
| 1503 | |
| 1504 | This enum is used to hold information about the version of the style option, and |
| 1505 | is defined for each QStyleOption subclass. |
| 1506 | |
| 1507 | \value Version 2 |
| 1508 | |
| 1509 | The version is used by QStyleOption subclasses to implement |
| 1510 | extensions without breaking compatibility. If you use |
| 1511 | qstyleoption_cast(), you normally do not need to check it. |
| 1512 | |
| 1513 | \sa StyleOptionType |
| 1514 | */ |
| 1515 | |
| 1516 | /*! |
| 1517 | \variable QStyleOptionProgressBar::minimum |
| 1518 | \brief the minimum value for the progress bar |
| 1519 | |
| 1520 | This is the minimum value in the progress bar. The default value |
| 1521 | is 0. |
| 1522 | |
| 1523 | \sa QProgressBar::minimum |
| 1524 | */ |
| 1525 | |
| 1526 | /*! |
| 1527 | \variable QStyleOptionProgressBar::maximum |
| 1528 | \brief the maximum value for the progress bar |
| 1529 | |
| 1530 | This is the maximum value in the progress bar. The default value |
| 1531 | is 0. |
| 1532 | |
| 1533 | \sa QProgressBar::maximum |
| 1534 | */ |
| 1535 | |
| 1536 | /*! |
| 1537 | \variable QStyleOptionProgressBar::text |
| 1538 | \brief the text for the progress bar |
| 1539 | |
| 1540 | The progress bar text is usually just the progress expressed as a |
| 1541 | string. An empty string indicates that the progress bar has not |
| 1542 | started yet. The default value is an empty string. |
| 1543 | |
| 1544 | \sa QProgressBar::text |
| 1545 | */ |
| 1546 | |
| 1547 | /*! |
| 1548 | \variable QStyleOptionProgressBar::textVisible |
| 1549 | \brief a flag indicating whether or not text is visible |
| 1550 | |
| 1551 | If this flag is true then the text is visible. Otherwise, the text |
| 1552 | is not visible. The default value is false. |
| 1553 | |
| 1554 | \sa QProgressBar::textVisible |
| 1555 | */ |
| 1556 | |
| 1557 | |
| 1558 | /*! |
| 1559 | \variable QStyleOptionProgressBar::textAlignment |
| 1560 | \brief the text alignment for the text in the QProgressBar. |
| 1561 | |
| 1562 | This can be used as a guide on where the text should be in the |
| 1563 | progress bar. The default value is Qt::AlignLeft. |
| 1564 | */ |
| 1565 | |
| 1566 | /*! |
| 1567 | \variable QStyleOptionProgressBar::progress |
| 1568 | \brief the current progress for the progress bar |
| 1569 | |
| 1570 | The current progress. A value of QStyleOptionProgressBar::minimum |
| 1571 | - 1 indicates that the progress hasn't started yet. The default |
| 1572 | value is 0. |
| 1573 | |
| 1574 | \sa QProgressBar::value |
| 1575 | */ |
| 1576 | |
| 1577 | /*! |
| 1578 | \variable QStyleOptionProgressBar::invertedAppearance |
| 1579 | \brief whether the progress bar's appearance is inverted |
| 1580 | |
| 1581 | The default value is false. |
| 1582 | |
| 1583 | \sa QProgressBar::invertedAppearance |
| 1584 | */ |
| 1585 | |
| 1586 | /*! |
| 1587 | \variable QStyleOptionProgressBar::bottomToTop |
| 1588 | \brief whether the text reads from bottom to top when the progress |
| 1589 | bar is vertical |
| 1590 | |
| 1591 | The default value is false. |
| 1592 | |
| 1593 | \sa QProgressBar::textDirection |
| 1594 | */ |
| 1595 | |
| 1596 | /*! |
| 1597 | \class QStyleOptionMenuItem |
| 1598 | \brief The QStyleOptionMenuItem class is used to describe the |
| 1599 | parameter necessary for drawing a menu item. |
| 1600 | |
| 1601 | \inmodule QtWidgets |
| 1602 | |
| 1603 | QStyleOptionMenuItem contains all the information that QStyle |
| 1604 | functions need to draw the menu items from \l QMenu. It is also |
| 1605 | used for drawing other menu-related widgets. |
| 1606 | |
| 1607 | For performance reasons, there are few member functions and the |
| 1608 | access to the member variables is direct (i.e., using the \c . or |
| 1609 | \c -> operator). This makes the structures straightforward to use |
| 1610 | and emphasizes that these are simply parameters used by the style |
| 1611 | functions. |
| 1612 | |
| 1613 | \sa QStyleOption |
| 1614 | */ |
| 1615 | |
| 1616 | /*! |
| 1617 | Constructs a QStyleOptionMenuItem, initializing the members |
| 1618 | variables to their default values. |
| 1619 | */ |
| 1620 | |
| 1621 | QStyleOptionMenuItem::() |
| 1622 | : QStyleOptionMenuItem(QStyleOptionMenuItem::Version) |
| 1623 | { |
| 1624 | } |
| 1625 | |
| 1626 | /*! |
| 1627 | \internal |
| 1628 | */ |
| 1629 | QStyleOptionMenuItem::(int version) |
| 1630 | : QStyleOption(version, SO_MenuItem), menuItemType(Normal), |
| 1631 | checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), |
| 1632 | reservedShortcutWidth(0) |
| 1633 | { |
| 1634 | } |
| 1635 | |
| 1636 | /*! |
| 1637 | \fn QStyleOptionMenuItem::QStyleOptionMenuItem(const QStyleOptionMenuItem &other) |
| 1638 | |
| 1639 | Constructs a copy of the \a other style option. |
| 1640 | */ |
| 1641 | |
| 1642 | /*! |
| 1643 | \enum QStyleOptionMenuItem::StyleOptionType |
| 1644 | |
| 1645 | This enum is used to hold information about the type of the style option, and |
| 1646 | is defined for each QStyleOption subclass. |
| 1647 | |
| 1648 | \value Type The type of style option provided (\l{SO_MenuItem} for this class). |
| 1649 | |
| 1650 | The type is used internally by QStyleOption, its subclasses, and |
| 1651 | qstyleoption_cast() to determine the type of style option. In |
| 1652 | general you do not need to worry about this unless you want to |
| 1653 | create your own QStyleOption subclass and your own styles. |
| 1654 | |
| 1655 | \sa StyleOptionVersion |
| 1656 | */ |
| 1657 | |
| 1658 | /*! |
| 1659 | \enum QStyleOptionMenuItem::StyleOptionVersion |
| 1660 | |
| 1661 | This enum is used to hold information about the version of the style option, and |
| 1662 | is defined for each QStyleOption subclass. |
| 1663 | |
| 1664 | \value Version 1 |
| 1665 | |
| 1666 | The version is used by QStyleOption subclasses to implement |
| 1667 | extensions without breaking compatibility. If you use |
| 1668 | qstyleoption_cast(), you normally do not need to check it. |
| 1669 | |
| 1670 | \sa StyleOptionType |
| 1671 | */ |
| 1672 | |
| 1673 | /*! |
| 1674 | \enum QStyleOptionMenuItem::MenuItemType |
| 1675 | |
| 1676 | This enum indicates the type of menu item that the structure describes. |
| 1677 | |
| 1678 | \value Normal A normal menu item. |
| 1679 | \value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction(). |
| 1680 | \value Separator A menu separator. |
| 1681 | \value SubMenu Indicates the menu item points to a sub-menu. |
| 1682 | \value Scroller A popup menu scroller (currently only used on \macos). |
| 1683 | \value TearOff A tear-off handle for the menu. |
| 1684 | \value Margin The margin of the menu. |
| 1685 | \value EmptyArea The empty area of the menu. |
| 1686 | |
| 1687 | \sa menuItemType |
| 1688 | */ |
| 1689 | |
| 1690 | /*! |
| 1691 | \enum QStyleOptionMenuItem::CheckType |
| 1692 | |
| 1693 | This enum is used to indicate whether or not a check mark should be |
| 1694 | drawn for the item, or even if it should be drawn at all. |
| 1695 | |
| 1696 | \value NotCheckable The item is not checkable. |
| 1697 | \value Exclusive The item is an exclusive check item (like a radio button). |
| 1698 | \value NonExclusive The item is a non-exclusive check item (like a check box). |
| 1699 | |
| 1700 | \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy |
| 1701 | */ |
| 1702 | |
| 1703 | /*! |
| 1704 | \variable QStyleOptionMenuItem::menuItemType |
| 1705 | \brief the type of menu item |
| 1706 | |
| 1707 | The default value is \l Normal. |
| 1708 | |
| 1709 | \sa MenuItemType |
| 1710 | */ |
| 1711 | |
| 1712 | /*! |
| 1713 | \variable QStyleOptionMenuItem::checkType |
| 1714 | \brief the type of checkmark of the menu item |
| 1715 | |
| 1716 | The default value is \l NotCheckable. |
| 1717 | |
| 1718 | \sa CheckType |
| 1719 | */ |
| 1720 | |
| 1721 | /*! |
| 1722 | \variable QStyleOptionMenuItem::checked |
| 1723 | \brief whether the menu item is checked or not |
| 1724 | |
| 1725 | The default value is false. |
| 1726 | */ |
| 1727 | |
| 1728 | /*! |
| 1729 | \variable QStyleOptionMenuItem::menuHasCheckableItems |
| 1730 | \brief whether the menu as a whole has checkable items or not |
| 1731 | |
| 1732 | The default value is true. |
| 1733 | |
| 1734 | If this option is set to false, then the menu has no checkable |
| 1735 | items. This makes it possible for GUI styles to save some |
| 1736 | horizontal space that would normally be used for the check column. |
| 1737 | */ |
| 1738 | |
| 1739 | /*! |
| 1740 | \variable QStyleOptionMenuItem::menuRect |
| 1741 | \brief the rectangle for the entire menu |
| 1742 | |
| 1743 | The default value is a null rectangle, i.e. a rectangle with both |
| 1744 | the width and the height set to 0. |
| 1745 | */ |
| 1746 | |
| 1747 | /*! |
| 1748 | \variable QStyleOptionMenuItem::text |
| 1749 | \brief the text for the menu item |
| 1750 | |
| 1751 | Note that the text format is something like this "Menu |
| 1752 | text\b{\\t}Shortcut". |
| 1753 | |
| 1754 | If the menu item doesn't have a shortcut, it will just contain the |
| 1755 | menu item's text. The default value is an empty string. |
| 1756 | */ |
| 1757 | |
| 1758 | /*! |
| 1759 | \variable QStyleOptionMenuItem::icon |
| 1760 | \brief the icon for the menu item |
| 1761 | |
| 1762 | The default value is an empty icon, i.e. an icon with neither a |
| 1763 | pixmap nor a filename. |
| 1764 | */ |
| 1765 | |
| 1766 | /*! |
| 1767 | \variable QStyleOptionMenuItem::maxIconWidth |
| 1768 | \brief the maximum icon width for the icon in the menu item |
| 1769 | |
| 1770 | This can be used for drawing the icon into the correct place or |
| 1771 | properly aligning items. The variable must be set regardless of |
| 1772 | whether or not the menu item has an icon. The default value is 0. |
| 1773 | */ |
| 1774 | |
| 1775 | /*! |
| 1776 | \variable QStyleOptionMenuItem::reservedShortcutWidth |
| 1777 | \brief the reserved width for the menu item's shortcut |
| 1778 | |
| 1779 | QMenu sets it to the width occupied by the widest shortcut among |
| 1780 | all visible items within the menu. |
| 1781 | |
| 1782 | The default value is 0. |
| 1783 | */ |
| 1784 | |
| 1785 | |
| 1786 | /*! |
| 1787 | \variable QStyleOptionMenuItem::font |
| 1788 | \brief the font used for the menu item text |
| 1789 | |
| 1790 | This is the font that should be used for drawing the menu text |
| 1791 | minus the shortcut. The shortcut is usually drawn using the |
| 1792 | painter's font. By default, the application's default font is |
| 1793 | used. |
| 1794 | */ |
| 1795 | |
| 1796 | /*! |
| 1797 | \class QStyleOptionComplex |
| 1798 | \brief The QStyleOptionComplex class is used to hold parameters that are |
| 1799 | common to all complex controls. |
| 1800 | |
| 1801 | \inmodule QtWidgets |
| 1802 | |
| 1803 | This class is not used on its own. Instead it is used to derive |
| 1804 | other complex control options, for example QStyleOptionSlider and |
| 1805 | QStyleOptionSpinBox. |
| 1806 | |
| 1807 | For performance reasons, there are few member functions and the |
| 1808 | access to the member variables is direct (i.e., using the \c . or |
| 1809 | \c -> operator). This makes the structures straightforward to use |
| 1810 | and emphasizes that these are simply parameters used by the style |
| 1811 | functions. |
| 1812 | |
| 1813 | \sa QStyleOption |
| 1814 | */ |
| 1815 | |
| 1816 | /*! |
| 1817 | Constructs a QStyleOptionComplex of the specified \a type and \a |
| 1818 | version, initializing the member variables to their default |
| 1819 | values. This constructor is usually called by subclasses. |
| 1820 | */ |
| 1821 | |
| 1822 | QStyleOptionComplex::QStyleOptionComplex(int version, int type) |
| 1823 | : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None) |
| 1824 | { |
| 1825 | } |
| 1826 | |
| 1827 | /*! |
| 1828 | \fn QStyleOptionComplex::QStyleOptionComplex(const QStyleOptionComplex &other) |
| 1829 | |
| 1830 | Constructs a copy of the \a other style option. |
| 1831 | */ |
| 1832 | |
| 1833 | /*! |
| 1834 | \enum QStyleOptionComplex::StyleOptionType |
| 1835 | |
| 1836 | This enum is used to hold information about the type of the style option, and |
| 1837 | is defined for each QStyleOption subclass. |
| 1838 | |
| 1839 | \value Type The type of style option provided (\l{SO_Complex} for this class). |
| 1840 | |
| 1841 | The type is used internally by QStyleOption, its subclasses, and |
| 1842 | qstyleoption_cast() to determine the type of style option. In |
| 1843 | general you do not need to worry about this unless you want to |
| 1844 | create your own QStyleOption subclass and your own styles. |
| 1845 | |
| 1846 | \sa StyleOptionVersion |
| 1847 | */ |
| 1848 | |
| 1849 | /*! |
| 1850 | \enum QStyleOptionComplex::StyleOptionVersion |
| 1851 | |
| 1852 | This enum is used to hold information about the version of the style option, and |
| 1853 | is defined for each QStyleOption subclass. |
| 1854 | |
| 1855 | \value Version 1 |
| 1856 | |
| 1857 | The version is used by QStyleOption subclasses to implement |
| 1858 | extensions without breaking compatibility. If you use |
| 1859 | qstyleoption_cast(), you normally do not need to check it. |
| 1860 | |
| 1861 | \sa StyleOptionType |
| 1862 | */ |
| 1863 | |
| 1864 | /*! |
| 1865 | \variable QStyleOptionComplex::subControls |
| 1866 | |
| 1867 | This variable holds a bitwise OR of the \l{QStyle::SubControl} |
| 1868 | {sub-controls} to be drawn for the complex control. |
| 1869 | |
| 1870 | The default value is QStyle::SC_All. |
| 1871 | |
| 1872 | \sa QStyle::SubControl |
| 1873 | */ |
| 1874 | |
| 1875 | /*! |
| 1876 | \variable QStyleOptionComplex::activeSubControls |
| 1877 | |
| 1878 | This variable holds a bitwise OR of the \l{QStyle::SubControl} |
| 1879 | {sub-controls} that are active for the complex control. |
| 1880 | |
| 1881 | The default value is QStyle::SC_None. |
| 1882 | |
| 1883 | \sa QStyle::SubControl |
| 1884 | */ |
| 1885 | |
| 1886 | #if QT_CONFIG(slider) |
| 1887 | /*! |
| 1888 | \class QStyleOptionSlider |
| 1889 | \brief The QStyleOptionSlider class is used to describe the |
| 1890 | parameters needed for drawing a slider. |
| 1891 | |
| 1892 | \inmodule QtWidgets |
| 1893 | |
| 1894 | QStyleOptionSlider contains all the information that QStyle |
| 1895 | functions need to draw QSlider and QScrollBar. |
| 1896 | |
| 1897 | For performance reasons, there are few member functions and the |
| 1898 | access to the member variables is direct (i.e., using the \c . or |
| 1899 | \c -> operator). This makes the structures straightforward to use |
| 1900 | and emphasizes that these are simply parameters used by the style |
| 1901 | functions. |
| 1902 | |
| 1903 | \sa QStyleOptionComplex, QSlider, QScrollBar |
| 1904 | */ |
| 1905 | |
| 1906 | /*! |
| 1907 | Constructs a QStyleOptionSlider, initializing the members |
| 1908 | variables to their default values. |
| 1909 | */ |
| 1910 | |
| 1911 | QStyleOptionSlider::QStyleOptionSlider() |
| 1912 | : QStyleOptionSlider(Version) |
| 1913 | { |
| 1914 | } |
| 1915 | |
| 1916 | /*! |
| 1917 | \internal |
| 1918 | */ |
| 1919 | QStyleOptionSlider::QStyleOptionSlider(int version) |
| 1920 | : QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0), |
| 1921 | tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false), |
| 1922 | sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0), |
| 1923 | dialWrapping(false), keyboardModifiers{} |
| 1924 | { |
| 1925 | } |
| 1926 | |
| 1927 | /*! |
| 1928 | \fn QStyleOptionSlider::QStyleOptionSlider(const QStyleOptionSlider &other) |
| 1929 | |
| 1930 | Constructs a copy of the \a other style option. |
| 1931 | */ |
| 1932 | |
| 1933 | /*! |
| 1934 | \enum QStyleOptionSlider::StyleOptionType |
| 1935 | |
| 1936 | This enum is used to hold information about the type of the style option, and |
| 1937 | is defined for each QStyleOption subclass. |
| 1938 | |
| 1939 | \value Type The type of style option provided (\l{SO_Slider} for this class). |
| 1940 | |
| 1941 | The type is used internally by QStyleOption, its subclasses, and |
| 1942 | qstyleoption_cast() to determine the type of style option. In |
| 1943 | general you do not need to worry about this unless you want to |
| 1944 | create your own QStyleOption subclass and your own styles. |
| 1945 | |
| 1946 | \sa StyleOptionVersion |
| 1947 | */ |
| 1948 | |
| 1949 | /*! |
| 1950 | \enum QStyleOptionSlider::StyleOptionVersion |
| 1951 | |
| 1952 | This enum is used to hold information about the version of the style option, and |
| 1953 | is defined for each QStyleOption subclass. |
| 1954 | |
| 1955 | \value Version 1 |
| 1956 | |
| 1957 | The version is used by QStyleOption subclasses to implement |
| 1958 | extensions without breaking compatibility. If you use |
| 1959 | qstyleoption_cast(), you normally do not need to check it. |
| 1960 | |
| 1961 | \sa StyleOptionType |
| 1962 | */ |
| 1963 | |
| 1964 | /*! |
| 1965 | \variable QStyleOptionSlider::orientation |
| 1966 | \brief the slider's orientation (horizontal or vertical) |
| 1967 | |
| 1968 | The default orientation is Qt::Horizontal. |
| 1969 | |
| 1970 | \sa Qt::Orientation |
| 1971 | */ |
| 1972 | |
| 1973 | /*! |
| 1974 | \variable QStyleOptionSlider::minimum |
| 1975 | \brief the minimum value for the slider |
| 1976 | |
| 1977 | The default value is 0. |
| 1978 | */ |
| 1979 | |
| 1980 | /*! |
| 1981 | \variable QStyleOptionSlider::maximum |
| 1982 | \brief the maximum value for the slider |
| 1983 | |
| 1984 | The default value is 0. |
| 1985 | */ |
| 1986 | |
| 1987 | /*! |
| 1988 | \variable QStyleOptionSlider::tickPosition |
| 1989 | \brief the position of the slider's tick marks, if any |
| 1990 | |
| 1991 | The default value is QSlider::NoTicks. |
| 1992 | |
| 1993 | \sa QSlider::TickPosition |
| 1994 | */ |
| 1995 | |
| 1996 | /*! |
| 1997 | \variable QStyleOptionSlider::tickInterval |
| 1998 | \brief the interval that should be drawn between tick marks |
| 1999 | |
| 2000 | The default value is 0. |
| 2001 | */ |
| 2002 | |
| 2003 | /*! |
| 2004 | \variable QStyleOptionSlider::notchTarget |
| 2005 | \brief the number of pixel between notches |
| 2006 | |
| 2007 | The default value is 0.0. |
| 2008 | |
| 2009 | \sa QDial::notchTarget() |
| 2010 | */ |
| 2011 | |
| 2012 | /*! |
| 2013 | \variable QStyleOptionSlider::dialWrapping |
| 2014 | \brief whether the dial should wrap or not |
| 2015 | |
| 2016 | The default value is false, i.e. the dial is not wrapped. |
| 2017 | |
| 2018 | \sa QDial::wrapping() |
| 2019 | */ |
| 2020 | |
| 2021 | /*! |
| 2022 | \variable QStyleOptionSlider::upsideDown |
| 2023 | \brief the slider control orientation |
| 2024 | |
| 2025 | Normally a slider increases as it moves up or to the right; |
| 2026 | upsideDown indicates that it should do the opposite (increase as |
| 2027 | it moves down or to the left). The default value is false, |
| 2028 | i.e. the slider increases as it moves up or to the right. |
| 2029 | |
| 2030 | \sa QStyle::sliderPositionFromValue(), |
| 2031 | QStyle::sliderValueFromPosition(), |
| 2032 | QAbstractSlider::invertedAppearance |
| 2033 | */ |
| 2034 | |
| 2035 | /*! |
| 2036 | \variable QStyleOptionSlider::sliderPosition |
| 2037 | \brief the position of the slider handle |
| 2038 | |
| 2039 | If the slider has active feedback (i.e., |
| 2040 | QAbstractSlider::tracking is true), this value will be the same as |
| 2041 | \l sliderValue. Otherwise, it will have the current position of |
| 2042 | the handle. The default value is 0. |
| 2043 | |
| 2044 | \sa QAbstractSlider::tracking, sliderValue |
| 2045 | */ |
| 2046 | |
| 2047 | /*! |
| 2048 | \variable QStyleOptionSlider::sliderValue |
| 2049 | \brief the value of the slider |
| 2050 | |
| 2051 | If the slider has active feedback (i.e., |
| 2052 | QAbstractSlider::tracking is true), this value will be the same |
| 2053 | as \l sliderPosition. Otherwise, it will have the value the |
| 2054 | slider had before the mouse was pressed. |
| 2055 | |
| 2056 | The default value is 0. |
| 2057 | |
| 2058 | \sa QAbstractSlider::tracking, sliderPosition |
| 2059 | */ |
| 2060 | |
| 2061 | /*! |
| 2062 | \variable QStyleOptionSlider::singleStep |
| 2063 | \brief the size of the single step of the slider |
| 2064 | |
| 2065 | The default value is 0. |
| 2066 | |
| 2067 | \sa QAbstractSlider::singleStep |
| 2068 | */ |
| 2069 | |
| 2070 | /*! |
| 2071 | \variable QStyleOptionSlider::pageStep |
| 2072 | \brief the size of the page step of the slider |
| 2073 | |
| 2074 | The default value is 0. |
| 2075 | |
| 2076 | \sa QAbstractSlider::pageStep |
| 2077 | */ |
| 2078 | #endif // QT_CONFIG(slider) |
| 2079 | |
| 2080 | #if QT_CONFIG(spinbox) |
| 2081 | /*! |
| 2082 | \class QStyleOptionSpinBox |
| 2083 | \brief The QStyleOptionSpinBox class is used to describe the |
| 2084 | parameters necessary for drawing a spin box. |
| 2085 | |
| 2086 | \inmodule QtWidgets |
| 2087 | |
| 2088 | QStyleOptionSpinBox contains all the information that QStyle |
| 2089 | functions need to draw QSpinBox and QDateTimeEdit. |
| 2090 | |
| 2091 | For performance reasons, there are few member functions and the |
| 2092 | access to the member variables is direct (i.e., using the \c . or |
| 2093 | \c -> operator). This makes the structures straightforward to use |
| 2094 | and emphasizes that these are simply parameters used by the style |
| 2095 | functions. |
| 2096 | |
| 2097 | \sa QStyleOption, QStyleOptionComplex |
| 2098 | */ |
| 2099 | |
| 2100 | /*! |
| 2101 | Constructs a QStyleOptionSpinBox, initializing the members |
| 2102 | variables to their default values. |
| 2103 | */ |
| 2104 | |
| 2105 | QStyleOptionSpinBox::QStyleOptionSpinBox() |
| 2106 | : QStyleOptionSpinBox(Version) |
| 2107 | { |
| 2108 | } |
| 2109 | |
| 2110 | /*! |
| 2111 | \internal |
| 2112 | */ |
| 2113 | QStyleOptionSpinBox::QStyleOptionSpinBox(int version) |
| 2114 | : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows), |
| 2115 | stepEnabled(QAbstractSpinBox::StepNone), frame(false) |
| 2116 | { |
| 2117 | } |
| 2118 | |
| 2119 | /*! |
| 2120 | \fn QStyleOptionSpinBox::QStyleOptionSpinBox(const QStyleOptionSpinBox &other) |
| 2121 | |
| 2122 | Constructs a copy of the \a other style option. |
| 2123 | */ |
| 2124 | |
| 2125 | /*! |
| 2126 | \enum QStyleOptionSpinBox::StyleOptionType |
| 2127 | |
| 2128 | This enum is used to hold information about the type of the style option, and |
| 2129 | is defined for each QStyleOption subclass. |
| 2130 | |
| 2131 | \value Type The type of style option provided (\l{SO_SpinBox} for this class). |
| 2132 | |
| 2133 | The type is used internally by QStyleOption, its subclasses, and |
| 2134 | qstyleoption_cast() to determine the type of style option. In |
| 2135 | general you do not need to worry about this unless you want to |
| 2136 | create your own QStyleOption subclass and your own styles. |
| 2137 | |
| 2138 | \sa StyleOptionVersion |
| 2139 | */ |
| 2140 | |
| 2141 | /*! |
| 2142 | \enum QStyleOptionSpinBox::StyleOptionVersion |
| 2143 | |
| 2144 | This enum is used to hold information about the version of the style option, and |
| 2145 | is defined for each QStyleOption subclass. |
| 2146 | |
| 2147 | \value Version 1 |
| 2148 | |
| 2149 | The version is used by QStyleOption subclasses to implement |
| 2150 | extensions without breaking compatibility. If you use |
| 2151 | qstyleoption_cast(), you normally do not need to check it. |
| 2152 | |
| 2153 | \sa StyleOptionType |
| 2154 | */ |
| 2155 | |
| 2156 | /*! |
| 2157 | \variable QStyleOptionSpinBox::buttonSymbols |
| 2158 | \brief the type of button symbols to draw for the spin box |
| 2159 | |
| 2160 | The default value is QAbstractSpinBox::UpDownArrows specufying |
| 2161 | little arrows in the classic style. |
| 2162 | |
| 2163 | \sa QAbstractSpinBox::ButtonSymbols |
| 2164 | */ |
| 2165 | |
| 2166 | /*! |
| 2167 | \variable QStyleOptionSpinBox::stepEnabled |
| 2168 | \brief which buttons of the spin box that are enabled |
| 2169 | |
| 2170 | The default value is QAbstractSpinBox::StepNone. |
| 2171 | |
| 2172 | \sa QAbstractSpinBox::StepEnabled |
| 2173 | */ |
| 2174 | |
| 2175 | /*! |
| 2176 | \variable QStyleOptionSpinBox::frame |
| 2177 | \brief whether the spin box has a frame |
| 2178 | |
| 2179 | The default value is false, i.e. the spin box has no frame. |
| 2180 | */ |
| 2181 | #endif // QT_CONFIG(spinbox) |
| 2182 | |
| 2183 | /*! |
| 2184 | \class QStyleOptionDockWidget |
| 2185 | \brief The QStyleOptionDockWidget class is used to describe the |
| 2186 | parameters for drawing a dock widget. |
| 2187 | |
| 2188 | \inmodule QtWidgets |
| 2189 | |
| 2190 | QStyleOptionDockWidget contains all the information that QStyle |
| 2191 | functions need to draw graphical elements like QDockWidget. |
| 2192 | |
| 2193 | For performance reasons, there are few member functions and the |
| 2194 | access to the member variables is direct (i.e., using the \c . or |
| 2195 | \c -> operator). This makes the structures straightforward to use |
| 2196 | and emphasizes that these are simply parameters used by the style |
| 2197 | functions. |
| 2198 | |
| 2199 | \sa QStyleOption |
| 2200 | */ |
| 2201 | |
| 2202 | /*! |
| 2203 | Constructs a QStyleOptionDockWidget, initializing the member |
| 2204 | variables to their default values. |
| 2205 | */ |
| 2206 | |
| 2207 | QStyleOptionDockWidget::QStyleOptionDockWidget() |
| 2208 | : QStyleOptionDockWidget(Version) |
| 2209 | { |
| 2210 | } |
| 2211 | |
| 2212 | /*! |
| 2213 | \internal |
| 2214 | */ |
| 2215 | QStyleOptionDockWidget::QStyleOptionDockWidget(int version) |
| 2216 | : QStyleOption(version, SO_DockWidget), closable(false), |
| 2217 | movable(false), floatable(false), verticalTitleBar(false) |
| 2218 | { |
| 2219 | } |
| 2220 | |
| 2221 | /*! |
| 2222 | \fn QStyleOptionDockWidget::QStyleOptionDockWidget(const QStyleOptionDockWidget &other) |
| 2223 | |
| 2224 | Constructs a copy of the \a other style option. |
| 2225 | */ |
| 2226 | |
| 2227 | /*! |
| 2228 | \enum QStyleOptionDockWidget::StyleOptionType |
| 2229 | |
| 2230 | This enum is used to hold information about the type of the style option, and |
| 2231 | is defined for each QStyleOption subclass. |
| 2232 | |
| 2233 | \value Type The type of style option provided (\l{SO_DockWidget} for this class). |
| 2234 | |
| 2235 | The type is used internally by QStyleOption, its subclasses, and |
| 2236 | qstyleoption_cast() to determine the type of style option. In |
| 2237 | general you do not need to worry about this unless you want to |
| 2238 | create your own QStyleOption subclass and your own styles. |
| 2239 | |
| 2240 | \sa StyleOptionVersion |
| 2241 | */ |
| 2242 | |
| 2243 | /*! |
| 2244 | \enum QStyleOptionDockWidget::StyleOptionVersion |
| 2245 | |
| 2246 | This enum is used to hold information about the version of the style option, and |
| 2247 | is defined for each QStyleOption subclass. |
| 2248 | |
| 2249 | \value Version 2 |
| 2250 | |
| 2251 | The version is used by QStyleOption subclasses to implement |
| 2252 | extensions without breaking compatibility. If you use |
| 2253 | qstyleoption_cast(), you normally do not need to check it. |
| 2254 | |
| 2255 | \sa StyleOptionType |
| 2256 | */ |
| 2257 | |
| 2258 | /*! |
| 2259 | \variable QStyleOptionDockWidget::title |
| 2260 | \brief the title of the dock window |
| 2261 | |
| 2262 | The default value is an empty string. |
| 2263 | */ |
| 2264 | |
| 2265 | /*! |
| 2266 | \variable QStyleOptionDockWidget::closable |
| 2267 | \brief whether the dock window is closable |
| 2268 | |
| 2269 | The default value is true. |
| 2270 | */ |
| 2271 | |
| 2272 | /*! |
| 2273 | \variable QStyleOptionDockWidget::movable |
| 2274 | \brief whether the dock window is movable |
| 2275 | |
| 2276 | The default value is false. |
| 2277 | */ |
| 2278 | |
| 2279 | /*! |
| 2280 | \variable QStyleOptionDockWidget::floatable |
| 2281 | \brief whether the dock window is floatable |
| 2282 | |
| 2283 | The default value is true. |
| 2284 | */ |
| 2285 | |
| 2286 | /*! |
| 2287 | \class QStyleOptionToolButton |
| 2288 | \brief The QStyleOptionToolButton class is used to describe the |
| 2289 | parameters for drawing a tool button. |
| 2290 | |
| 2291 | \inmodule QtWidgets |
| 2292 | |
| 2293 | QStyleOptionToolButton contains all the information that QStyle |
| 2294 | functions need to draw QToolButton. |
| 2295 | |
| 2296 | For performance reasons, there are few member functions and the |
| 2297 | access to the member variables is direct (i.e., using the \c . or |
| 2298 | \c -> operator). This makes the structures straightforward to use |
| 2299 | and emphasizes that these are simply parameters used by the style |
| 2300 | functions. |
| 2301 | |
| 2302 | \sa QStyleOption, QStyleOptionComplex, QStyleOptionButton |
| 2303 | */ |
| 2304 | |
| 2305 | /*! |
| 2306 | \enum QStyleOptionToolButton::ToolButtonFeature |
| 2307 | Describes the various features that a tool button can have. |
| 2308 | |
| 2309 | \value None A normal tool button. |
| 2310 | \value Arrow The tool button is an arrow. |
| 2311 | \value Menu The tool button has a menu. |
| 2312 | \value PopupDelay There is a delay to showing the menu. |
| 2313 | \value HasMenu The button has a popup menu. |
| 2314 | \value MenuButtonPopup The button should display an arrow to |
| 2315 | indicate that a menu is present. |
| 2316 | |
| 2317 | \sa features, QToolButton::toolButtonStyle(), QToolButton::popupMode() |
| 2318 | */ |
| 2319 | |
| 2320 | /*! |
| 2321 | Constructs a QStyleOptionToolButton, initializing the members |
| 2322 | variables to their default values. |
| 2323 | */ |
| 2324 | |
| 2325 | QStyleOptionToolButton::QStyleOptionToolButton() |
| 2326 | : QStyleOptionToolButton(Version) |
| 2327 | { |
| 2328 | } |
| 2329 | |
| 2330 | /*! |
| 2331 | \internal |
| 2332 | */ |
| 2333 | QStyleOptionToolButton::QStyleOptionToolButton(int version) |
| 2334 | : QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow) |
| 2335 | , toolButtonStyle(Qt::ToolButtonIconOnly) |
| 2336 | |
| 2337 | { |
| 2338 | } |
| 2339 | |
| 2340 | /*! |
| 2341 | \fn QStyleOptionToolButton::QStyleOptionToolButton(const QStyleOptionToolButton &other) |
| 2342 | |
| 2343 | Constructs a copy of the \a other style option. |
| 2344 | */ |
| 2345 | |
| 2346 | /*! |
| 2347 | \enum QStyleOptionToolButton::StyleOptionType |
| 2348 | |
| 2349 | This enum is used to hold information about the type of the style option, and |
| 2350 | is defined for each QStyleOption subclass. |
| 2351 | |
| 2352 | \value Type The type of style option provided (\l{SO_ToolButton} for this class). |
| 2353 | |
| 2354 | The type is used internally by QStyleOption, its subclasses, and |
| 2355 | qstyleoption_cast() to determine the type of style option. In |
| 2356 | general you do not need to worry about this unless you want to |
| 2357 | create your own QStyleOption subclass and your own styles. |
| 2358 | |
| 2359 | \sa StyleOptionVersion |
| 2360 | */ |
| 2361 | |
| 2362 | /*! |
| 2363 | \enum QStyleOptionToolButton::StyleOptionVersion |
| 2364 | |
| 2365 | This enum is used to hold information about the version of the style option, and |
| 2366 | is defined for each QStyleOption subclass. |
| 2367 | |
| 2368 | \value Version 1 |
| 2369 | |
| 2370 | The version is used by QStyleOption subclasses to implement |
| 2371 | extensions without breaking compatibility. If you use |
| 2372 | qstyleoption_cast(), you normally do not need to check it. |
| 2373 | |
| 2374 | \sa StyleOptionType |
| 2375 | */ |
| 2376 | |
| 2377 | /*! |
| 2378 | \variable QStyleOptionToolButton::features |
| 2379 | \brief an OR combination of the tool button's features |
| 2380 | |
| 2381 | The default value is \l None. |
| 2382 | |
| 2383 | \sa ToolButtonFeature |
| 2384 | */ |
| 2385 | |
| 2386 | /*! |
| 2387 | \variable QStyleOptionToolButton::icon |
| 2388 | \brief the icon for the tool button |
| 2389 | |
| 2390 | The default value is an empty icon, i.e. an icon with neither a |
| 2391 | pixmap nor a filename. |
| 2392 | |
| 2393 | \sa iconSize |
| 2394 | */ |
| 2395 | |
| 2396 | /*! |
| 2397 | \variable QStyleOptionToolButton::iconSize |
| 2398 | \brief the size of the icon for the tool button |
| 2399 | |
| 2400 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 2401 | */ |
| 2402 | |
| 2403 | /*! |
| 2404 | \variable QStyleOptionToolButton::text |
| 2405 | \brief the text of the tool button |
| 2406 | |
| 2407 | This value is only used if toolButtonStyle is |
| 2408 | Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or |
| 2409 | Qt::ToolButtonTextOnly. The default value is an empty string. |
| 2410 | */ |
| 2411 | |
| 2412 | /*! |
| 2413 | \variable QStyleOptionToolButton::arrowType |
| 2414 | \brief the direction of the arrow for the tool button |
| 2415 | |
| 2416 | This value is only used if \l features includes \l Arrow. The |
| 2417 | default value is Qt::DownArrow. |
| 2418 | */ |
| 2419 | |
| 2420 | /*! |
| 2421 | \variable QStyleOptionToolButton::toolButtonStyle |
| 2422 | \brief a Qt::ToolButtonStyle value describing the appearance of |
| 2423 | the tool button |
| 2424 | |
| 2425 | The default value is Qt::ToolButtonIconOnly. |
| 2426 | |
| 2427 | \sa QToolButton::toolButtonStyle() |
| 2428 | */ |
| 2429 | |
| 2430 | /*! |
| 2431 | \variable QStyleOptionToolButton::pos |
| 2432 | \brief the position of the tool button |
| 2433 | |
| 2434 | The default value is a null point, i.e. (0, 0) |
| 2435 | */ |
| 2436 | |
| 2437 | /*! |
| 2438 | \variable QStyleOptionToolButton::font |
| 2439 | \brief the font that is used for the text |
| 2440 | |
| 2441 | This value is only used if toolButtonStyle is |
| 2442 | Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or |
| 2443 | Qt::ToolButtonTextOnly. By default, the application's default font |
| 2444 | is used. |
| 2445 | */ |
| 2446 | |
| 2447 | /*! |
| 2448 | \class QStyleOptionComboBox |
| 2449 | \brief The QStyleOptionComboBox class is used to describe the |
| 2450 | parameter for drawing a combobox. |
| 2451 | |
| 2452 | \inmodule QtWidgets |
| 2453 | |
| 2454 | QStyleOptionButton contains all the information that QStyle |
| 2455 | functions need to draw QComboBox. |
| 2456 | |
| 2457 | For performance reasons, there are few member functions and the |
| 2458 | access to the member variables is direct (i.e., using the \c . or |
| 2459 | \c -> operator). This makes the structures straightforward to use |
| 2460 | and emphasizes that these are simply parameters used by the style |
| 2461 | functions. |
| 2462 | |
| 2463 | \sa QStyleOption, QStyleOptionComplex, QComboBox |
| 2464 | */ |
| 2465 | |
| 2466 | /*! |
| 2467 | Creates a QStyleOptionComboBox, initializing the members variables |
| 2468 | to their default values. |
| 2469 | */ |
| 2470 | |
| 2471 | QStyleOptionComboBox::QStyleOptionComboBox() |
| 2472 | : QStyleOptionComboBox(Version) |
| 2473 | { |
| 2474 | } |
| 2475 | |
| 2476 | /*! |
| 2477 | \internal |
| 2478 | */ |
| 2479 | QStyleOptionComboBox::QStyleOptionComboBox(int version) |
| 2480 | : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true) |
| 2481 | { |
| 2482 | } |
| 2483 | |
| 2484 | /*! |
| 2485 | \fn QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other) |
| 2486 | |
| 2487 | Constructs a copy of the \a other style option. |
| 2488 | */ |
| 2489 | |
| 2490 | /*! |
| 2491 | \enum QStyleOptionComboBox::StyleOptionType |
| 2492 | |
| 2493 | This enum is used to hold information about the type of the style option, and |
| 2494 | is defined for each QStyleOption subclass. |
| 2495 | |
| 2496 | \value Type The type of style option provided (\l{SO_ComboBox} for this class). |
| 2497 | |
| 2498 | The type is used internally by QStyleOption, its subclasses, and |
| 2499 | qstyleoption_cast() to determine the type of style option. In |
| 2500 | general you do not need to worry about this unless you want to |
| 2501 | create your own QStyleOption subclass and your own styles. |
| 2502 | |
| 2503 | \sa StyleOptionVersion |
| 2504 | */ |
| 2505 | |
| 2506 | /*! |
| 2507 | \enum QStyleOptionComboBox::StyleOptionVersion |
| 2508 | |
| 2509 | This enum is used to hold information about the version of the style option, and |
| 2510 | is defined for each QStyleOption subclass. |
| 2511 | |
| 2512 | \value Version 2 |
| 2513 | |
| 2514 | The version is used by QStyleOption subclasses to implement |
| 2515 | extensions without breaking compatibility. If you use |
| 2516 | qstyleoption_cast(), you normally do not need to check it. |
| 2517 | |
| 2518 | \sa StyleOptionType |
| 2519 | */ |
| 2520 | |
| 2521 | /*! |
| 2522 | \variable QStyleOptionComboBox::editable |
| 2523 | \brief whether or not the combobox is editable or not |
| 2524 | |
| 2525 | the default |
| 2526 | value is false |
| 2527 | |
| 2528 | \sa QComboBox::isEditable() |
| 2529 | */ |
| 2530 | |
| 2531 | |
| 2532 | /*! |
| 2533 | \variable QStyleOptionComboBox::frame |
| 2534 | \brief whether the combo box has a frame |
| 2535 | |
| 2536 | The default value is true. |
| 2537 | */ |
| 2538 | |
| 2539 | /*! |
| 2540 | \variable QStyleOptionComboBox::currentText |
| 2541 | \brief the text for the current item of the combo box |
| 2542 | |
| 2543 | The default value is an empty string. |
| 2544 | */ |
| 2545 | |
| 2546 | /*! |
| 2547 | \variable QStyleOptionComboBox::currentIcon |
| 2548 | \brief the icon for the current item of the combo box |
| 2549 | |
| 2550 | The default value is an empty icon, i.e. an icon with neither a |
| 2551 | pixmap nor a filename. |
| 2552 | */ |
| 2553 | |
| 2554 | /*! |
| 2555 | \variable QStyleOptionComboBox::iconSize |
| 2556 | \brief the icon size for the current item of the combo box |
| 2557 | |
| 2558 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 2559 | */ |
| 2560 | |
| 2561 | /*! |
| 2562 | \variable QStyleOptionComboBox::popupRect |
| 2563 | \brief the popup rectangle for the combobox |
| 2564 | |
| 2565 | The default value is a null rectangle, i.e. a rectangle with both |
| 2566 | the width and the height set to 0. |
| 2567 | |
| 2568 | This variable is currently unused. You can safely ignore it. |
| 2569 | |
| 2570 | \sa QStyle::SC_ComboBoxListBoxPopup |
| 2571 | */ |
| 2572 | |
| 2573 | /*! |
| 2574 | \variable QStyleOptionComboBox::textAlignment |
| 2575 | \brief the alignment of the current text in the combo box |
| 2576 | |
| 2577 | The default value is Qt::AlignLeft | Qt::AlignVCenter. |
| 2578 | */ |
| 2579 | |
| 2580 | /*! |
| 2581 | \class QStyleOptionToolBox |
| 2582 | \brief The QStyleOptionToolBox class is used to describe the |
| 2583 | parameters needed for drawing a tool box. |
| 2584 | |
| 2585 | \inmodule QtWidgets |
| 2586 | |
| 2587 | QStyleOptionToolBox contains all the information that QStyle |
| 2588 | functions need to draw QToolBox. |
| 2589 | |
| 2590 | For performance reasons, there are few member functions and the |
| 2591 | access to the member variables is direct (i.e., using the \c . or |
| 2592 | \c -> operator). This makes the structures straightforward to use |
| 2593 | and emphasizes that these are simply parameters used by the style |
| 2594 | functions. |
| 2595 | |
| 2596 | \sa QStyleOption, QToolBox |
| 2597 | */ |
| 2598 | |
| 2599 | /*! |
| 2600 | Creates a QStyleOptionToolBox, initializing the members variables |
| 2601 | to their default values. |
| 2602 | */ |
| 2603 | |
| 2604 | QStyleOptionToolBox::QStyleOptionToolBox() |
| 2605 | : QStyleOptionToolBox(Version) |
| 2606 | { |
| 2607 | } |
| 2608 | |
| 2609 | /*! |
| 2610 | \internal |
| 2611 | */ |
| 2612 | QStyleOptionToolBox::QStyleOptionToolBox(int version) |
| 2613 | : QStyleOption(version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent) |
| 2614 | { |
| 2615 | } |
| 2616 | |
| 2617 | /*! |
| 2618 | \fn QStyleOptionToolBox::QStyleOptionToolBox(const QStyleOptionToolBox &other) |
| 2619 | |
| 2620 | Constructs a copy of the \a other style option. |
| 2621 | */ |
| 2622 | |
| 2623 | /*! |
| 2624 | \enum QStyleOptionToolBox::StyleOptionType |
| 2625 | |
| 2626 | This enum is used to hold information about the type of the style option, and |
| 2627 | is defined for each QStyleOption subclass. |
| 2628 | |
| 2629 | \value Type The type of style option provided (\l{SO_ToolBox} for this class). |
| 2630 | |
| 2631 | The type is used internally by QStyleOption, its subclasses, and |
| 2632 | qstyleoption_cast() to determine the type of style option. In |
| 2633 | general you do not need to worry about this unless you want to |
| 2634 | create your own QStyleOption subclass and your own styles. |
| 2635 | |
| 2636 | \sa StyleOptionVersion |
| 2637 | */ |
| 2638 | |
| 2639 | /*! |
| 2640 | \enum QStyleOptionToolBox::StyleOptionVersion |
| 2641 | |
| 2642 | This enum is used to hold information about the version of the style option, and |
| 2643 | is defined for each QStyleOption subclass. |
| 2644 | |
| 2645 | \value Version 2 |
| 2646 | |
| 2647 | The version is used by QStyleOption subclasses to implement |
| 2648 | extensions without breaking compatibility. If you use |
| 2649 | qstyleoption_cast(), you normally do not need to check it. |
| 2650 | |
| 2651 | \sa StyleOptionType |
| 2652 | */ |
| 2653 | |
| 2654 | /*! |
| 2655 | \variable QStyleOptionToolBox::icon |
| 2656 | \brief the icon for the tool box tab |
| 2657 | |
| 2658 | The default value is an empty icon, i.e. an icon with neither a |
| 2659 | pixmap nor a filename. |
| 2660 | */ |
| 2661 | |
| 2662 | /*! |
| 2663 | \variable QStyleOptionToolBox::text |
| 2664 | \brief the text for the tool box tab |
| 2665 | |
| 2666 | The default value is an empty string. |
| 2667 | */ |
| 2668 | |
| 2669 | /*! |
| 2670 | \enum QStyleOptionToolBox::SelectedPosition |
| 2671 | |
| 2672 | This enum describes the position of the selected tab. Some styles |
| 2673 | need to draw a tab differently depending on whether or not it is |
| 2674 | adjacent to the selected tab. |
| 2675 | |
| 2676 | \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab). |
| 2677 | \value NextIsSelected The next tab (typically the tab on the right) is selected. |
| 2678 | \value PreviousIsSelected The previous tab (typically the tab on the left) is selected. |
| 2679 | |
| 2680 | \sa selectedPosition |
| 2681 | */ |
| 2682 | |
| 2683 | /*! |
| 2684 | \enum QStyleOptionToolBox::TabPosition |
| 2685 | |
| 2686 | This enum describes tab positions relative to other tabs. |
| 2687 | |
| 2688 | \value Beginning The tab is the first (i.e., top-most) tab in |
| 2689 | the toolbox. |
| 2690 | \value Middle The tab is placed in the middle of the toolbox. |
| 2691 | \value End The tab is placed at the bottom of the toolbox. |
| 2692 | \value OnlyOneTab There is only one tab in the toolbox. |
| 2693 | */ |
| 2694 | |
| 2695 | /*! |
| 2696 | \variable QStyleOptionToolBox::selectedPosition |
| 2697 | \brief the position of the selected tab in relation to this tab |
| 2698 | |
| 2699 | The default value is NotAdjacent, i.e. the tab is not adjacent to |
| 2700 | a selected tab nor is it the selected tab. |
| 2701 | */ |
| 2702 | |
| 2703 | #if QT_CONFIG(rubberband) |
| 2704 | /*! |
| 2705 | \class QStyleOptionRubberBand |
| 2706 | \brief The QStyleOptionRubberBand class is used to describe the |
| 2707 | parameters needed for drawing a rubber band. |
| 2708 | |
| 2709 | \inmodule QtWidgets |
| 2710 | |
| 2711 | QStyleOptionRubberBand contains all the information that |
| 2712 | QStyle functions need to draw QRubberBand. |
| 2713 | |
| 2714 | For performance reasons, there are few member functions and the |
| 2715 | access to the member variables is direct (i.e., using the \c . or |
| 2716 | \c -> operator). This makes the structures straightforward to use |
| 2717 | and emphasizes that these are simply parameters used by the style |
| 2718 | functions. |
| 2719 | |
| 2720 | \sa QStyleOption, QRubberBand |
| 2721 | */ |
| 2722 | |
| 2723 | /*! |
| 2724 | Creates a QStyleOptionRubberBand, initializing the members |
| 2725 | variables to their default values. |
| 2726 | */ |
| 2727 | |
| 2728 | QStyleOptionRubberBand::QStyleOptionRubberBand() |
| 2729 | : QStyleOptionRubberBand(Version) |
| 2730 | { |
| 2731 | } |
| 2732 | |
| 2733 | /*! |
| 2734 | \internal |
| 2735 | */ |
| 2736 | QStyleOptionRubberBand::QStyleOptionRubberBand(int version) |
| 2737 | : QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false) |
| 2738 | { |
| 2739 | } |
| 2740 | |
| 2741 | /*! |
| 2742 | \fn QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other) |
| 2743 | |
| 2744 | Constructs a copy of the \a other style option. |
| 2745 | */ |
| 2746 | |
| 2747 | /*! |
| 2748 | \enum QStyleOptionRubberBand::StyleOptionType |
| 2749 | |
| 2750 | This enum is used to hold information about the type of the style option, and |
| 2751 | is defined for each QStyleOption subclass. |
| 2752 | |
| 2753 | \value Type The type of style option provided (\l{SO_RubberBand} for this class). |
| 2754 | |
| 2755 | The type is used internally by QStyleOption, its subclasses, and |
| 2756 | qstyleoption_cast() to determine the type of style option. In |
| 2757 | general you do not need to worry about this unless you want to |
| 2758 | create your own QStyleOption subclass and your own styles. |
| 2759 | |
| 2760 | \sa StyleOptionVersion |
| 2761 | */ |
| 2762 | |
| 2763 | /*! |
| 2764 | \enum QStyleOptionRubberBand::StyleOptionVersion |
| 2765 | |
| 2766 | This enum is used to hold information about the version of the style option, and |
| 2767 | is defined for each QStyleOption subclass. |
| 2768 | |
| 2769 | \value Version 1 |
| 2770 | |
| 2771 | The version is used by QStyleOption subclasses to implement |
| 2772 | extensions without breaking compatibility. If you use |
| 2773 | qstyleoption_cast(), you normally do not need to check it. |
| 2774 | |
| 2775 | \sa StyleOptionType |
| 2776 | */ |
| 2777 | |
| 2778 | /*! |
| 2779 | \variable QStyleOptionRubberBand::shape |
| 2780 | \brief the shape of the rubber band |
| 2781 | |
| 2782 | The default shape is QRubberBand::Line. |
| 2783 | */ |
| 2784 | |
| 2785 | /*! |
| 2786 | \variable QStyleOptionRubberBand::opaque |
| 2787 | \brief whether the rubber band is required to be drawn in an opaque style |
| 2788 | |
| 2789 | The default value is true. |
| 2790 | */ |
| 2791 | #endif // QT_CONFIG(rubberband) |
| 2792 | |
| 2793 | /*! |
| 2794 | \class QStyleOptionTitleBar |
| 2795 | \brief The QStyleOptionTitleBar class is used to describe the |
| 2796 | parameters for drawing a title bar. |
| 2797 | |
| 2798 | \inmodule QtWidgets |
| 2799 | |
| 2800 | QStyleOptionTitleBar contains all the information that QStyle |
| 2801 | functions need to draw the title bar of a QMdiSubWindow. |
| 2802 | |
| 2803 | For performance reasons, there are few member functions and the |
| 2804 | access to the member variables is direct (i.e., using the \c . or |
| 2805 | \c -> operator). This makes the structures straightforward to use |
| 2806 | and emphasizes that these are simply parameters used by the style |
| 2807 | functions. |
| 2808 | |
| 2809 | \sa QStyleOption, QStyleOptionComplex, QMdiSubWindow |
| 2810 | */ |
| 2811 | |
| 2812 | /*! |
| 2813 | Constructs a QStyleOptionTitleBar, initializing the members |
| 2814 | variables to their default values. |
| 2815 | */ |
| 2816 | |
| 2817 | QStyleOptionTitleBar::QStyleOptionTitleBar() |
| 2818 | : QStyleOptionTitleBar(Version) |
| 2819 | { |
| 2820 | } |
| 2821 | |
| 2822 | /*! |
| 2823 | \fn QStyleOptionTitleBar::QStyleOptionTitleBar(const QStyleOptionTitleBar &other) |
| 2824 | |
| 2825 | Constructs a copy of the \a other style option. |
| 2826 | */ |
| 2827 | |
| 2828 | /*! |
| 2829 | \enum QStyleOptionTitleBar::StyleOptionType |
| 2830 | |
| 2831 | This enum is used to hold information about the type of the style option, and |
| 2832 | is defined for each QStyleOption subclass. |
| 2833 | |
| 2834 | \value Type The type of style option provided (\l{SO_TitleBar} for this class). |
| 2835 | |
| 2836 | The type is used internally by QStyleOption, its subclasses, and |
| 2837 | qstyleoption_cast() to determine the type of style option. In |
| 2838 | general you do not need to worry about this unless you want to |
| 2839 | create your own QStyleOption subclass and your own styles. |
| 2840 | |
| 2841 | \sa StyleOptionVersion |
| 2842 | */ |
| 2843 | |
| 2844 | /*! |
| 2845 | \enum QStyleOptionTitleBar::StyleOptionVersion |
| 2846 | |
| 2847 | This enum is used to hold information about the version of the style option, and |
| 2848 | is defined for each QStyleOption subclass. |
| 2849 | |
| 2850 | \value Version 1 |
| 2851 | |
| 2852 | The version is used by QStyleOption subclasses to implement |
| 2853 | extensions without breaking compatibility. If you use |
| 2854 | qstyleoption_cast(), you normally do not need to check it. |
| 2855 | |
| 2856 | \sa StyleOptionType |
| 2857 | */ |
| 2858 | |
| 2859 | /*! |
| 2860 | \internal |
| 2861 | */ |
| 2862 | QStyleOptionTitleBar::QStyleOptionTitleBar(int version) |
| 2863 | : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0) |
| 2864 | { |
| 2865 | } |
| 2866 | |
| 2867 | |
| 2868 | /*! |
| 2869 | \variable QStyleOptionTitleBar::text |
| 2870 | \brief the text of the title bar |
| 2871 | |
| 2872 | The default value is an empty string. |
| 2873 | */ |
| 2874 | |
| 2875 | /*! |
| 2876 | \variable QStyleOptionTitleBar::icon |
| 2877 | \brief the icon for the title bar |
| 2878 | |
| 2879 | The default value is an empty icon, i.e. an icon with neither a |
| 2880 | pixmap nor a filename. |
| 2881 | */ |
| 2882 | |
| 2883 | /*! |
| 2884 | \variable QStyleOptionTitleBar::titleBarState |
| 2885 | \brief the state of the title bar |
| 2886 | |
| 2887 | This is basically the window state of the underlying widget. The |
| 2888 | default value is 0. |
| 2889 | |
| 2890 | \sa QWidget::windowState() |
| 2891 | */ |
| 2892 | |
| 2893 | /*! |
| 2894 | \variable QStyleOptionTitleBar::titleBarFlags |
| 2895 | \brief the widget flags for the title bar |
| 2896 | |
| 2897 | The default value is Qt::Widget. |
| 2898 | |
| 2899 | \sa Qt::WindowFlags |
| 2900 | */ |
| 2901 | |
| 2902 | #if QT_CONFIG(itemviews) |
| 2903 | /*! |
| 2904 | \class QStyleOptionViewItem |
| 2905 | \brief The QStyleOptionViewItem class is used to describe the |
| 2906 | parameters used to draw an item in a view widget. |
| 2907 | |
| 2908 | \inmodule QtWidgets |
| 2909 | |
| 2910 | QStyleOptionViewItem contains all the information that QStyle |
| 2911 | functions need to draw the items for Qt's model/view classes. |
| 2912 | |
| 2913 | For performance reasons, there are few member functions and the |
| 2914 | access to the member variables is direct (i.e., using the \c . or |
| 2915 | \c -> operator). This makes the structures straightforward to use |
| 2916 | and emphasizes that these are simply parameters used by the style |
| 2917 | functions. |
| 2918 | |
| 2919 | \sa QStyleOption, {model-view-programming.html}{Model/View |
| 2920 | Programming} |
| 2921 | */ |
| 2922 | |
| 2923 | /*! |
| 2924 | \enum QStyleOptionViewItem::Position |
| 2925 | |
| 2926 | This enum describes the position of the item's decoration. |
| 2927 | |
| 2928 | \value Left On the left of the text. |
| 2929 | \value Right On the right of the text. |
| 2930 | \value Top Above the text. |
| 2931 | \value Bottom Below the text. |
| 2932 | |
| 2933 | \sa decorationPosition |
| 2934 | */ |
| 2935 | |
| 2936 | /*! |
| 2937 | \variable QStyleOptionViewItem::showDecorationSelected |
| 2938 | \brief whether the decoration should be highlighted on selected |
| 2939 | items |
| 2940 | |
| 2941 | If this option is true, the branch and any decorations on selected items |
| 2942 | should be highlighted, indicating that the item is selected; otherwise, no |
| 2943 | highlighting is required. The default value is false. |
| 2944 | |
| 2945 | \sa QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView |
| 2946 | */ |
| 2947 | |
| 2948 | /*! |
| 2949 | \variable QStyleOptionViewItem::locale |
| 2950 | \brief the locale to use for displaying text, numbers and dates. |
| 2951 | |
| 2952 | This allows the style to display e.g. dates in a different locale than |
| 2953 | the default locale of the application. |
| 2954 | */ |
| 2955 | |
| 2956 | /*! |
| 2957 | \variable QStyleOptionViewItem::widget |
| 2958 | \brief the parent widget of the item |
| 2959 | |
| 2960 | This member contains the parent widget (itemview) of the item to |
| 2961 | be able to e.g. access some properties within the QStyledItemDelegate |
| 2962 | methods. |
| 2963 | */ |
| 2964 | |
| 2965 | /*! |
| 2966 | \variable QStyleOptionViewItem::textElideMode |
| 2967 | \brief where ellipsis should be added for text that is too long to fit |
| 2968 | into an item |
| 2969 | |
| 2970 | The default value is Qt::ElideMiddle, i.e. the ellipsis appears in |
| 2971 | the middle of the text. |
| 2972 | |
| 2973 | \sa Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation |
| 2974 | */ |
| 2975 | |
| 2976 | /*! |
| 2977 | Constructs a QStyleOptionViewItem, initializing the members |
| 2978 | variables to their default values. |
| 2979 | */ |
| 2980 | |
| 2981 | QStyleOptionViewItem::QStyleOptionViewItem() |
| 2982 | : QStyleOptionViewItem(Version) |
| 2983 | { |
| 2984 | } |
| 2985 | |
| 2986 | /*! |
| 2987 | \internal |
| 2988 | */ |
| 2989 | QStyleOptionViewItem::QStyleOptionViewItem(int version) |
| 2990 | : QStyleOption(version, SO_ViewItem), |
| 2991 | displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft), |
| 2992 | textElideMode(Qt::ElideMiddle), decorationPosition(Left), |
| 2993 | showDecorationSelected(false), features(None), widget(nullptr), |
| 2994 | checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid) |
| 2995 | { |
| 2996 | } |
| 2997 | |
| 2998 | /*! |
| 2999 | \fn QStyleOptionViewItem::QStyleOptionViewItem(const QStyleOptionViewItem &other) |
| 3000 | |
| 3001 | Constructs a copy of the \a other style option. |
| 3002 | */ |
| 3003 | |
| 3004 | /*! |
| 3005 | \enum QStyleOptionViewItem::StyleOptionType |
| 3006 | |
| 3007 | This enum is used to hold information about the type of the style option, and |
| 3008 | is defined for each QStyleOption subclass. |
| 3009 | |
| 3010 | \value Type The type of style option provided (\l{SO_ViewItem} for this class). |
| 3011 | |
| 3012 | The type is used internally by QStyleOption, its subclasses, and |
| 3013 | qstyleoption_cast() to determine the type of style option. In |
| 3014 | general you do not need to worry about this unless you want to |
| 3015 | create your own QStyleOption subclass and your own styles. |
| 3016 | |
| 3017 | \sa StyleOptionVersion |
| 3018 | */ |
| 3019 | |
| 3020 | /*! |
| 3021 | \enum QStyleOptionViewItem::StyleOptionVersion |
| 3022 | |
| 3023 | This enum is used to hold information about the version of the style option, and |
| 3024 | is defined for each QStyleOption subclass. |
| 3025 | |
| 3026 | \value Version 4 |
| 3027 | |
| 3028 | The version is used by QStyleOption subclasses to implement |
| 3029 | extensions without breaking compatibility. If you use |
| 3030 | qstyleoption_cast(), you normally do not need to check it. |
| 3031 | |
| 3032 | \sa StyleOptionType |
| 3033 | */ |
| 3034 | |
| 3035 | /*! |
| 3036 | \variable QStyleOptionViewItem::displayAlignment |
| 3037 | \brief the alignment of the display value for the item |
| 3038 | |
| 3039 | The default value is Qt::AlignLeft. |
| 3040 | */ |
| 3041 | |
| 3042 | /*! |
| 3043 | \variable QStyleOptionViewItem::decorationAlignment |
| 3044 | \brief the alignment of the decoration for the item |
| 3045 | |
| 3046 | The default value is Qt::AlignLeft. |
| 3047 | */ |
| 3048 | |
| 3049 | /*! |
| 3050 | \variable QStyleOptionViewItem::decorationPosition |
| 3051 | \brief the position of the decoration for the item |
| 3052 | |
| 3053 | The default value is \l Left. |
| 3054 | |
| 3055 | \sa Position |
| 3056 | */ |
| 3057 | |
| 3058 | /*! |
| 3059 | \variable QStyleOptionViewItem::decorationSize |
| 3060 | \brief the size of the decoration for the item |
| 3061 | |
| 3062 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 3063 | |
| 3064 | \sa decorationAlignment, decorationPosition |
| 3065 | */ |
| 3066 | |
| 3067 | /*! |
| 3068 | \variable QStyleOptionViewItem::font |
| 3069 | \brief the font used for the item |
| 3070 | |
| 3071 | By default, the application's default font is used. |
| 3072 | |
| 3073 | \sa QFont |
| 3074 | */ |
| 3075 | |
| 3076 | /*! |
| 3077 | \variable QStyleOptionViewItem::features |
| 3078 | \brief a bitwise OR of the features that describe this view item |
| 3079 | |
| 3080 | \sa ViewItemFeature |
| 3081 | */ |
| 3082 | |
| 3083 | /*! |
| 3084 | \enum QStyleOptionViewItem::ViewItemFeature |
| 3085 | |
| 3086 | This enum describes the different types of features an item can have. |
| 3087 | |
| 3088 | \value None Indicates a normal item. |
| 3089 | \value WrapText Indicates an item with wrapped text. |
| 3090 | \value Alternate Indicates that the item's background is rendered using alternateBase. |
| 3091 | \value HasCheckIndicator Indicates that the item has a check state indicator. |
| 3092 | \value HasDisplay Indicates that the item has a display role. |
| 3093 | \value HasDecoration Indicates that the item has a decoration role. |
| 3094 | */ |
| 3095 | |
| 3096 | /*! |
| 3097 | \variable QStyleOptionViewItem::index |
| 3098 | |
| 3099 | The model index that is to be drawn. |
| 3100 | */ |
| 3101 | |
| 3102 | /*! |
| 3103 | \variable QStyleOptionViewItem::checkState |
| 3104 | |
| 3105 | If this view item is checkable, i.e., |
| 3106 | ViewItemFeature::HasCheckIndicator is true, \c checkState is true |
| 3107 | if the item is checked; otherwise, it is false. |
| 3108 | |
| 3109 | */ |
| 3110 | |
| 3111 | /*! |
| 3112 | \variable QStyleOptionViewItem::icon |
| 3113 | |
| 3114 | The icon (if any) to be drawn in the view item. |
| 3115 | */ |
| 3116 | |
| 3117 | |
| 3118 | /*! |
| 3119 | \variable QStyleOptionViewItem::text |
| 3120 | |
| 3121 | The text (if any) to be drawn in the view item. |
| 3122 | */ |
| 3123 | |
| 3124 | /*! |
| 3125 | \variable QStyleOptionViewItem::backgroundBrush |
| 3126 | |
| 3127 | The QBrush that should be used to paint the view items |
| 3128 | background. |
| 3129 | */ |
| 3130 | |
| 3131 | /*! |
| 3132 | \variable QStyleOptionViewItem::viewItemPosition |
| 3133 | |
| 3134 | Gives the position of this view item relative to other items. See |
| 3135 | the \l{QStyleOptionViewItem::}{ViewItemPosition} enum for the |
| 3136 | details. |
| 3137 | */ |
| 3138 | |
| 3139 | /*! |
| 3140 | \enum QStyleOptionViewItem::ViewItemPosition |
| 3141 | |
| 3142 | This enum is used to represent the placement of the item on |
| 3143 | a row. This can be used to draw items differently depending |
| 3144 | on their placement, for example by putting rounded edges at |
| 3145 | the beginning and end, and straight edges in between. |
| 3146 | |
| 3147 | \value Invalid The ViewItemPosition is unknown and should be |
| 3148 | disregarded. |
| 3149 | \value Beginning The item appears at the beginning of the row. |
| 3150 | \value Middle The item appears in the middle of the row. |
| 3151 | \value End The item appears at the end of the row. |
| 3152 | \value OnlyOne The item is the only one on the row, and is |
| 3153 | therefore both at the beginning and the end. |
| 3154 | */ |
| 3155 | |
| 3156 | #endif // QT_CONFIG(itemviews) |
| 3157 | /*! |
| 3158 | \fn template <typename T> T qstyleoption_cast<T>(const QStyleOption *option) |
| 3159 | \relates QStyleOption |
| 3160 | |
| 3161 | Returns a T or \nullptr depending on the \l{QStyleOption::type}{type} and |
| 3162 | \l{QStyleOption::version}{version} of the given \a option. |
| 3163 | |
| 3164 | Example: |
| 3165 | |
| 3166 | \snippet qstyleoption/main.cpp 4 |
| 3167 | |
| 3168 | \sa QStyleOption::type, QStyleOption::version |
| 3169 | */ |
| 3170 | |
| 3171 | /*! |
| 3172 | \fn template <typename T> T qstyleoption_cast<T>(QStyleOption *option) |
| 3173 | \overload |
| 3174 | \relates QStyleOption |
| 3175 | |
| 3176 | Returns a T or \nullptr depending on the type of the given \a option. |
| 3177 | */ |
| 3178 | |
| 3179 | #if QT_CONFIG(tabwidget) |
| 3180 | /*! |
| 3181 | \class QStyleOptionTabWidgetFrame |
| 3182 | \brief The QStyleOptionTabWidgetFrame class is used to describe the |
| 3183 | parameters for drawing the frame around a tab widget. |
| 3184 | |
| 3185 | \inmodule QtWidgets |
| 3186 | |
| 3187 | QStyleOptionTabWidgetFrame contains all the information that |
| 3188 | QStyle functions need to draw the frame around QTabWidget. |
| 3189 | |
| 3190 | For performance reasons, there are few member functions and the |
| 3191 | access to the member variables is direct (i.e., using the \c . or |
| 3192 | \c -> operator). This makes the structures straightforward to use |
| 3193 | and emphasizes that these are simply parameters used by the style |
| 3194 | functions. |
| 3195 | |
| 3196 | \sa QStyleOption, QTabWidget |
| 3197 | */ |
| 3198 | |
| 3199 | /*! |
| 3200 | Constructs a QStyleOptionTabWidgetFrame, initializing the members |
| 3201 | variables to their default values. |
| 3202 | */ |
| 3203 | QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame() |
| 3204 | : QStyleOptionTabWidgetFrame(Version) |
| 3205 | { |
| 3206 | } |
| 3207 | |
| 3208 | /*! |
| 3209 | \fn QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other) |
| 3210 | |
| 3211 | Constructs a copy of \a other. |
| 3212 | */ |
| 3213 | |
| 3214 | /*! \internal */ |
| 3215 | QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version) |
| 3216 | : QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0), |
| 3217 | shape(QTabBar::RoundedNorth) |
| 3218 | { |
| 3219 | } |
| 3220 | |
| 3221 | /*! |
| 3222 | \enum QStyleOptionTabWidgetFrame::StyleOptionType |
| 3223 | |
| 3224 | This enum is used to hold information about the type of the style option, and |
| 3225 | is defined for each QStyleOption subclass. |
| 3226 | |
| 3227 | \value Type The type of style option provided (\l{SO_TabWidgetFrame} for this class). |
| 3228 | |
| 3229 | The type is used internally by QStyleOption, its subclasses, and |
| 3230 | qstyleoption_cast() to determine the type of style option. In |
| 3231 | general you do not need to worry about this unless you want to |
| 3232 | create your own QStyleOption subclass and your own styles. |
| 3233 | |
| 3234 | \sa StyleOptionVersion |
| 3235 | */ |
| 3236 | |
| 3237 | /*! |
| 3238 | \enum QStyleOptionTabWidgetFrame::StyleOptionVersion |
| 3239 | |
| 3240 | This enum is used to hold information about the version of the style option, and |
| 3241 | is defined for each QStyleOption subclass. |
| 3242 | |
| 3243 | \value Version 2 |
| 3244 | |
| 3245 | The version is used by QStyleOption subclasses to implement |
| 3246 | extensions without breaking compatibility. If you use |
| 3247 | qstyleoption_cast(), you normally do not need to check it. |
| 3248 | |
| 3249 | \sa StyleOptionType |
| 3250 | */ |
| 3251 | |
| 3252 | /*! |
| 3253 | \variable QStyleOptionTabWidgetFrame::lineWidth |
| 3254 | \brief the line width for drawing the panel |
| 3255 | |
| 3256 | The default value is 0. |
| 3257 | */ |
| 3258 | |
| 3259 | /*! |
| 3260 | \variable QStyleOptionTabWidgetFrame::midLineWidth |
| 3261 | \brief the mid-line width for drawing the panel |
| 3262 | |
| 3263 | The mid line width is usually used in drawing sunken or raised |
| 3264 | frames. The default value is 0. |
| 3265 | */ |
| 3266 | |
| 3267 | /*! |
| 3268 | \variable QStyleOptionTabWidgetFrame::shape |
| 3269 | \brief the tab shape used to draw the tabs |
| 3270 | |
| 3271 | The default value is QTabBar::RoundedNorth. |
| 3272 | */ |
| 3273 | |
| 3274 | /*! |
| 3275 | \variable QStyleOptionTabWidgetFrame::tabBarSize |
| 3276 | \brief the size of the tab bar |
| 3277 | |
| 3278 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 3279 | */ |
| 3280 | |
| 3281 | /*! |
| 3282 | \variable QStyleOptionTabWidgetFrame::rightCornerWidgetSize |
| 3283 | \brief the size of the right-corner widget |
| 3284 | |
| 3285 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 3286 | */ |
| 3287 | |
| 3288 | /*! \variable QStyleOptionTabWidgetFrame::leftCornerWidgetSize |
| 3289 | \brief the size of the left-corner widget |
| 3290 | |
| 3291 | The default value is QSize(-1, -1), i.e. an invalid size. |
| 3292 | */ |
| 3293 | |
| 3294 | |
| 3295 | /*! |
| 3296 | \variable QStyleOptionTabWidgetFrame::tabBarRect |
| 3297 | \brief the rectangle containing all the tabs |
| 3298 | |
| 3299 | The default value is a null rectangle, i.e. a rectangle with both |
| 3300 | the width and the height set to 0. |
| 3301 | */ |
| 3302 | |
| 3303 | /*! |
| 3304 | \variable QStyleOptionTabWidgetFrame::selectedTabRect |
| 3305 | \brief the rectangle containing the selected tab |
| 3306 | |
| 3307 | This rectangle is contained within the tabBarRect. The default |
| 3308 | value is a null rectangle, i.e. a rectangle with both the width |
| 3309 | and the height set to 0. |
| 3310 | */ |
| 3311 | |
| 3312 | #endif // QT_CONFIG(tabwidget) |
| 3313 | |
| 3314 | #if QT_CONFIG(tabbar) |
| 3315 | |
| 3316 | /*! |
| 3317 | \class QStyleOptionTabBarBase |
| 3318 | \brief The QStyleOptionTabBarBase class is used to describe |
| 3319 | the base of a tab bar, i.e. the part that the tab bar usually |
| 3320 | overlaps with. |
| 3321 | |
| 3322 | \inmodule QtWidgets |
| 3323 | |
| 3324 | QStyleOptionTabBarBase contains all the information that QStyle |
| 3325 | functions need to draw the tab bar base. Note that this is only |
| 3326 | drawn for a standalone QTabBar (one that isn't part of a |
| 3327 | QTabWidget). |
| 3328 | |
| 3329 | For performance reasons, there are few member functions and the |
| 3330 | access to the member variables is direct (i.e., using the \c . or |
| 3331 | \c -> operator). This makes the structures straightforward to use |
| 3332 | and emphasizes that these are simply parameters used by the style |
| 3333 | functions. |
| 3334 | |
| 3335 | \sa QStyleOption, QTabBar::drawBase() |
| 3336 | */ |
| 3337 | |
| 3338 | /*! |
| 3339 | Construct a QStyleOptionTabBarBase, initializing the members |
| 3340 | variables to their default values. |
| 3341 | */ |
| 3342 | QStyleOptionTabBarBase::QStyleOptionTabBarBase() |
| 3343 | : QStyleOptionTabBarBase(Version) |
| 3344 | { |
| 3345 | } |
| 3346 | |
| 3347 | /*! \internal */ |
| 3348 | QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version) |
| 3349 | : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth), |
| 3350 | documentMode(false) |
| 3351 | { |
| 3352 | } |
| 3353 | |
| 3354 | /*! |
| 3355 | \fn QStyleOptionTabBarBase::QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other) |
| 3356 | |
| 3357 | Constructs a copy of \a other. |
| 3358 | */ |
| 3359 | |
| 3360 | /*! |
| 3361 | \enum QStyleOptionTabBarBase::StyleOptionType |
| 3362 | |
| 3363 | This enum is used to hold information about the type of the style option, and |
| 3364 | is defined for each QStyleOption subclass. |
| 3365 | |
| 3366 | \value Type The type of style option provided (\l{SO_TabBarBase} for this class). |
| 3367 | |
| 3368 | The type is used internally by QStyleOption, its subclasses, and |
| 3369 | qstyleoption_cast() to determine the type of style option. In |
| 3370 | general you do not need to worry about this unless you want to |
| 3371 | create your own QStyleOption subclass and your own styles. |
| 3372 | |
| 3373 | \sa StyleOptionVersion |
| 3374 | */ |
| 3375 | |
| 3376 | /*! |
| 3377 | \enum QStyleOptionTabBarBase::StyleOptionVersion |
| 3378 | |
| 3379 | This enum is used to hold information about the version of the style option, and |
| 3380 | is defined for each QStyleOption subclass. |
| 3381 | |
| 3382 | \value Version 2 |
| 3383 | |
| 3384 | The version is used by QStyleOption subclasses to implement |
| 3385 | extensions without breaking compatibility. If you use |
| 3386 | qstyleoption_cast(), you normally do not need to check it. |
| 3387 | |
| 3388 | \sa StyleOptionType |
| 3389 | */ |
| 3390 | |
| 3391 | /*! |
| 3392 | \variable QStyleOptionTabBarBase::shape |
| 3393 | \brief the shape of the tab bar |
| 3394 | |
| 3395 | The default value is QTabBar::RoundedNorth. |
| 3396 | */ |
| 3397 | |
| 3398 | /*! |
| 3399 | \variable QStyleOptionTabBarBase::tabBarRect |
| 3400 | \brief the rectangle containing all the tabs |
| 3401 | |
| 3402 | The default value is a null rectangle, i.e. a rectangle with both |
| 3403 | the width and the height set to 0. |
| 3404 | */ |
| 3405 | |
| 3406 | /*! |
| 3407 | \variable QStyleOptionTabBarBase::selectedTabRect |
| 3408 | \brief the rectangle containing the selected tab |
| 3409 | |
| 3410 | This rectangle is contained within the tabBarRect. The default |
| 3411 | value is a null rectangle, i.e. a rectangle with both the width |
| 3412 | and the height set to 0. |
| 3413 | */ |
| 3414 | |
| 3415 | |
| 3416 | /*! |
| 3417 | \variable QStyleOptionTabBarBase::documentMode |
| 3418 | \brief whether the tabbar is in document mode. |
| 3419 | |
| 3420 | The default value is false; |
| 3421 | */ |
| 3422 | |
| 3423 | #endif // QT_CONFIG(tabbar) |
| 3424 | |
| 3425 | #if QT_CONFIG(sizegrip) |
| 3426 | /*! |
| 3427 | \class QStyleOptionSizeGrip |
| 3428 | \brief The QStyleOptionSizeGrip class is used to describe the |
| 3429 | parameter for drawing a size grip. |
| 3430 | \since 4.2 |
| 3431 | \inmodule QtWidgets |
| 3432 | |
| 3433 | QStyleOptionButton contains all the information that QStyle |
| 3434 | functions need to draw QSizeGrip. |
| 3435 | |
| 3436 | For performance reasons, there are few member functions and the |
| 3437 | access to the member variables is direct (i.e., using the \c . or |
| 3438 | \c -> operator). This makes the structures straightforward to use |
| 3439 | and emphasizes that these are simply parameters used by the style |
| 3440 | functions. |
| 3441 | |
| 3442 | \sa QStyleOption, QStyleOptionComplex, QSizeGrip |
| 3443 | */ |
| 3444 | |
| 3445 | /*! |
| 3446 | Constructs a QStyleOptionSizeGrip. |
| 3447 | */ |
| 3448 | QStyleOptionSizeGrip::QStyleOptionSizeGrip() |
| 3449 | : QStyleOptionSizeGrip(Version) |
| 3450 | { |
| 3451 | } |
| 3452 | |
| 3453 | /*! |
| 3454 | \fn QStyleOptionSizeGrip::QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) |
| 3455 | |
| 3456 | Constructs a copy of the \a other style option. |
| 3457 | */ |
| 3458 | |
| 3459 | /*! |
| 3460 | \internal |
| 3461 | */ |
| 3462 | QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version) |
| 3463 | : QStyleOptionComplex(version, Type), corner(Qt::BottomRightCorner) |
| 3464 | { |
| 3465 | } |
| 3466 | |
| 3467 | /*! |
| 3468 | \variable QStyleOptionSizeGrip::corner |
| 3469 | |
| 3470 | The corner in which the size grip is located. |
| 3471 | */ |
| 3472 | |
| 3473 | /*! |
| 3474 | \enum QStyleOptionSizeGrip::StyleOptionType |
| 3475 | |
| 3476 | This enum is used to hold information about the type of the style option, and |
| 3477 | is defined for each QStyleOption subclass. |
| 3478 | |
| 3479 | \value Type The type of style option provided (\l{SO_TabBarBase} for this class). |
| 3480 | |
| 3481 | The type is used internally by QStyleOption, its subclasses, and |
| 3482 | qstyleoption_cast() to determine the type of style option. In |
| 3483 | general you do not need to worry about this unless you want to |
| 3484 | create your own QStyleOption subclass and your own styles. |
| 3485 | |
| 3486 | \sa StyleOptionVersion |
| 3487 | */ |
| 3488 | |
| 3489 | /*! |
| 3490 | \enum QStyleOptionSizeGrip::StyleOptionVersion |
| 3491 | |
| 3492 | This enum is used to hold information about the version of the style option, and |
| 3493 | is defined for each QStyleOption subclass. |
| 3494 | |
| 3495 | \value Version 1 |
| 3496 | |
| 3497 | The version is used by QStyleOption subclasses to implement |
| 3498 | extensions without breaking compatibility. If you use |
| 3499 | qstyleoption_cast(), you normally do not need to check it. |
| 3500 | |
| 3501 | \sa StyleOptionType |
| 3502 | */ |
| 3503 | #endif // QT_CONFIG(sizegrip) |
| 3504 | |
| 3505 | /*! |
| 3506 | \class QStyleOptionGraphicsItem |
| 3507 | \brief The QStyleOptionGraphicsItem class is used to describe |
| 3508 | the parameters needed to draw a QGraphicsItem. |
| 3509 | \since 4.2 |
| 3510 | \ingroup graphicsview-api |
| 3511 | \inmodule QtWidgets |
| 3512 | |
| 3513 | For performance reasons, there are few member functions and the |
| 3514 | access to the member variables is direct (i.e., using the \c . or |
| 3515 | \c -> operator). This makes the structures straightforward to use |
| 3516 | and emphasizes that these are simply parameters used by the style |
| 3517 | functions. |
| 3518 | |
| 3519 | \sa QStyleOption, QGraphicsItem::paint() |
| 3520 | */ |
| 3521 | |
| 3522 | /*! |
| 3523 | \enum QStyleOptionGraphicsItem::StyleOptionType |
| 3524 | |
| 3525 | This enum is used to hold information about the type of the style option, and |
| 3526 | is defined for each QStyleOption subclass. |
| 3527 | |
| 3528 | \value Type The type of style option provided (\l SO_GraphicsItem for this class). |
| 3529 | |
| 3530 | The type is used internally by QStyleOption, its subclasses, and |
| 3531 | qstyleoption_cast() to determine the type of style option. In |
| 3532 | general you do not need to worry about this unless you want to |
| 3533 | create your own QStyleOption subclass and your own styles. |
| 3534 | |
| 3535 | \sa StyleOptionVersion |
| 3536 | */ |
| 3537 | |
| 3538 | /*! |
| 3539 | \enum QStyleOptionGraphicsItem::StyleOptionVersion |
| 3540 | |
| 3541 | This enum is used to hold information about the version of the style option, and |
| 3542 | is defined for each QStyleOption subclass. |
| 3543 | |
| 3544 | \value Version 1 |
| 3545 | |
| 3546 | The version is used by QStyleOption subclasses to implement |
| 3547 | extensions without breaking compatibility. If you use |
| 3548 | qstyleoption_cast(), you normally do not need to check it. |
| 3549 | |
| 3550 | \sa StyleOptionType |
| 3551 | */ |
| 3552 | |
| 3553 | /*! |
| 3554 | Constructs a QStyleOptionGraphicsItem. |
| 3555 | */ |
| 3556 | QStyleOptionGraphicsItem::QStyleOptionGraphicsItem() |
| 3557 | : QStyleOptionGraphicsItem(Version) |
| 3558 | { |
| 3559 | } |
| 3560 | |
| 3561 | /*! |
| 3562 | \internal |
| 3563 | */ |
| 3564 | QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version) |
| 3565 | : QStyleOption(version, Type) |
| 3566 | { |
| 3567 | } |
| 3568 | |
| 3569 | /*! |
| 3570 | \since 4.6 |
| 3571 | |
| 3572 | Returns the level of detail from the \a worldTransform. |
| 3573 | |
| 3574 | Its value represents the maximum value of the height and |
| 3575 | width of a unity rectangle, mapped using the \a worldTransform |
| 3576 | of the painter used to draw the item. By default, if no |
| 3577 | transformations are applied, its value is 1. If zoomed out 1:2, the level |
| 3578 | of detail will be 0.5, and if zoomed in 2:1, its value is 2. |
| 3579 | |
| 3580 | \sa QGraphicsScene::minimumRenderSize() |
| 3581 | */ |
| 3582 | qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform) |
| 3583 | { |
| 3584 | if (worldTransform.type() <= QTransform::TxTranslate) |
| 3585 | return 1; // Translation only? The LOD is 1. |
| 3586 | |
| 3587 | // Two unit vectors. |
| 3588 | QLineF v1(0, 0, 1, 0); |
| 3589 | QLineF v2(0, 0, 0, 1); |
| 3590 | // LOD is the transformed area of a 1x1 rectangle. |
| 3591 | return qSqrt(v: worldTransform.map(l: v1).length() * worldTransform.map(l: v2).length()); |
| 3592 | } |
| 3593 | |
| 3594 | /*! |
| 3595 | \fn QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) |
| 3596 | |
| 3597 | Constructs a copy of \a other. |
| 3598 | */ |
| 3599 | |
| 3600 | /*! |
| 3601 | \variable QStyleOptionGraphicsItem::exposedRect |
| 3602 | \brief the exposed rectangle, in item coordinates |
| 3603 | |
| 3604 | Make use of this rectangle to speed up item drawing when only parts of the |
| 3605 | item are exposed. If the whole item is exposed, this rectangle will be the |
| 3606 | same as QGraphicsItem::boundingRect(). |
| 3607 | |
| 3608 | This member is only initialized for items that have the |
| 3609 | QGraphicsItem::ItemUsesExtendedStyleOption flag set. |
| 3610 | */ |
| 3611 | |
| 3612 | /*! |
| 3613 | \class QStyleHintReturn |
| 3614 | \brief The QStyleHintReturn class provides style hints that return more |
| 3615 | than basic data types. |
| 3616 | |
| 3617 | \ingroup appearance |
| 3618 | \inmodule QtWidgets |
| 3619 | |
| 3620 | QStyleHintReturn and its subclasses are used to pass information |
| 3621 | from a style back to the querying widget. This is most useful |
| 3622 | when the return value from QStyle::styleHint() does not provide enough |
| 3623 | detail; for example, when a mask is to be returned. |
| 3624 | */ |
| 3625 | |
| 3626 | /*! |
| 3627 | \enum QStyleHintReturn::HintReturnType |
| 3628 | |
| 3629 | \value SH_Default QStyleHintReturn |
| 3630 | \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask |
| 3631 | \value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat |
| 3632 | */ |
| 3633 | |
| 3634 | /*! |
| 3635 | \enum QStyleHintReturn::StyleOptionType |
| 3636 | |
| 3637 | This enum is used to hold information about the type of the style option, and |
| 3638 | is defined for each QStyleHintReturn subclass. |
| 3639 | |
| 3640 | \value Type The type of style option provided (\l SH_Default for |
| 3641 | this class). |
| 3642 | |
| 3643 | The type is used internally by QStyleHintReturn, its subclasses, and |
| 3644 | qstyleoption_cast() to determine the type of style option. In |
| 3645 | general you do not need to worry about this unless you want to |
| 3646 | create your own QStyleHintReturn subclass and your own styles. |
| 3647 | |
| 3648 | \sa StyleOptionVersion |
| 3649 | */ |
| 3650 | |
| 3651 | /*! |
| 3652 | \enum QStyleHintReturn::StyleOptionVersion |
| 3653 | |
| 3654 | This enum is used to hold information about the version of the style option, and |
| 3655 | is defined for each QStyleHintReturn subclass. |
| 3656 | |
| 3657 | \value Version 1 |
| 3658 | |
| 3659 | The version is used by QStyleHintReturn subclasses to implement |
| 3660 | extensions without breaking compatibility. If you use |
| 3661 | qstyleoption_cast(), you normally do not need to check it. |
| 3662 | |
| 3663 | \sa StyleOptionType |
| 3664 | */ |
| 3665 | |
| 3666 | /*! |
| 3667 | \variable QStyleHintReturn::type |
| 3668 | \brief the type of the style hint container |
| 3669 | |
| 3670 | \sa HintReturnType |
| 3671 | */ |
| 3672 | |
| 3673 | /*! |
| 3674 | \variable QStyleHintReturn::version |
| 3675 | \brief the version of the style hint return container |
| 3676 | |
| 3677 | This value can be used by subclasses to implement extensions |
| 3678 | without breaking compatibility. If you use qstyleoption_cast<T>(), you |
| 3679 | normally do not need to check it. |
| 3680 | */ |
| 3681 | |
| 3682 | /*! |
| 3683 | Constructs a QStyleHintReturn with version \a version and type \a |
| 3684 | type. |
| 3685 | |
| 3686 | The version has no special meaning for QStyleHintReturn; it can be |
| 3687 | used by subclasses to distinguish between different version of |
| 3688 | the same hint type. |
| 3689 | |
| 3690 | \sa QStyleOption::version, QStyleOption::type |
| 3691 | */ |
| 3692 | |
| 3693 | QStyleHintReturn::QStyleHintReturn(int version, int type) |
| 3694 | : version(version), type(type) |
| 3695 | { |
| 3696 | } |
| 3697 | |
| 3698 | /*! |
| 3699 | \internal |
| 3700 | */ |
| 3701 | |
| 3702 | QStyleHintReturn::~QStyleHintReturn() |
| 3703 | { |
| 3704 | |
| 3705 | } |
| 3706 | |
| 3707 | /*! |
| 3708 | \class QStyleHintReturnMask |
| 3709 | \brief The QStyleHintReturnMask class provides style hints that return a QRegion. |
| 3710 | |
| 3711 | \ingroup appearance |
| 3712 | \inmodule QtWidgets |
| 3713 | */ |
| 3714 | |
| 3715 | /*! |
| 3716 | \variable QStyleHintReturnMask::region |
| 3717 | \brief the region for style hints that return a QRegion |
| 3718 | */ |
| 3719 | |
| 3720 | /*! |
| 3721 | Constructs a QStyleHintReturnMask. The member variables are |
| 3722 | initialized to default values. |
| 3723 | */ |
| 3724 | QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type) |
| 3725 | { |
| 3726 | } |
| 3727 | |
| 3728 | /*! |
| 3729 | Destructor. |
| 3730 | */ |
| 3731 | QStyleHintReturnMask::~QStyleHintReturnMask() |
| 3732 | { |
| 3733 | } |
| 3734 | |
| 3735 | /*! |
| 3736 | \enum QStyleHintReturnMask::StyleOptionType |
| 3737 | |
| 3738 | This enum is used to hold information about the type of the style option, and |
| 3739 | is defined for each QStyleHintReturn subclass. |
| 3740 | |
| 3741 | \value Type The type of style option provided (\l{SH_Mask} for |
| 3742 | this class). |
| 3743 | |
| 3744 | The type is used internally by QStyleHintReturn, its subclasses, and |
| 3745 | qstyleoption_cast() to determine the type of style option. In |
| 3746 | general you do not need to worry about this unless you want to |
| 3747 | create your own QStyleHintReturn subclass and your own styles. |
| 3748 | |
| 3749 | \sa StyleOptionVersion |
| 3750 | */ |
| 3751 | |
| 3752 | /*! |
| 3753 | \enum QStyleHintReturnMask::StyleOptionVersion |
| 3754 | |
| 3755 | This enum is used to hold information about the version of the style option, and |
| 3756 | is defined for each QStyleHintReturn subclass. |
| 3757 | |
| 3758 | \value Version 1 |
| 3759 | |
| 3760 | The version is used by QStyleHintReturn subclasses to implement |
| 3761 | extensions without breaking compatibility. If you use |
| 3762 | qstyleoption_cast(), you normally do not need to check it. |
| 3763 | |
| 3764 | \sa StyleOptionType |
| 3765 | */ |
| 3766 | |
| 3767 | /*! |
| 3768 | \class QStyleHintReturnVariant |
| 3769 | \brief The QStyleHintReturnVariant class provides style hints that return a QVariant. |
| 3770 | \since 4.3 |
| 3771 | \ingroup appearance |
| 3772 | \inmodule QtWidgets |
| 3773 | */ |
| 3774 | |
| 3775 | /*! |
| 3776 | \variable QStyleHintReturnVariant::variant |
| 3777 | \brief the variant for style hints that return a QVariant |
| 3778 | */ |
| 3779 | |
| 3780 | /*! |
| 3781 | Constructs a QStyleHintReturnVariant. The member variables are |
| 3782 | initialized to default values. |
| 3783 | */ |
| 3784 | QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, Type) |
| 3785 | { |
| 3786 | } |
| 3787 | |
| 3788 | /*! |
| 3789 | Destructor. |
| 3790 | */ |
| 3791 | QStyleHintReturnVariant::~QStyleHintReturnVariant() |
| 3792 | { |
| 3793 | } |
| 3794 | |
| 3795 | /*! |
| 3796 | \enum QStyleHintReturnVariant::StyleOptionType |
| 3797 | |
| 3798 | This enum is used to hold information about the type of the style option, and |
| 3799 | is defined for each QStyleHintReturn subclass. |
| 3800 | |
| 3801 | \value Type The type of style option provided (\l{SH_Variant} for |
| 3802 | this class). |
| 3803 | |
| 3804 | The type is used internally by QStyleHintReturn, its subclasses, and |
| 3805 | qstyleoption_cast() to determine the type of style option. In |
| 3806 | general you do not need to worry about this unless you want to |
| 3807 | create your own QStyleHintReturn subclass and your own styles. |
| 3808 | |
| 3809 | \sa StyleOptionVersion |
| 3810 | */ |
| 3811 | |
| 3812 | /*! |
| 3813 | \enum QStyleHintReturnVariant::StyleOptionVersion |
| 3814 | |
| 3815 | This enum is used to hold information about the version of the style option, and |
| 3816 | is defined for each QStyleHintReturn subclass. |
| 3817 | |
| 3818 | \value Version 1 |
| 3819 | |
| 3820 | The version is used by QStyleHintReturn subclasses to implement |
| 3821 | extensions without breaking compatibility. If you use |
| 3822 | qstyleoption_cast(), you normally do not need to check it. |
| 3823 | |
| 3824 | \sa StyleOptionType |
| 3825 | */ |
| 3826 | |
| 3827 | /*! |
| 3828 | \fn template <typename T> T qstyleoption_cast<T>(const QStyleHintReturn *hint) |
| 3829 | \relates QStyleHintReturn |
| 3830 | |
| 3831 | Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type} |
| 3832 | and \l{QStyleHintReturn::version}{version} of \a hint. |
| 3833 | |
| 3834 | Example: |
| 3835 | |
| 3836 | \snippet code/src_gui_styles_qstyleoption.cpp 0 |
| 3837 | |
| 3838 | \sa QStyleHintReturn::type, QStyleHintReturn::version |
| 3839 | */ |
| 3840 | |
| 3841 | /*! |
| 3842 | \fn template <typename T> T qstyleoption_cast<T>(QStyleHintReturn *hint) |
| 3843 | \overload |
| 3844 | \relates QStyleHintReturn |
| 3845 | |
| 3846 | Returns a T or \nullptr depending on the type of \a hint. |
| 3847 | */ |
| 3848 | |
| 3849 | #if !defined(QT_NO_DEBUG_STREAM) |
| 3850 | QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType) |
| 3851 | { |
| 3852 | #if !defined(QT_NO_DEBUG) |
| 3853 | switch (optionType) { |
| 3854 | case QStyleOption::SO_Default: |
| 3855 | debug << "SO_Default" ; break; |
| 3856 | case QStyleOption::SO_FocusRect: |
| 3857 | debug << "SO_FocusRect" ; break; |
| 3858 | case QStyleOption::SO_Button: |
| 3859 | debug << "SO_Button" ; break; |
| 3860 | case QStyleOption::SO_Tab: |
| 3861 | debug << "SO_Tab" ; break; |
| 3862 | case QStyleOption::SO_MenuItem: |
| 3863 | debug << "SO_MenuItem" ; break; |
| 3864 | case QStyleOption::SO_Frame: |
| 3865 | debug << "SO_Frame" ; break; |
| 3866 | case QStyleOption::SO_ProgressBar: |
| 3867 | debug << "SO_ProgressBar" ; break; |
| 3868 | case QStyleOption::SO_ToolBox: |
| 3869 | debug << "SO_ToolBox" ; break; |
| 3870 | case QStyleOption::SO_Header: |
| 3871 | debug << "SO_Header" ; break; |
| 3872 | case QStyleOption::SO_DockWidget: |
| 3873 | debug << "SO_DockWidget" ; break; |
| 3874 | case QStyleOption::SO_ViewItem: |
| 3875 | debug << "SO_ViewItem" ; break; |
| 3876 | case QStyleOption::SO_TabWidgetFrame: |
| 3877 | debug << "SO_TabWidgetFrame" ; break; |
| 3878 | case QStyleOption::SO_TabBarBase: |
| 3879 | debug << "SO_TabBarBase" ; break; |
| 3880 | case QStyleOption::SO_RubberBand: |
| 3881 | debug << "SO_RubberBand" ; break; |
| 3882 | case QStyleOption::SO_Complex: |
| 3883 | debug << "SO_Complex" ; break; |
| 3884 | case QStyleOption::SO_Slider: |
| 3885 | debug << "SO_Slider" ; break; |
| 3886 | case QStyleOption::SO_SpinBox: |
| 3887 | debug << "SO_SpinBox" ; break; |
| 3888 | case QStyleOption::SO_ToolButton: |
| 3889 | debug << "SO_ToolButton" ; break; |
| 3890 | case QStyleOption::SO_ComboBox: |
| 3891 | debug << "SO_ComboBox" ; break; |
| 3892 | case QStyleOption::SO_TitleBar: |
| 3893 | debug << "SO_TitleBar" ; break; |
| 3894 | case QStyleOption::SO_CustomBase: |
| 3895 | debug << "SO_CustomBase" ; break; |
| 3896 | case QStyleOption::SO_GroupBox: |
| 3897 | debug << "SO_GroupBox" ; break; |
| 3898 | case QStyleOption::SO_ToolBar: |
| 3899 | debug << "SO_ToolBar" ; break; |
| 3900 | case QStyleOption::SO_ComplexCustomBase: |
| 3901 | debug << "SO_ComplexCustomBase" ; break; |
| 3902 | case QStyleOption::SO_SizeGrip: |
| 3903 | debug << "SO_SizeGrip" ; break; |
| 3904 | case QStyleOption::SO_GraphicsItem: |
| 3905 | debug << "SO_GraphicsItem" ; break; |
| 3906 | } |
| 3907 | #else |
| 3908 | Q_UNUSED(optionType); |
| 3909 | #endif |
| 3910 | return debug; |
| 3911 | } |
| 3912 | |
| 3913 | QDebug operator<<(QDebug debug, const QStyleOption &option) |
| 3914 | { |
| 3915 | #if !defined(QT_NO_DEBUG) |
| 3916 | debug << "QStyleOption(" ; |
| 3917 | debug << QStyleOption::OptionType(option.type); |
| 3918 | debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight" ); |
| 3919 | debug << ',' << option.state; |
| 3920 | debug << ',' << option.rect; |
| 3921 | debug << ',' << option.styleObject; |
| 3922 | debug << ')'; |
| 3923 | #else |
| 3924 | Q_UNUSED(option); |
| 3925 | #endif |
| 3926 | return debug; |
| 3927 | } |
| 3928 | #endif |
| 3929 | |
| 3930 | QT_END_NAMESPACE |
| 3931 | |