📄 qstyleoption.cpp
字号:
\value Movable The toolbar is movable, and a handle will appear when holding the cursor over the toolbar's boundary. \sa features, QToolBar::isMovable()*//*! \variable QStyleOptionToolBar::positionOfLine This variable holds the position of the toolbar line. The default value is QStyleOptionToolBar::OnlyOne.*//*! \variable QStyleOptionToolBar::positionWithinLine This variable holds the position of the toolbar within a line. The default value is QStyleOptionToolBar::OnlyOne.*//*! \variable QStyleOptionToolBar::toolBarArea This variable holds the location for drawing the toolbar. The default value is Qt::TopToolBarArea. \sa Qt::ToolBarArea*//*! \variable QStyleOptionToolBar::features This variable holds whether the toolbar is movable or not. The default value is \l None.*//*! \variable QStyleOptionToolBar::lineWidth This variable holds the line width for drawing the toolbar. The default value is 0.*//*! \variable QStyleOptionToolBar::midLineWidth This variable holds the mid-line width for drawing the toolbar. The default value is 0.*/#endif#ifndef QT_NO_TABBAR/*! \class QStyleOptionTab \brief The QStyleOptionTab class is used to describe the parameters for drawing a tab bar. The QStyleOptionTab class is used for drawing several built-in Qt widgets including \l QTabBar and the panel for \l QTabWidget. Note that to describe the parameters necessary for drawing a frame in Qt 4.1 or above, you must use the QStyleOptionFrameV2 subclass. An instance of the QStyleOptiontabV2 class has type \l SO_Tab and \l version 1. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it. If you create your own QStyle subclass, you should handle both QStyleOptionTab and QStyleOptionTabV2. For an example demonstrating how style options can be used, see the \l {widgets/styles}{Styles} example. \sa QStyleOptionTabV2, QStyleOption*//*! Constructs a QStyleOptionTab object. The members variables are initialized to default values.*/QStyleOptionTab::QStyleOptionTab() : QStyleOption(QStyleOptionTab::Version, SO_Tab), shape(QTabBar::RoundedNorth), row(0), position(Beginning), selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets){}/*! \internal*/QStyleOptionTab::QStyleOptionTab(int version) : QStyleOption(version, SO_Tab), shape(QTabBar::RoundedNorth), row(0), position(Beginning), selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets){}/*! \fn QStyleOptionTab::QStyleOptionTab(const QStyleOptionTab &other) Constructs a copy of the \a other style option.*//*! \variable QStyleOptionTab::Type Equals SO_Tab. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.*//*! \variable QStyleOptionTab::Version Equals 1. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.*//*! \enum QStyleOptionTab::TabPosition \value Beginning The tab is the first tab in the tab bar. \value Middle The tab is neither the first nor the last tab in the tab bar. \value End The tab is the last tab in the tab bar. \value OnlyOneTab The tab is both the first and the last tab in the tab bar. \sa position*//*! \enum QStyleOptionTab::CornerWidget These flags indicate the corner widgets in a tab. \value NoCornerWidgets There are no corner widgets \value LeftCornerWidget Left corner widget \value RightCornerWidget Right corner widget \sa cornerWidgets*//*! \enum QStyleOptionTab::SelectedPosition \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab). \value NextIsSelected The next tab (typically the tab on the right) is selected. \value PreviousIsSelected The previous tab (typically the tab on the left) is selected. \sa selectedPosition*//*! \variable QStyleOptionTab::selectedPosition \brief The position of the selected tab in relation to this tab. Some styles need to draw a tab differently depending on whether or not it is adjacent to the selected tab.*//*! \variable QStyleOptionTab::cornerWidgets \brief Information on the cornerwidgets of the tab bar. \sa CornerWidget*//*! \variable QStyleOptionTab::shape \brief The tab shape used to draw the tab. \sa QTabBar::Shape*//*! \variable QStyleOptionTab::text \brief The text of the tab.*//*! \variable QStyleOptionTab::icon \brief The icon for the tab.*//*! \variable QStyleOptionTab::row \brief which row the tab is currently in 0 indicates the front row. Currently this property can only be 0.*//*! \variable QStyleOptionTab::position \brief the position of the tab in the tab bar*//*! \class QStyleOptionTabV2 \brief The QStyleOptionTabV2 class is used to describe the parameters necessary for drawing a tabs in Qt 4.1 or above. \since 4.1 An instance of the QStyleOptionTabV2 class has type \l SO_Tab and \l version 2. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it. If you create your own QStyle subclass, you should handle both QStyleOptionTab and QStyleOptionTabV2. One way to achieve this is to use the QStyleOptionTabV2 copy constructor. For example: \code if (const QStyleOptionTab *tabOption = qstyleoption_cast<const QStyleOptionTab *>(option)) { QStyleOptionTabV2 tabV2(*tabOption); // draw the tab using tabV2 } \endcode in the example above: If \c tabOption's version is 1, the extra member (\l iconSize) will be set to an invalid size for \c tabV2. If \c tabOption's version is 2, the constructor will simply copy the \c tab's iconSize. For an example demonstrating how style options can be used, see the \l {widgets/styles}{Styles} example. \sa QStyleOptionTab, QStyleOption*//*! \variable QStyleOptionTabV2::iconSize The size for the icons. If this size is invalid and you need an icon size, you can use QStyle::pixelMetric() to find the default icon size for tab bars. \sa QTabBar::iconSize() QStyle::pixelMetric()*//*! Constructs a QStyleOptionTabV2.*/QStyleOptionTabV2::QStyleOptionTabV2() : QStyleOptionTab(Version){}/*! \internal*/QStyleOptionTabV2::QStyleOptionTabV2(int version) : QStyleOptionTab(version){}/*! \fn QStyleOptionTabV2::QStyleOptionTabV2(const QStyleOptionTabV2 &other) Constructs a copy of the \a other style option.*//*! Constructs a QStyleOptionTabV2 copy of the \a other style option which can be either of the QStyleOptionTabV2 or QStyleOptionTab types. If the other style option's version is 1, the new style option's \c iconSize is set to an invalid value. If its version is 2, its \c iconSize value is simply copied to the new style option.*/QStyleOptionTabV2::QStyleOptionTabV2(const QStyleOptionTab &other) : QStyleOptionTab(Version){ if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) { *this = *tab; } else { *((QStyleOptionTab *)this) = other; version = Version; }}/*! Assigns the \a other style option to this QStyleOptionTabV2. The \a other style option can be either of the QStyleOptionTabV2 or QStyleOptionTab types. If the other style option's version is 1, this style option's \c iconSize is set to an invalid size. If its version is 2, its \c iconSize value is simply copied to this style option.*/QStyleOptionTabV2 &QStyleOptionTabV2::operator=(const QStyleOptionTab &other){ QStyleOptionTab::operator=(other); if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) iconSize = tab->iconSize; else iconSize = QSize(); return *this;}#endif // QT_NO_TABBAR/*! \class QStyleOptionProgressBar \brief The QStyleOptionProgressBar class is used to describe the parameters necessary for drawing a progress bar. Since Qt 4.1, Qt uses the QStyleOptionProgressBarV2 subclass for drawing QProgressBar. An instance of the QStyleOptionProgressBar class has type SO_ProgressBar and version 1. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it. If you create your own QStyle subclass, you should handle both QStyleOptionProgressBar and QStyleOptionProgressBarV2. For an example demonstrating how style options can be used, see the \l {widgets/styles}{Styles} example. \sa QStyleOptionProgressBarV2, QStyleOption*//*! Constructs a QStyleOptionProgressBar. The members variables are initialized to default values.*/QStyleOptionProgressBar::QStyleOptionProgressBar() : QStyleOption(QStyleOptionProgressBar::Version, SO_ProgressBar), minimum(0), maximum(0), progress(0), textAlignment(0), textVisible(false){}/*! \internal*/QStyleOptionProgressBar::QStyleOptionProgressBar(int version) : QStyleOption(version, SO_ProgressBar), minimum(0), maximum(0), progress(0), textAlignment(0), textVisible(false){}/*! \fn QStyleOptionProgressBar::QStyleOptionProgressBar(const QStyleOptionProgressBar &other) Constructs a copy of the \a other style option.*//*! \variable QStyleOptionProgressBar::Type Equals SO_ProgressBar. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles.*//*! \variable QStyleOptionProgressBar::Version Equals 1. The version is used by QStyleOption subclasses to implement extensions without breaking compatibility. If you use qstyleoption_cast(), you normally don't need to check it.*//*! \variable QStyleOptionProgressBar::minimum \brief The minimum value for the progress bar This is the minimum value in the progress bar. \sa QProgressBar::minimum*//*! \variable QStyleOptionProgressBar::maximum \brief The maximum value for the progress bar This is the maximum value in the progress bar. \sa QProgressBar::maximum*//*! \variable QStyleOptionProgressBar::text \brief The text for the progress bar. The progress bar text is usually just the progress expressed as a string. An empty string indicates that the progress bar has not started yet. \sa QProgressBar::text*//*! \variable QStyleOptionProgressBar::textVisible \brief A flag indicating whether or not text is visible. If this flag is true then the text is visible. Otherwise, the text is not visible. \sa QProgressBar::textVisible*//*! \variable QStyleOptionProgressBar::textAlignment \brief The text alignment for the text in the QProgressBar This can be used as a guide on where the text should be in the progressbar.*//*! \variable QStyleOptionProgressBar::progress \brief the current progress for the progress bar. The current progress. A value of QStyleOptionProgressBar::minimum - 1 indicates that the progress hasn't started yet. \sa QProgressBar::value*//*! \class QStyleOptionProgressBarV2 \brief The QStyleOptionProgressBarV2 class is used to describe the parameters necessary for drawing a progress bar in Qt 4.1 or above. \since 4.1 An instance of this class has \l type SO_ProgressBar and \l version 2. The type is used internally by QStyleOption, its subclasses, and qstyleoption_cast() to determine the type of style option. In general you do not need to worry about this unless you want to create your own QStyleOption subclass and your own styles. The
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -