QStyleOption(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QStyleOption πŸ’–

ok so like. welcome to the qstyleoption.3qt manual page, bestie. yes it's a Qt 3 joint, yes it's from 2007, but we're gonna make it cute. grab a boba. πŸ§‹


✨ NAME ✨

QStyleOption β€” optional parameters for QStyle functions


🌸 SYNOPSIS 🌸

#include <qstyle.h>

πŸŽ€ Public Members πŸŽ€

  • enum StyleOptionDefault { Default }
  • QStyleOption ( StyleOptionDefault = Default )
  • QStyleOption ( int in1 )
  • QStyleOption ( int in1, int in2 )
  • QStyleOption ( int in1, int in2, int in3, int in4 )
  • QStyleOption ( QMenuItem * m )
  • QStyleOption ( QMenuItem * m, int in1 )
  • QStyleOption ( QMenuItem * m, int in1, int in2 )
  • QStyleOption ( const QColor & c )
  • QStyleOption ( QTab * t )
  • QStyleOption ( QListViewItem * i )
  • QStyleOption ( QCheckListItem * i )
  • QStyleOption ( Qt::ArrowType a )
  • QStyleOption ( const QRect & r )
  • QStyleOption ( QWidget * w )
  • bool isDefault () const
  • int day () const
  • int lineWidth () const
  • int midLineWidth () const
  • int frameShape () const
  • int frameShadow () const
  • int headerSection () const
  • QMenuItem * menuItem () const
  • int maxIconWidth () const
  • int tabWidth () const
  • const QColor & color () const
  • QTab * tab () const
  • QCheckListItem * checkListItem () const
  • QListViewItem * listViewItem () const
  • Qt::ArrowType arrowType () const
  • QRect rect () const
  • QWidget * widget () const

πŸ’… DESCRIPTION πŸ’…

The QStyleOption class specifies optional parameters for QStyle functions. that's the whole gig, she's a little carrier bag of extra info. πŸ‘œ

Some QStyle functions take an optional argument specifying extra information that is required for a particular primitive or control. So that the QStyle class can be extended, QStyleOption is used to provide a variable-argument for these options. slay, flexible design.

The QStyleOption class has constructors for each type of optional argument, and this set of constructors may be extended in future Qt releases. There are also corresponding access functions that return the optional arguments: these too may be extended. so like, don't get too attached to the exact menu, bestie.

For each constructor, you should refer to the documentation of the QStyle functions to see the meaning of the arguments. the constructors don't come with little name tags, ok?

⚠️ okay this part is important. When calling QStyle functions from your own widgets, you must only pass the default QStyleOption or the argument that QStyle is documented to accept. For example, if the function expects QStyleOption(QMenuItem *, int), passing QStyleOption(QMenuItem *) leaves the optional integer argument uninitialized. πŸ’€ not the uninitialized value, anything but that.

When subclassing QStyle, you must similarly only expect the default or documented arguments. The other arguments will have uninitialized values. no cap, don't read them.

If you make your own QStyle subclasses and your own widgets, you can make a subclass of QStyleOption to pass additional arguments to your QStyle subclass. You will need to cast the "const QStyleOption&" argument to your subclass, so be sure your style has been called from your widget. it's giving very "you built it, you cast it" energy.

See also Widget Appearance and Style.


🌈 Member Type Documentation 🌈

QStyleOption::StyleOptionDefault

This enum value can be passed as the optional argument to any QStyle function. she's welcome everywhere. πŸ‘‘

  • QStyleOption::Default

πŸ‘‘ MEMBER FUNCTION DOCUMENTATION πŸ‘‘

QStyleOption::QStyleOption ( StyleOptionDefault = Default )

The default option. This can always be passed as the optional argument to QStyle functions. the universal plus-one, fr fr.

QStyleOption::QStyleOption ( int in1 )

Pass one integer, in1. For example, headerSection.

QStyleOption::QStyleOption ( int in1, int in2 )

Pass two integers, in1 and in2. For example, linewidth and midlinewidth.

QStyleOption::QStyleOption ( int in1, int in2, int in3, int in4 )

Pass four integers, in1, in2, in3 and in4. a whole little int squad. πŸ”₯

QStyleOption::QStyleOption ( QMenuItem * m )

Pass a menu item, m.

QStyleOption::QStyleOption ( QMenuItem * m, int in1 )

Pass a menu item and an integer, m and in1.

QStyleOption::QStyleOption ( QMenuItem * m, int in1, int in2 )

Pass a menu item and two integers, m, in1 and in2.

QStyleOption::QStyleOption ( const QColor & c )

Pass a color, c. aesthetic. 🎨

QStyleOption::QStyleOption ( QTab * t )

Pass a QTab, t.

QStyleOption::QStyleOption ( QListViewItem * i )

Pass a QListViewItem, i.

QStyleOption::QStyleOption ( QCheckListItem * i )

Pass a QCheckListItem, i.

QStyleOption::QStyleOption ( Qt::ArrowType a )

Pass an Qt::ArrowType, a.

QStyleOption::QStyleOption ( const QRect & r )

Pass a QRect, r.

QStyleOption::QStyleOption ( QWidget * w )

Pass a QWidget, w.


Qt::ArrowType QStyleOption::arrowType () const

Returns an arrow type if the appropriate constructor was called; otherwise the return value is undefined. ⬆️

QCheckListItem * QStyleOption::checkListItem () const

Returns a check list item if the appropriate constructor was called; otherwise the return value is undefined.

const QColor & QStyleOption::color () const

Returns a color if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::day () const

Returns the index of the day in the month if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::frameShadow () const

Returns a QFrame::Shadow value if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::frameShape () const

Returns a QFrame::Shape value if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::headerSection () const

Returns the header section if the appropriate constructor was called; otherwise the return value is undefined.

bool QStyleOption::isDefault () const

Returns TRUE if the option was constructed with the default constructor; otherwise returns FALSE.

int QStyleOption::lineWidth () const

Returns the line width if the appropriate constructor was called; otherwise the return value is undefined.

QListViewItem * QStyleOption::listViewItem () const

Returns a QListView item if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::maxIconWidth () const

Returns the maximum width of the menu item check area if the appropriate constructor was called; otherwise the return value is undefined.

QMenuItem * QStyleOption::menuItem () const

Returns a menu item if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::midLineWidth () const

Returns the mid-line width if the appropriate constructor was called; otherwise the return value is undefined.

QRect QStyleOption::rect () const

Returns a rectangle if the appropriate constructor was called; otherwise the return value is undefined.

QTab * QStyleOption::tab () const

Returns a QTabBar tab if the appropriate constructor was called; otherwise the return value is undefined.

int QStyleOption::tabWidth () const

Returns the tab indent width if the appropriate constructor was called; otherwise the return value is undefined.

QWidget * QStyleOption::widget () const

Returns a pointer to a widget if the appropriate constructor was called; otherwise the return value is undefined.

πŸ’€ the phrase "the appropriate constructor was called" is doing SO much heavy lifting in this section, and every single one of those accessors will hand you an undefined value if you didn't. respect the pattern or get got.

πŸ¦‹ SEE ALSO πŸ¦‹


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


🫢 AUTHOR 🫢

Generated automatically from the source code. (no human wrote this one, she's a machine-made icon πŸ€–βœ¨)


πŸ™ˆ BUGS πŸ™ˆ

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. genuinely, thank you, we love a detailed repro. πŸ’–

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (she's a fan-made remix, basically. not the official release.)

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qstyleoption.3qt) and the Qt version (3.3.8).


ok that's the whole page, bestie, you ate it. πŸ“ this was QStyleOption(3qt) from Trolltech AS, dated 2 February 2007, Qt version 3.3.8 β€” and it's in the 3qt manual section, so now you know exactly where to find her again. mwah. πŸ’…βœ¨

πŸ“¦ where this page comes from