[][src]Struct qt_widgets::QStyleOptionToolBar

#[repr(C)]pub struct QStyleOptionToolBar { /* fields omitted */ }

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

C++ class: QStyleOptionToolBar.

C++ documentation:

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

QStyleOptionToolBar contains all the information that QStyle functions need to draw QToolBar.

For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

The QStyleOptionToolBar class holds the lineWidth and the midLineWidth for drawing the widget. It also stores information about which area the toolbar should be located in, whether it is movable or not, which position the toolbar line should have (positionOfLine), and the toolbar's position within the line (positionWithinLine).

In addition, the class provides a couple of enums: The ToolBarFeature enum is used to describe whether a toolbar is movable or not, and the ToolBarPosition enum is used to describe the position of a toolbar line, as well as the toolbar's position within the line.

For an example demonstrating how style options can be used, see the Styles example.

Methods

impl QStyleOptionToolBar[src]

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QStyleOptionToolBar>>
) -> Ref<QStyleOptionToolBar>
[src]

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

Calls C++ function: QStyleOptionToolBar& QStyleOptionToolBar::operator=(const QStyleOptionToolBar& other).

C++ documentation:

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

QStyleOptionToolBar contains all the information that QStyle functions need to draw QToolBar.

For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

The QStyleOptionToolBar class holds the lineWidth and the midLineWidth for drawing the widget. It also stores information about which area the toolbar should be located in, whether it is movable or not, which position the toolbar line should have (positionOfLine), and the toolbar's position within the line (positionWithinLine).

In addition, the class provides a couple of enums: The ToolBarFeature enum is used to describe whether a toolbar is movable or not, and the ToolBarPosition enum is used to describe the position of a toolbar line, as well as the toolbar's position within the line.

For an example demonstrating how style options can be used, see the Styles example.

pub unsafe fn features(&self) -> QFlags<ToolBarFeature>[src]

Returns a reference to the features field.

pub unsafe fn line_width(&self) -> c_int[src]

Returns the value of the lineWidth field.

pub unsafe fn mid_line_width(&self) -> c_int[src]

Returns the value of the midLineWidth field.

pub unsafe fn new() -> CppBox<QStyleOptionToolBar>[src]

Constructs a QStyleOptionToolBar, initializing the members variables to their default values.

Calls C++ function: [constructor] void QStyleOptionToolBar::QStyleOptionToolBar().

C++ documentation:

Constructs a QStyleOptionToolBar, initializing the members variables to their default values.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QStyleOptionToolBar>>
) -> CppBox<QStyleOptionToolBar>
[src]

Constructs a copy of the other style option.

Calls C++ function: [constructor] void QStyleOptionToolBar::QStyleOptionToolBar(const QStyleOptionToolBar& other).

C++ documentation:

Constructs a copy of the other style option.

pub unsafe fn position_of_line(&self) -> ToolBarPosition[src]

Returns the value of the positionOfLine field.

pub unsafe fn position_within_line(&self) -> ToolBarPosition[src]

Returns the value of the positionWithinLine field.

pub unsafe fn set_features(&self, value: QFlags<ToolBarFeature>)[src]

Sets the value of the features field.

pub unsafe fn set_line_width(&self, value: c_int)[src]

Sets the value of the lineWidth field.

pub unsafe fn set_mid_line_width(&self, value: c_int)[src]

Sets the value of the midLineWidth field.

pub unsafe fn set_position_of_line(&self, value: ToolBarPosition)[src]

Sets the value of the positionOfLine field.

pub unsafe fn set_position_within_line(&self, value: ToolBarPosition)[src]

Sets the value of the positionWithinLine field.

pub unsafe fn set_tool_bar_area(&self, value: ToolBarArea)[src]

Sets the value of the toolBarArea field.

pub unsafe fn tool_bar_area(&self) -> ToolBarArea[src]

Returns the value of the toolBarArea field.

Methods from Deref<Target = QStyleOption>

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QStyleOption>>
) -> Ref<QStyleOption>
[src]

Assign other to this QStyleOption.

Calls C++ function: QStyleOption& QStyleOption::operator=(const QStyleOption& other).

C++ documentation:

Assign other to this QStyleOption.

pub unsafe fn direction(&self) -> LayoutDirection[src]

Returns the value of the direction field.

pub unsafe fn font_metrics(&self) -> Ref<QFontMetrics>[src]

Returns a reference to the fontMetrics field.

pub unsafe fn font_metrics_mut(&self) -> Ref<QFontMetrics>[src]

Returns a mutable reference to the fontMetrics field.

pub unsafe fn init(&self, w: impl CastInto<Ptr<QWidget>>)[src]

Use initFrom(widget) instead.

Calls C++ function: void QStyleOption::init(const QWidget* w).

C++ documentation:

Use initFrom(widget) instead.

pub unsafe fn init_from(&self, w: impl CastInto<Ptr<QWidget>>)[src]

Initializes the state, direction, rect, palette, fontMetrics and styleObject member variables based on the specified widget.

Calls C++ function: void QStyleOption::initFrom(const QWidget* w).

C++ documentation:

Initializes the state, direction, rect, palette, fontMetrics and styleObject member variables based on the specified widget.

This is a convenience function; the member variables can also be initialized manually.

This function was introduced in Qt 4.1.

See also QWidget::layoutDirection(), QWidget::rect(), QWidget::palette(), and QWidget::fontMetrics().

pub unsafe fn palette(&self) -> Ref<QPalette>[src]

Returns a reference to the palette field.

pub unsafe fn palette_mut(&self) -> Ref<QPalette>[src]

Returns a mutable reference to the palette field.

pub unsafe fn rect(&self) -> Ref<QRect>[src]

Returns a reference to the rect field.

pub unsafe fn rect_mut(&self) -> Ref<QRect>[src]

Returns a mutable reference to the rect field.

pub unsafe fn set_direction(&self, value: LayoutDirection)[src]

Sets the value of the direction field.

pub unsafe fn set_font_metrics(&self, value: impl CastInto<Ref<QFontMetrics>>)[src]

Sets the value of the fontMetrics field.

pub unsafe fn set_palette(&self, value: impl CastInto<Ref<QPalette>>)[src]

Sets the value of the palette field.

pub unsafe fn set_rect(&self, value: impl CastInto<Ref<QRect>>)[src]

Sets the value of the rect field.

pub unsafe fn set_state(&self, value: QFlags<StateFlag>)[src]

Sets the value of the state field.

pub unsafe fn set_style_object(&self, value: impl CastInto<Ptr<QObject>>)[src]

Sets the value of the styleObject field.

pub unsafe fn set_type(&self, value: c_int)[src]

Sets the value of the type field.

pub unsafe fn set_version(&self, value: c_int)[src]

Sets the value of the version field.

pub unsafe fn state(&self) -> QFlags<StateFlag>[src]

Returns a reference to the state field.

pub unsafe fn style_object(&self) -> QPtr<QObject>[src]

Returns the value of the styleObject field.

pub unsafe fn type_(&self) -> c_int[src]

Returns the value of the type field.

pub unsafe fn version(&self) -> c_int[src]

Returns the value of the version field.

Trait Implementations

impl CppDeletable for QStyleOptionToolBar[src]

unsafe fn delete(&self)[src]

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

Calls C++ function: [destructor] void QStyleOptionToolBar::~QStyleOptionToolBar().

C++ documentation:

The QStyleOptionToolBar class is used to describe the parameters for drawing a toolbar.

QStyleOptionToolBar contains all the information that QStyle functions need to draw QToolBar.

For performance reasons, the access to the member variables is direct (i.e., using the . or -> operator). This low-level feel makes the structures straightforward to use and emphasizes that these are simply parameters used by the style functions.

The QStyleOptionToolBar class holds the lineWidth and the midLineWidth for drawing the widget. It also stores information about which area the toolbar should be located in, whether it is movable or not, which position the toolbar line should have (positionOfLine), and the toolbar's position within the line (positionWithinLine).

In addition, the class provides a couple of enums: The ToolBarFeature enum is used to describe whether a toolbar is movable or not, and the ToolBarPosition enum is used to describe the position of a toolbar line, as well as the toolbar's position within the line.

For an example demonstrating how style options can be used, see the Styles example.

impl Deref for QStyleOptionToolBar[src]

type Target = QStyleOption

The resulting type after dereferencing.

fn deref(&self) -> &QStyleOption[src]

Calls C++ function: QStyleOption* static_cast<QStyleOption*>(QStyleOptionToolBar* ptr).

impl StaticDowncast<QStyleOptionToolBar> for QStyleOption[src]

unsafe fn static_downcast(ptr: Ptr<QStyleOption>) -> Ptr<QStyleOptionToolBar>[src]

Calls C++ function: QStyleOptionToolBar* static_cast<QStyleOptionToolBar*>(QStyleOption* ptr).

impl StaticUpcast<QStyleOption> for QStyleOptionToolBar[src]

unsafe fn static_upcast(ptr: Ptr<QStyleOptionToolBar>) -> Ptr<QStyleOption>[src]

Calls C++ function: QStyleOption* static_cast<QStyleOption*>(QStyleOptionToolBar* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.