[][src]Struct qt_widgets::QGraphicsWidget

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

The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

C++ class: QGraphicsWidget.

C++ documentation:

The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

QGraphicsWidget is an extended base item that provides extra functionality over QGraphicsItem. It is similar to QWidget in many ways:

Unlike QGraphicsItem, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.

QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.

Since QGraphicsWidget resembles QWidget and has similar API, it is easier to port a widget from QWidget to QGraphicsWidget, instead of QGraphicsItem.

Note: QWidget-based widgets can be directly embedded into a QGraphicsScene using QGraphicsProxyWidget.

Noticeable differences between QGraphicsWidget and QWidget are:

QGraphicsWidgetQWidget
Coordinates and geometry are defined with qreals (doubles or floats, depending on the platform).QWidget uses integer geometry (QPoint, QRect).
The widget is already visible by default; you do not have to call show() to display the widget.QWidget is hidden by default until you call show().
A subset of widget attributes are supported.All widget attributes are supported.
A top-level item's style defaults to QGraphicsScene::styleA top-level widget's style defaults to QApplication::style
Graphics View provides a custom drag and drop framework, different from QWidget.Standard drag and drop framework.
Widget items do not support modality.Full modality support.

QGraphicsWidget supports a subset of Qt's widget attributes, (Qt::WidgetAttribute), as shown in the table below. Any attributes not listed in this table are unsupported, or otherwise unused.

Widget AttributeUsage
Qt::WA_SetLayoutDirectionSet by setLayoutDirection(), cleared by unsetLayoutDirection(). You can test this attribute to check if the widget has been explicitly assigned a layoutDirection. If the attribute is not set, the layoutDirection() is inherited.
Qt::WA_RightToLeftToggled by setLayoutDirection(). Inherited from the parent/scene. If set, the widget's layout will order horizontally arranged widgets from right to left.
Qt::WA_SetStyleSet and cleared by setStyle(). If this attribute is set, the widget has been explicitly assigned a style. If it is unset, the widget will use the scene's or the application's style.
Qt::WA_ResizedSet by setGeometry() and resize().
Qt::WA_SetPaletteSet by setPalette().
Qt::WA_SetFontSet by setFont().
Qt::WA_WindowPropagationEnables propagation to window widgets.

Although QGraphicsWidget inherits from both QObject and QGraphicsItem, you should use the functions provided by QGraphicsItem, not QObject, to manage the relationships between parent and child items. These functions control the stacking order of items as well as their ownership.

Note: The QObject::parent() should always return 0 for QGraphicsWidgets, but this policy is not strictly defined.

Methods

impl QGraphicsWidget[src]

pub fn geometry_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the geometry is changed in setGeometry().

Returns a built-in Qt signal QGraphicsWidget::geometryChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the geometry is changed in setGeometry().

Note: Notifier signal for property geometry. Notifier signal for property size.

pub fn layout_changed(&self) -> Signal<()>[src]

This property holds the layout of the widget

Returns a built-in Qt signal QGraphicsWidget::layoutChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the layout of the widget

Any existing layout manager is deleted before the new layout is assigned. If layout is nullptr, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.

QGraphicsWidget takes ownership of layout.

All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.

If no layout is currently managing this widget, layout() will return nullptr.

Access functions:

QGraphicsLayout *layout() const
void setLayout(QGraphicsLayout *layout)

Notifier signal:

void layoutChanged()

pub fn slot_close(&self) -> Receiver<()>[src]

Call this function to close the widget.

Returns a built-in Qt slot QGraphicsWidget::close that can be passed to qt_core::Signal::connect.

C++ documentation:

Call this function to close the widget.

Returns true if the widget was closed; otherwise returns false. This slot will first send a QCloseEvent to the widget, which may or may not accept the event. If the event was ignored, nothing happens. If the event was accepted, it will hide() the widget.

If the widget has the Qt::WA_DeleteOnClose attribute set it will be deleted.

pub unsafe fn actions(&self) -> CppBox<QListOfQAction>[src]

Returns the (possibly empty) list of this widget's actions.

Calls C++ function: QList<QAction*> QGraphicsWidget::actions() const.

C++ documentation:

Returns the (possibly empty) list of this widget's actions.

This function was introduced in Qt 4.5.

See also insertAction(), removeAction(), QWidget::actions(), QAction::associatedWidgets(), and QAction::associatedGraphicsWidgets().

pub unsafe fn add_action(&self, action: impl CastInto<Ptr<QAction>>)[src]

Appends the action action to this widget's list of actions.

Calls C++ function: void QGraphicsWidget::addAction(QAction* action).

C++ documentation:

Appends the action action to this widget's list of actions.

All QGraphicsWidgets have a list of QActions, however they can be represented graphically in many different ways. The default use of the QAction list (as returned by actions()) is to create a context QMenu.

A QGraphicsWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice.

This function was introduced in Qt 4.5.

See also removeAction(), insertAction(), actions(), and QWidget::addAction().

pub unsafe fn add_actions(&self, actions: impl CastInto<Ref<QListOfQAction>>)[src]

Appends the actions actions to this widget's list of actions.

Calls C++ function: void QGraphicsWidget::addActions(QList<QAction*> actions).

C++ documentation:

Appends the actions actions to this widget's list of actions.

This function was introduced in Qt 4.5.

See also removeAction(), QMenu, addAction(), and QWidget::addActions().

pub unsafe fn adjust_size(&self)[src]

Adjusts the size of the widget to its effective preferred size hint.

Calls C++ function: void QGraphicsWidget::adjustSize().

C++ documentation:

Adjusts the size of the widget to its effective preferred size hint.

This function is called implicitly when the item is shown for the first time.

See also effectiveSizeHint() and Qt::MinimumSize.

pub unsafe fn auto_fill_background(&self) -> bool[src]

This property holds whether the widget background is filled automatically

Calls C++ function: bool QGraphicsWidget::autoFillBackground() const.

C++ documentation:

This property holds whether the widget background is filled automatically

If enabled, this property will cause Qt to fill the background of the widget before invoking the paint() method. The color used is defined by the QPalette::Window color role from the widget's palette.

In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.

By default, this property is false.

This property was introduced in Qt 4.7.

Access functions:

bool autoFillBackground() const
void setAutoFillBackground(bool enabled)

See also Qt::WA_OpaquePaintEvent and Qt::WA_NoSystemBackground.

pub unsafe fn bounding_rect(&self) -> CppBox<QRectF>[src]

Reimplemented from QGraphicsItem::boundingRect().

Calls C++ function: virtual QRectF QGraphicsWidget::boundingRect() const.

C++ documentation:

Reimplemented from QGraphicsItem::boundingRect().

pub unsafe fn close(&self) -> bool[src]

Call this function to close the widget.

Calls C++ function: [slot] bool QGraphicsWidget::close().

C++ documentation:

Call this function to close the widget.

Returns true if the widget was closed; otherwise returns false. This slot will first send a QCloseEvent to the widget, which may or may not accept the event. If the event was ignored, nothing happens. If the event was accepted, it will hide() the widget.

If the widget has the Qt::WA_DeleteOnClose attribute set it will be deleted.

pub unsafe fn focus_policy(&self) -> FocusPolicy[src]

This property holds the way the widget accepts keyboard focus

Calls C++ function: Qt::FocusPolicy QGraphicsWidget::focusPolicy() const.

C++ documentation:

This property holds the way the widget accepts keyboard focus

The focus policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.

You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).

If you enable a focus policy (i.e., not Qt::NoFocus), QGraphicsWidget will automatically enable the ItemIsFocusable flag. Setting Qt::NoFocus on a widget will clear the ItemIsFocusable flag. If the widget currently has keyboard focus, the widget will automatically lose focus.

Access functions:

Qt::FocusPolicy focusPolicy() const
void setFocusPolicy(Qt::FocusPolicy policy)

See also focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent(), and enabled.

pub unsafe fn focus_widget(&self) -> QPtr<QGraphicsWidget>[src]

If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget. If no descendant widget has input focus, 0 is returned.

Calls C++ function: QGraphicsWidget* QGraphicsWidget::focusWidget() const.

C++ documentation:

If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget. If no descendant widget has input focus, 0 is returned.

See also QGraphicsItem::focusItem() and QWidget::focusWidget().

pub unsafe fn font(&self) -> CppBox<QFont>[src]

This property holds the widgets' font

Calls C++ function: QFont QGraphicsWidget::font() const.

C++ documentation:

This property holds the widgets' font

This property provides the widget's font.

QFont consists of font properties that have been explicitly defined and properties implicitly inherited from the widget's parent. Hence, font() can return a different font compared to the one set with setFont(). This scheme allows you to define single entries in a font without affecting the font's inherited entries.

When a widget's font changes, it resolves its entries against its parent widget. If the widget does not have a parent widget, it resolves its entries against the scene. The widget then sends itself a FontChange event and notifies all its descendants so that they can resolve their fonts as well.

By default, this property contains the application's default font.

Access functions:

QFont font() const
void setFont(const QFont &font)

See also QApplication::font(), QGraphicsScene::font, and QFont::resolve().

pub unsafe fn get_contents_margins(
    &self,
    left: *mut c_double,
    top: *mut c_double,
    right: *mut c_double,
    bottom: *mut c_double
)
[src]

Reimplemented from QGraphicsLayoutItem::getContentsMargins().

Calls C++ function: virtual void QGraphicsWidget::getContentsMargins(double* left, double* top, double* right, double* bottom) const.

C++ documentation:

Reimplemented from QGraphicsLayoutItem::getContentsMargins().

Gets the widget's contents margins. The margins are stored in left, top, right and bottom, as pointers to qreals. Each argument can be omitted by passing 0.

See also setContentsMargins().

pub unsafe fn get_window_frame_margins(
    &self,
    left: *mut c_double,
    top: *mut c_double,
    right: *mut c_double,
    bottom: *mut c_double
)
[src]

Gets the widget's window frame margins. The margins are stored in left, top, right and bottom as pointers to qreals. Each argument can be omitted by passing 0.

Calls C++ function: void QGraphicsWidget::getWindowFrameMargins(double* left, double* top, double* right, double* bottom) const.

C++ documentation:

Gets the widget's window frame margins. The margins are stored in left, top, right and bottom as pointers to qreals. Each argument can be omitted by passing 0.

See also setWindowFrameMargins() and windowFrameRect().

pub unsafe fn grab_shortcut_2a(
    &self,
    sequence: impl CastInto<Ref<QKeySequence>>,
    context: ShortcutContext
) -> c_int
[src]

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.

Calls C++ function: int QGraphicsWidget::grabShortcut(const QKeySequence& sequence, Qt::ShortcutContext context = …).

C++ documentation:

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.

If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.

Warning: You should not normally need to use this function; instead create QActions with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcuts if you just need key sequences. Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.

This function was introduced in Qt 4.5.

See also releaseShortcut(), setShortcutEnabled(), and QWidget::grabShortcut().

pub unsafe fn grab_shortcut_1a(
    &self,
    sequence: impl CastInto<Ref<QKeySequence>>
) -> c_int
[src]

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.

Calls C++ function: int QGraphicsWidget::grabShortcut(const QKeySequence& sequence).

C++ documentation:

Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.

If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.

Warning: You should not normally need to use this function; instead create QActions with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create QShortcuts if you just need key sequences. Both QAction and QShortcut handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.

This function was introduced in Qt 4.5.

See also releaseShortcut(), setShortcutEnabled(), and QWidget::grabShortcut().

pub unsafe fn insert_action(
    &self,
    before: impl CastInto<Ptr<QAction>>,
    action: impl CastInto<Ptr<QAction>>
)
[src]

Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

Calls C++ function: void QGraphicsWidget::insertAction(QAction* before, QAction* action).

C++ documentation:

Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

A QGraphicsWidget should only have one of each action.

This function was introduced in Qt 4.5.

See also removeAction(), addAction(), QMenu, actions(), and QWidget::insertActions().

pub unsafe fn insert_actions(
    &self,
    before: impl CastInto<Ptr<QAction>>,
    actions: impl CastInto<Ref<QListOfQAction>>
)
[src]

Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

Calls C++ function: void QGraphicsWidget::insertActions(QAction* before, QList<QAction*> actions).

C++ documentation:

Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is 0 or before is not a valid action for this widget.

A QGraphicsWidget can have at most one of each action.

This function was introduced in Qt 4.5.

See also removeAction(), QMenu, insertAction(), and QWidget::insertActions().

pub unsafe fn is_active_window(&self) -> bool[src]

Returns true if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e., a scene that currently has focus).

Calls C++ function: bool QGraphicsWidget::isActiveWindow() const.

C++ documentation:

Returns true if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e., a scene that currently has focus).

The active window is the window that either contains a child widget that currently has input focus, or that itself has input focus.

See also QGraphicsScene::activeWindow(), QGraphicsScene::setActiveWindow(), and isActive().

pub unsafe fn layout(&self) -> Ptr<QGraphicsLayout>[src]

This property holds the layout of the widget

Calls C++ function: QGraphicsLayout* QGraphicsWidget::layout() const.

C++ documentation:

This property holds the layout of the widget

Any existing layout manager is deleted before the new layout is assigned. If layout is 0, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.

QGraphicsWidget takes ownership of layout.

All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.

If no layout is currently managing this widget, layout() will return 0.

Access functions:

QGraphicsLayout *layout() const
void setLayout(QGraphicsLayout *layout)

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

This property holds the layout direction for this widget.

Calls C++ function: Qt::LayoutDirection QGraphicsWidget::layoutDirection() const.

C++ documentation:

This property holds the layout direction for this widget.

This property modifies this widget's and all of its descendants' Qt::WA_RightToLeft attribute. It also sets this widget's Qt::WA_SetLayoutDirection attribute.

The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With Qt::LeftToRight, the layout starts placing subwidgets from the left side of this widget towards the right. Qt::RightToLeft does the opposite - the layout will place widgets starting from the right edge moving towards the left.

Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a LayoutDirectionChange event, and then propagate the new layout direction to all its descendants.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QWidget::layoutDirection and QApplication::layoutDirection.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QGraphicsWidget::metaObject() const.

pub unsafe fn new_2a(
    parent: impl CastInto<Ptr<QGraphicsItem>>,
    w_flags: QFlags<WindowType>
) -> QBox<QGraphicsWidget>
[src]

Constructs a QGraphicsWidget instance. The optional parent argument is passed to QGraphicsItem's constructor. The optional wFlags argument specifies the widget's window flags (e.g., whether the widget should be a window, a tool, a popup, etc).

Calls C++ function: [constructor] void QGraphicsWidget::QGraphicsWidget(QGraphicsItem* parent = …, QFlags<Qt::WindowType> wFlags = …).

C++ documentation:

Constructs a QGraphicsWidget instance. The optional parent argument is passed to QGraphicsItem's constructor. The optional wFlags argument specifies the widget's window flags (e.g., whether the widget should be a window, a tool, a popup, etc).

pub unsafe fn new_0a() -> QBox<QGraphicsWidget>[src]

The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

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

C++ documentation:

The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

QGraphicsWidget is an extended base item that provides extra functionality over QGraphicsItem. It is similar to QWidget in many ways:

Unlike QGraphicsItem, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.

QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.

Since QGraphicsWidget resembles QWidget and has similar API, it is easier to port a widget from QWidget to QGraphicsWidget, instead of QGraphicsItem.

Note: QWidget-based widgets can be directly embedded into a QGraphicsScene using QGraphicsProxyWidget.

Noticeable differences between QGraphicsWidget and QWidget are:

QGraphicsWidgetQWidget
Coordinates and geometry are defined with qreals (doubles or floats, depending on the platform).QWidget uses integer geometry (QPoint, QRect).
The widget is already visible by default; you do not have to call show() to display the widget.QWidget is hidden by default until you call show().
A subset of widget attributes are supported.All widget attributes are supported.
A top-level item's style defaults to QGraphicsScene::styleA top-level widget's style defaults to QApplication::style
Graphics View provides a custom drag and drop framework, different from QWidget.Standard drag and drop framework.
Widget items do not support modality.Full modality support.

QGraphicsWidget supports a subset of Qt's widget attributes, (Qt::WidgetAttribute), as shown in the table below. Any attributes not listed in this table are unsupported, or otherwise unused.

Widget AttributeUsage
Qt::WA_SetLayoutDirectionSet by setLayoutDirection(), cleared by unsetLayoutDirection(). You can test this attribute to check if the widget has been explicitly assigned a layoutDirection. If the attribute is not set, the layoutDirection() is inherited.
Qt::WA_RightToLeftToggled by setLayoutDirection(). Inherited from the parent/scene. If set, the widget's layout will order horizontally arranged widgets from right to left.
Qt::WA_SetStyleSet and cleared by setStyle(). If this attribute is set, the widget has been explicitly assigned a style. If it is unset, the widget will use the scene's or the application's style.
Qt::WA_ResizedSet by setGeometry() and resize().
Qt::WA_SetPaletteSet by setPalette().
Qt::WA_SetFontSet by setFont().
Qt::WA_WindowPropagationEnables propagation to window widgets.

Although QGraphicsWidget inherits from both QObject and QGraphicsItem, you should use the functions provided by QGraphicsItem, not QObject, to manage the relationships between parent and child items. These functions control the stacking order of items as well as their ownership.

Note: The QObject::parent() should always return 0 for QGraphicsWidgets, but this policy is not strictly defined.

pub unsafe fn new_1a(
    parent: impl CastInto<Ptr<QGraphicsItem>>
) -> QBox<QGraphicsWidget>
[src]

Constructs a QGraphicsWidget instance. The optional parent argument is passed to QGraphicsItem's constructor. The optional wFlags argument specifies the widget's window flags (e.g., whether the widget should be a window, a tool, a popup, etc).

Calls C++ function: [constructor] void QGraphicsWidget::QGraphicsWidget(QGraphicsItem* parent = …).

C++ documentation:

Constructs a QGraphicsWidget instance. The optional parent argument is passed to QGraphicsItem's constructor. The optional wFlags argument specifies the widget's window flags (e.g., whether the widget should be a window, a tool, a popup, etc).

pub unsafe fn paint_3a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>,
    widget: impl CastInto<Ptr<QWidget>>
)
[src]

Reimplemented from QGraphicsItem::paint().

Calls C++ function: virtual void QGraphicsWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = …).

C++ documentation:

Reimplemented from QGraphicsItem::paint().

pub unsafe fn paint_2a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>
)
[src]

Reimplemented from QGraphicsItem::paint().

Calls C++ function: virtual void QGraphicsWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* option).

C++ documentation:

Reimplemented from QGraphicsItem::paint().

pub unsafe fn paint_window_frame_3a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>,
    widget: impl CastInto<Ptr<QWidget>>
)
[src]

This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. The base implementation uses the current style to render the frame and title bar.

Calls C++ function: virtual void QGraphicsWidget::paintWindowFrame(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = …).

C++ documentation:

This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. The base implementation uses the current style to render the frame and title bar.

You can reimplement this function in a subclass of QGraphicsWidget to provide custom rendering of the widget's window frame.

See also QGraphicsItem::paint().

pub unsafe fn paint_window_frame_2a(
    &self,
    painter: impl CastInto<Ptr<QPainter>>,
    option: impl CastInto<Ptr<QStyleOptionGraphicsItem>>
)
[src]

This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. The base implementation uses the current style to render the frame and title bar.

Calls C++ function: virtual void QGraphicsWidget::paintWindowFrame(QPainter* painter, const QStyleOptionGraphicsItem* option).

C++ documentation:

This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. The base implementation uses the current style to render the frame and title bar.

You can reimplement this function in a subclass of QGraphicsWidget to provide custom rendering of the widget's window frame.

See also QGraphicsItem::paint().

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

This property holds the widget's palette

Calls C++ function: QPalette QGraphicsWidget::palette() const.

C++ documentation:

This property holds the widget's palette

This property provides the widget's palette. The palette provides colors and brushes for color groups (e.g., QPalette::Button) and states (e.g., QPalette::Inactive), loosely defining the general look of the widget and its children.

QPalette consists of color groups that have been explicitly defined, and groups that are implicitly inherited from the widget's parent. Because of this, palette() can return a different palette than what has been set with setPalette(). This scheme allows you to define single entries in a palette without affecting the palette's inherited entries.

When a widget's palette changes, it resolves its entries against its parent widget, or if it doesn't have a parent widget, it resolves against the scene. It then sends itself a PaletteChange event, and notifies all its descendants so they can resolve their palettes as well.

By default, this property contains the application's default palette.

Access functions:

QPalette palette() const
void setPalette(const QPalette &palette)

See also QApplication::palette(), QGraphicsScene::palette, and QPalette::resolve().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QGraphicsWidget::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QGraphicsWidget::qt_metacast(const char* arg1).

pub unsafe fn rect(&self) -> CppBox<QRectF>[src]

Returns the item's local rect as a QRectF. This function is equivalent to QRectF(QPointF(), size()).

Calls C++ function: QRectF QGraphicsWidget::rect() const.

C++ documentation:

Returns the item's local rect as a QRectF. This function is equivalent to QRectF(QPointF(), size()).

See also setGeometry() and resize().

pub unsafe fn release_shortcut(&self, id: c_int)[src]

Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).

Calls C++ function: void QGraphicsWidget::releaseShortcut(int id).

C++ documentation:

Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).

Warning: You should not normally need to use this function since Qt's shortcut system removes shortcuts automatically when their parent widget is destroyed. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function. Note also that this is an expensive operation.

This function was introduced in Qt 4.5.

See also grabShortcut(), setShortcutEnabled(), and QWidget::releaseShortcut().

pub unsafe fn remove_action(&self, action: impl CastInto<Ptr<QAction>>)[src]

Removes the action action from this widget's list of actions.

Calls C++ function: void QGraphicsWidget::removeAction(QAction* action).

C++ documentation:

Removes the action action from this widget's list of actions.

This function was introduced in Qt 4.5.

See also insertAction(), actions(), insertAction(), and QWidget::removeAction().

pub unsafe fn resize_1a(&self, size: impl CastInto<Ref<QSizeF>>)[src]

This property holds the size of the widget

Calls C++ function: void QGraphicsWidget::resize(const QSizeF& size).

C++ documentation:

This property holds the size of the widget

Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.

Resizing a widget triggers the widget to immediately receive a GraphicsSceneResize event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.

This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.

By default, this property contains a size with zero width and height.

Access functions:

QSizeF size() const
void resize(const QSizeF &size)
void resize(qreal w, qreal h)

Notifier signal:

See also setGeometry(), QGraphicsSceneResizeEvent, and QGraphicsLayout.

pub unsafe fn resize_2a(&self, w: c_double, h: c_double)[src]

This property holds the size of the widget

Calls C++ function: void QGraphicsWidget::resize(double w, double h).

C++ documentation:

This property holds the size of the widget

Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.

Resizing a widget triggers the widget to immediately receive a GraphicsSceneResize event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.

This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.

By default, this property contains a size with zero width and height.

Access functions:

QSizeF size() const
void resize(const QSizeF &size)
void resize(qreal w, qreal h)

Notifier signal:

See also setGeometry(), QGraphicsSceneResizeEvent, and QGraphicsLayout.

pub unsafe fn set_attribute_2a(&self, attribute: WidgetAttribute, on: bool)[src]

If on is true, this function enables attribute; otherwise attribute is disabled.

Calls C++ function: void QGraphicsWidget::setAttribute(Qt::WidgetAttribute attribute, bool on = …).

C++ documentation:

If on is true, this function enables attribute; otherwise attribute is disabled.

See the class documentation for QGraphicsWidget for a complete list of which attributes are supported, and what they are for.

See also testAttribute() and QWidget::setAttribute().

pub unsafe fn set_attribute_1a(&self, attribute: WidgetAttribute)[src]

If on is true, this function enables attribute; otherwise attribute is disabled.

Calls C++ function: void QGraphicsWidget::setAttribute(Qt::WidgetAttribute attribute).

C++ documentation:

If on is true, this function enables attribute; otherwise attribute is disabled.

See the class documentation for QGraphicsWidget for a complete list of which attributes are supported, and what they are for.

See also testAttribute() and QWidget::setAttribute().

pub unsafe fn set_auto_fill_background(&self, enabled: bool)[src]

This property holds whether the widget background is filled automatically

Calls C++ function: void QGraphicsWidget::setAutoFillBackground(bool enabled).

C++ documentation:

This property holds whether the widget background is filled automatically

If enabled, this property will cause Qt to fill the background of the widget before invoking the paint() method. The color used is defined by the QPalette::Window color role from the widget's palette.

In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.

By default, this property is false.

This property was introduced in Qt 4.7.

Access functions:

bool autoFillBackground() const
void setAutoFillBackground(bool enabled)

See also Qt::WA_OpaquePaintEvent and Qt::WA_NoSystemBackground.

pub unsafe fn set_contents_margins_4a(
    &self,
    left: c_double,
    top: c_double,
    right: c_double,
    bottom: c_double
)
[src]

Sets the widget's contents margins to left, top, right and bottom.

Calls C++ function: void QGraphicsWidget::setContentsMargins(double left, double top, double right, double bottom).

C++ documentation:

Sets the widget's contents margins to left, top, right and bottom.

Contents margins are used by the assigned layout to define the placement of subwidgets and layouts. Margins are particularly useful for widgets that constrain subwidgets to only a section of its own geometry. For example, a group box with a layout will place subwidgets inside its frame, but below the title.

Changing a widget's contents margins will always trigger an update(), and any assigned layout will be activated automatically. The widget will then receive a ContentsRectChange event.

See also getContentsMargins() and setGeometry().

pub unsafe fn set_contents_margins_1a(
    &self,
    margins: impl CastInto<Ref<QMarginsF>>
)
[src]

This is supported on cpp_lib_version="5.14.0" only.

Sets the widget's contents margins to margins.

Calls C++ function: void QGraphicsWidget::setContentsMargins(QMarginsF margins).

C++ documentation:

Sets the widget's contents margins to margins.

Contents margins are used by the assigned layout to define the placement of subwidgets and layouts. Margins are particularly useful for widgets that constrain subwidgets to only a section of its own geometry. For example, a group box with a layout will place subwidgets inside its frame, but below the title.

Changing a widget's contents margins will always trigger an update(), and any assigned layout will be activated automatically. The widget will then receive a ContentsRectChange event.

This function was introduced in Qt 5.14.

See also getContentsMargins() and setGeometry().

pub unsafe fn set_focus_policy(&self, policy: FocusPolicy)[src]

This property holds the way the widget accepts keyboard focus

Calls C++ function: void QGraphicsWidget::setFocusPolicy(Qt::FocusPolicy policy).

C++ documentation:

This property holds the way the widget accepts keyboard focus

The focus policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.

You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).

If you enable a focus policy (i.e., not Qt::NoFocus), QGraphicsWidget will automatically enable the ItemIsFocusable flag. Setting Qt::NoFocus on a widget will clear the ItemIsFocusable flag. If the widget currently has keyboard focus, the widget will automatically lose focus.

Access functions:

Qt::FocusPolicy focusPolicy() const
void setFocusPolicy(Qt::FocusPolicy policy)

See also focusInEvent(), focusOutEvent(), keyPressEvent(), keyReleaseEvent(), and enabled.

pub unsafe fn set_font(&self, font: impl CastInto<Ref<QFont>>)[src]

This property holds the widgets' font

Calls C++ function: void QGraphicsWidget::setFont(const QFont& font).

C++ documentation:

This property holds the widgets' font

This property provides the widget's font.

QFont consists of font properties that have been explicitly defined and properties implicitly inherited from the widget's parent. Hence, font() can return a different font compared to the one set with setFont(). This scheme allows you to define single entries in a font without affecting the font's inherited entries.

When a widget's font changes, it resolves its entries against its parent widget. If the widget does not have a parent widget, it resolves its entries against the scene. The widget then sends itself a FontChange event and notifies all its descendants so that they can resolve their fonts as well.

By default, this property contains the application's default font.

Access functions:

QFont font() const
void setFont(const QFont &font)

See also QApplication::font(), QGraphicsScene::font, and QFont::resolve().

pub unsafe fn set_geometry_1a(&self, rect: impl CastInto<Ref<QRectF>>)[src]

This property holds the geometry of the widget

Calls C++ function: virtual void QGraphicsWidget::setGeometry(const QRectF& rect).

C++ documentation:

This property holds the geometry of the widget

Sets the item's geometry to rect. The item's position and size are modified as a result of calling this function. The item is first moved, then resized.

A side effect of calling this function is that the widget will receive a move event and a resize event. Also, if the widget has a layout assigned, the layout will activate.

Access functions:

virtual void setGeometry(const QRectF &rect)
void setGeometry(qreal x, qreal y, qreal w, qreal h)

Notifier signal:

See also geometry() and resize().

pub unsafe fn set_geometry_4a(
    &self,
    x: c_double,
    y: c_double,
    w: c_double,
    h: c_double
)
[src]

This property holds the geometry of the widget

Calls C++ function: void QGraphicsWidget::setGeometry(double x, double y, double w, double h).

C++ documentation:

This property holds the geometry of the widget

Sets the item's geometry to rect. The item's position and size are modified as a result of calling this function. The item is first moved, then resized.

A side effect of calling this function is that the widget will receive a move event and a resize event. Also, if the widget has a layout assigned, the layout will activate.

Access functions:

virtual void setGeometry(const QRectF &rect)
void setGeometry(qreal x, qreal y, qreal w, qreal h)

Notifier signal:

See also geometry() and resize().

pub unsafe fn set_layout(&self, layout: impl CastInto<Ptr<QGraphicsLayout>>)[src]

Sets the layout for this widget to layout. Any existing layout manager is deleted before the new layout is assigned. If layout is 0, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.

Calls C++ function: void QGraphicsWidget::setLayout(QGraphicsLayout* layout).

C++ documentation:

Sets the layout for this widget to layout. Any existing layout manager is deleted before the new layout is assigned. If layout is 0, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.

All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.

QGraphicsWidget takes ownership of layout.

Note: Setter function for property layout.

See also layout(), QGraphicsLinearLayout::addItem(), and QGraphicsLayout::invalidate().

pub unsafe fn set_layout_direction(&self, direction: LayoutDirection)[src]

This property holds the layout direction for this widget.

Calls C++ function: void QGraphicsWidget::setLayoutDirection(Qt::LayoutDirection direction).

C++ documentation:

This property holds the layout direction for this widget.

This property modifies this widget's and all of its descendants' Qt::WA_RightToLeft attribute. It also sets this widget's Qt::WA_SetLayoutDirection attribute.

The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With Qt::LeftToRight, the layout starts placing subwidgets from the left side of this widget towards the right. Qt::RightToLeft does the opposite - the layout will place widgets starting from the right edge moving towards the left.

Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a LayoutDirectionChange event, and then propagate the new layout direction to all its descendants.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QWidget::layoutDirection and QApplication::layoutDirection.

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

This property holds the widget's palette

Calls C++ function: void QGraphicsWidget::setPalette(const QPalette& palette).

C++ documentation:

This property holds the widget's palette

This property provides the widget's palette. The palette provides colors and brushes for color groups (e.g., QPalette::Button) and states (e.g., QPalette::Inactive), loosely defining the general look of the widget and its children.

QPalette consists of color groups that have been explicitly defined, and groups that are implicitly inherited from the widget's parent. Because of this, palette() can return a different palette than what has been set with setPalette(). This scheme allows you to define single entries in a palette without affecting the palette's inherited entries.

When a widget's palette changes, it resolves its entries against its parent widget, or if it doesn't have a parent widget, it resolves against the scene. It then sends itself a PaletteChange event, and notifies all its descendants so they can resolve their palettes as well.

By default, this property contains the application's default palette.

Access functions:

QPalette palette() const
void setPalette(const QPalette &palette)

See also QApplication::palette(), QGraphicsScene::palette, and QPalette::resolve().

pub unsafe fn set_shortcut_auto_repeat_2a(&self, id: c_int, enabled: bool)[src]

If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

Calls C++ function: void QGraphicsWidget::setShortcutAutoRepeat(int id, bool enabled = …).

C++ documentation:

If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

This function was introduced in Qt 4.5.

See also grabShortcut(), releaseShortcut(), and QWidget::setShortcutAutoRepeat().

pub unsafe fn set_shortcut_auto_repeat_1a(&self, id: c_int)[src]

If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

Calls C++ function: void QGraphicsWidget::setShortcutAutoRepeat(int id).

C++ documentation:

If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.

This function was introduced in Qt 4.5.

See also grabShortcut(), releaseShortcut(), and QWidget::setShortcutAutoRepeat().

pub unsafe fn set_shortcut_enabled_2a(&self, id: c_int, enabled: bool)[src]

If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Calls C++ function: void QGraphicsWidget::setShortcutEnabled(int id, bool enabled = …).

C++ documentation:

If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Warning: You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function.

This function was introduced in Qt 4.5.

See also grabShortcut(), releaseShortcut(), and QWidget::setShortcutEnabled().

pub unsafe fn set_shortcut_enabled_1a(&self, id: c_int)[src]

If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Calls C++ function: void QGraphicsWidget::setShortcutEnabled(int id).

C++ documentation:

If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.

Warning: You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use QAction or QShortcut to handle shortcuts, since they are easier to use than this low-level function.

This function was introduced in Qt 4.5.

See also grabShortcut(), releaseShortcut(), and QWidget::setShortcutEnabled().

pub unsafe fn set_style(&self, style: impl CastInto<Ptr<QStyle>>)[src]

Sets the widget's style to style. QGraphicsWidget does not take ownership of style.

Calls C++ function: void QGraphicsWidget::setStyle(QStyle* style).

C++ documentation:

Sets the widget's style to style. QGraphicsWidget does not take ownership of style.

If no style is assigned, or style is 0, the widget will use QGraphicsScene::style() (if this has been set). Otherwise the widget will use QApplication::style().

This function sets the Qt::WA_SetStyle attribute if style is not 0; otherwise it clears the attribute.

See also style().

pub unsafe fn set_tab_order(
    first: impl CastInto<Ptr<QGraphicsWidget>>,
    second: impl CastInto<Ptr<QGraphicsWidget>>
)
[src]

Moves the second widget around the ring of focus widgets so that keyboard focus moves from the first widget to the second widget when the Tab key is pressed.

Calls C++ function: static void QGraphicsWidget::setTabOrder(QGraphicsWidget* first, QGraphicsWidget* second).

C++ documentation:

Moves the second widget around the ring of focus widgets so that keyboard focus moves from the first widget to the second widget when the Tab key is pressed.

Note that since the tab order of the second widget is changed, you should order a chain like this:

setTabOrder(a, b); // a to b setTabOrder(b, c); // a to b to c setTabOrder(c, d); // a to b to c to d

not like this:

// WRONG setTabOrder(c, d); // c to d setTabOrder(a, b); // a to b AND c to d setTabOrder(b, c); // a to b to c, but not c to d

If first is 0, this indicates that second should be the first widget to receive input focus should the scene gain Tab focus (i.e., the user hits Tab so that focus passes into the scene). If second is 0, this indicates that first should be the first widget to gain focus if the scene gained BackTab focus.

By default, tab order is defined implicitly using widget creation order.

See also focusPolicy and Keyboard Focus in Widgets.

pub unsafe fn set_window_flags(&self, w_flags: QFlags<WindowType>)[src]

This property holds the widget's window flags

Calls C++ function: void QGraphicsWidget::setWindowFlags(QFlags<Qt::WindowType> wFlags).

C++ documentation:

This property holds the widget's window flags

Window flags are a combination of a window type (e.g., Qt::Dialog) and several flags giving hints on the behavior of the window. The behavior is platform-dependent.

By default, this property contains no window flags.

Windows are panels. If you set the Qt::Window flag, the ItemIsPanel flag will be set automatically. If you clear the Qt::Window flag, the ItemIsPanel flag is also cleared. Note that the ItemIsPanel flag can be set independently of Qt::Window.

Access functions:

Qt::WindowFlags windowFlags() const
void setWindowFlags(Qt::WindowFlags wFlags)

See also isWindow() and isPanel().

pub unsafe fn set_window_frame_margins_4a(
    &self,
    left: c_double,
    top: c_double,
    right: c_double,
    bottom: c_double
)
[src]

Sets the widget's window frame margins to left, top, right and bottom. The default frame margins are provided by the style, and they depend on the current window flags.

Calls C++ function: void QGraphicsWidget::setWindowFrameMargins(double left, double top, double right, double bottom).

C++ documentation:

Sets the widget's window frame margins to left, top, right and bottom. The default frame margins are provided by the style, and they depend on the current window flags.

If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.

See also unsetWindowFrameMargins(), getWindowFrameMargins(), and windowFrameRect().

pub unsafe fn set_window_frame_margins_1a(
    &self,
    margins: impl CastInto<Ref<QMarginsF>>
)
[src]

This is supported on cpp_lib_version="5.14.0" only.

Sets the widget's window frame margins to margins. The default frame margins are provided by the style, and they depend on the current window flags.

Calls C++ function: void QGraphicsWidget::setWindowFrameMargins(QMarginsF margins).

C++ documentation:

Sets the widget's window frame margins to margins. The default frame margins are provided by the style, and they depend on the current window flags.

If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.

This function was introduced in Qt 5.14.

See also unsetWindowFrameMargins(), getWindowFrameMargins(), and windowFrameRect().

pub unsafe fn set_window_title(&self, title: impl CastInto<Ref<QString>>)[src]

This property holds the window title (caption).

Calls C++ function: void QGraphicsWidget::setWindowTitle(const QString& title).

C++ documentation:

This property holds the window title (caption).

This property is only used for windows.

By default, if no title has been set, this property contains an empty string.

Access functions:

QString windowTitle() const
void setWindowTitle(const QString &title)

pub unsafe fn shape(&self) -> CppBox<QPainterPath>[src]

Reimplemented from QGraphicsItem::shape().

Calls C++ function: virtual QPainterPath QGraphicsWidget::shape() const.

C++ documentation:

Reimplemented from QGraphicsItem::shape().

pub unsafe fn size(&self) -> CppBox<QSizeF>[src]

This property holds the size of the widget

Calls C++ function: QSizeF QGraphicsWidget::size() const.

C++ documentation:

This property holds the size of the widget

Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.

Resizing a widget triggers the widget to immediately receive a GraphicsSceneResize event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.

This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.

By default, this property contains a size with zero width and height.

Access functions:

QSizeF size() const
void resize(const QSizeF &size)
void resize(qreal w, qreal h)

Notifier signal:

See also setGeometry(), QGraphicsSceneResizeEvent, and QGraphicsLayout.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn style(&self) -> QPtr<QStyle>[src]

Returns a pointer to the widget's style. If this widget does not have any explicitly assigned style, the scene's style is returned instead. In turn, if the scene does not have any assigned style, this function returns QApplication::style().

Calls C++ function: QStyle* QGraphicsWidget::style() const.

C++ documentation:

Returns a pointer to the widget's style. If this widget does not have any explicitly assigned style, the scene's style is returned instead. In turn, if the scene does not have any assigned style, this function returns QApplication::style().

See also setStyle().

pub unsafe fn test_attribute(&self, attribute: WidgetAttribute) -> bool[src]

Returns true if attribute is enabled for this widget; otherwise, returns false.

Calls C++ function: bool QGraphicsWidget::testAttribute(Qt::WidgetAttribute attribute) const.

C++ documentation:

Returns true if attribute is enabled for this widget; otherwise, returns false.

See also setAttribute().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QGraphicsWidget::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QGraphicsWidget::trUtf8(const char* s, const char* c, int n).

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

Reimplemented from QGraphicsItem::type().

Calls C++ function: virtual int QGraphicsWidget::type() const.

C++ documentation:

Reimplemented from QGraphicsItem::type().

pub unsafe fn unset_layout_direction(&self)[src]

This property holds the layout direction for this widget.

Calls C++ function: void QGraphicsWidget::unsetLayoutDirection().

C++ documentation:

This property holds the layout direction for this widget.

This property modifies this widget's and all of its descendants' Qt::WA_RightToLeft attribute. It also sets this widget's Qt::WA_SetLayoutDirection attribute.

The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With Qt::LeftToRight, the layout starts placing subwidgets from the left side of this widget towards the right. Qt::RightToLeft does the opposite - the layout will place widgets starting from the right edge moving towards the left.

Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a LayoutDirectionChange event, and then propagate the new layout direction to all its descendants.

Access functions:

Qt::LayoutDirection layoutDirection() const
void setLayoutDirection(Qt::LayoutDirection direction)
void unsetLayoutDirection()

See also QWidget::layoutDirection and QApplication::layoutDirection.

pub unsafe fn unset_window_frame_margins(&self)[src]

Resets the window frame margins to the default value, provided by the style.

Calls C++ function: void QGraphicsWidget::unsetWindowFrameMargins().

C++ documentation:

Resets the window frame margins to the default value, provided by the style.

See also setWindowFrameMargins(), getWindowFrameMargins(), and windowFrameRect().

pub unsafe fn window_flags(&self) -> QFlags<WindowType>[src]

This property holds the widget's window flags

Calls C++ function: QFlags<Qt::WindowType> QGraphicsWidget::windowFlags() const.

C++ documentation:

This property holds the widget's window flags

Window flags are a combination of a window type (e.g., Qt::Dialog) and several flags giving hints on the behavior of the window. The behavior is platform-dependent.

By default, this property contains no window flags.

Windows are panels. If you set the Qt::Window flag, the ItemIsPanel flag will be set automatically. If you clear the Qt::Window flag, the ItemIsPanel flag is also cleared. Note that the ItemIsPanel flag can be set independently of Qt::Window.

Access functions:

Qt::WindowFlags windowFlags() const
void setWindowFlags(Qt::WindowFlags wFlags)

See also isWindow() and isPanel().

pub unsafe fn window_frame_geometry(&self) -> CppBox<QRectF>[src]

Returns the widget's geometry in parent coordinates including any window frame.

Calls C++ function: QRectF QGraphicsWidget::windowFrameGeometry() const.

C++ documentation:

Returns the widget's geometry in parent coordinates including any window frame.

See also windowFrameRect(), getWindowFrameMargins(), and setWindowFrameMargins().

pub unsafe fn window_frame_rect(&self) -> CppBox<QRectF>[src]

Returns the widget's local rect including any window frame.

Calls C++ function: QRectF QGraphicsWidget::windowFrameRect() const.

C++ documentation:

Returns the widget's local rect including any window frame.

See also windowFrameGeometry(), getWindowFrameMargins(), and setWindowFrameMargins().

pub unsafe fn window_title(&self) -> CppBox<QString>[src]

This property holds the window title (caption).

Calls C++ function: QString QGraphicsWidget::windowTitle() const.

C++ documentation:

This property holds the window title (caption).

This property is only used for windows.

By default, if no title has been set, this property contains an empty string.

Access functions:

QString windowTitle() const
void setWindowTitle(const QString &title)

pub unsafe fn window_type(&self) -> WindowType[src]

Returns the widgets window type.

Calls C++ function: Qt::WindowType QGraphicsWidget::windowType() const.

C++ documentation:

Returns the widgets window type.

See also windowFlags(), isWindow(), and isPanel().

Methods from Deref<Target = QGraphicsObject>

pub fn slot_update_micro_focus(&self) -> Receiver<()>[src]

Updates the item's micro focus. This is slot for convenience.

Returns a built-in Qt slot QGraphicsObject::updateMicroFocus that can be passed to qt_core::Signal::connect.

C++ documentation:

Updates the item's micro focus. This is slot for convenience.

This function was introduced in Qt 4.7.

See also QInputMethod.

pub fn parent_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the parent of the item changes

Returns a built-in Qt signal QGraphicsObject::parentChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the parent of the item changes

Note: Notifier signal for property parent.

pub fn opacity_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the opacity of the item changes

Returns a built-in Qt signal QGraphicsObject::opacityChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the opacity of the item changes

Note: Notifier signal for property opacity.

See also QGraphicsItem::opacity().

pub fn visible_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the visibility of the item changes

Returns a built-in Qt signal QGraphicsObject::visibleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the visibility of the item changes

Note: Notifier signal for property visible.

See also visible.

pub fn enabled_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the item get's enabled or disabled.

Returns a built-in Qt signal QGraphicsObject::enabledChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the item get's enabled or disabled.

Note: Notifier signal for property enabled.

See also isEnabled().

pub fn x_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the x position of the item changes

Returns a built-in Qt signal QGraphicsObject::xChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the x position of the item changes

Note: Notifier signal for property x.

See also pos().

pub fn y_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the y position of the item changes.

Returns a built-in Qt signal QGraphicsObject::yChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the y position of the item changes.

Note: Notifier signal for property y.

See also pos().

pub fn z_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the z value of the item changes.

Returns a built-in Qt signal QGraphicsObject::zChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the z value of the item changes.

Note: Notifier signal for property z.

See also pos().

pub fn rotation_changed(&self) -> Signal<()>[src]

This signal gets emitted whenever the roation of the item changes.

Returns a built-in Qt signal QGraphicsObject::rotationChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal gets emitted whenever the roation of the item changes.

Note: Notifier signal for property rotation.

pub fn scale_changed(&self) -> Signal<()>[src]

This signal is emitted when the scale of the item changes.

Returns a built-in Qt signal QGraphicsObject::scaleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted when the scale of the item changes.

Note: Notifier signal for property scale.

pub fn children_changed(&self) -> Signal<()>[src]

Returns a built-in Qt signal QGraphicsObject::childrenChanged that can be passed to qt_core::Signal::connect.

pub fn width_changed(&self) -> Signal<()>[src]

Returns a built-in Qt signal QGraphicsObject::widthChanged that can be passed to qt_core::Signal::connect.

pub fn height_changed(&self) -> Signal<()>[src]

Returns a built-in Qt signal QGraphicsObject::heightChanged that can be passed to qt_core::Signal::connect.

pub unsafe fn grab_gesture_2a(
    &self,
    type_: GestureType,
    flags: QFlags<GestureFlag>
)
[src]

Subscribes the graphics object to the given gesture with specific flags.

Calls C++ function: void QGraphicsObject::grabGesture(Qt::GestureType type, QFlags<Qt::GestureFlag> flags = …).

C++ documentation:

Subscribes the graphics object to the given gesture with specific flags.

See also ungrabGesture() and QGestureEvent.

pub unsafe fn grab_gesture_1a(&self, type_: GestureType)[src]

Subscribes the graphics object to the given gesture with specific flags.

Calls C++ function: void QGraphicsObject::grabGesture(Qt::GestureType type).

C++ documentation:

Subscribes the graphics object to the given gesture with specific flags.

See also ungrabGesture() and QGestureEvent.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QGraphicsObject::metaObject() const.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QGraphicsObject::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QGraphicsObject::qt_metacast(const char* arg1).

pub unsafe fn ungrab_gesture(&self, type_: GestureType)[src]

Unsubscribes the graphics object from the given gesture.

Calls C++ function: void QGraphicsObject::ungrabGesture(Qt::GestureType type).

C++ documentation:

Unsubscribes the graphics object from the given gesture.

See also grabGesture() and QGestureEvent.

Trait Implementations

impl CppDeletable for QGraphicsWidget[src]

unsafe fn delete(&self)[src]

Destroys the QGraphicsWidget instance.

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

C++ documentation:

Destroys the QGraphicsWidget instance.

impl Deref for QGraphicsWidget[src]

type Target = QGraphicsObject

The resulting type after dereferencing.

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

Calls C++ function: QGraphicsObject* static_cast<QGraphicsObject*>(QGraphicsWidget* ptr).

impl DynamicCast<QGraphicsProxyWidget> for QGraphicsWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsWidget>) -> Ptr<QGraphicsProxyWidget>[src]

Calls C++ function: QGraphicsProxyWidget* dynamic_cast<QGraphicsProxyWidget*>(QGraphicsWidget* ptr).

impl DynamicCast<QGraphicsWidget> for QGraphicsObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsObject>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* dynamic_cast<QGraphicsWidget*>(QGraphicsObject* ptr).

impl DynamicCast<QGraphicsWidget> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* dynamic_cast<QGraphicsWidget*>(QObject* ptr).

impl DynamicCast<QGraphicsWidget> for QGraphicsItem[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsItem>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* dynamic_cast<QGraphicsWidget*>(QGraphicsItem* ptr).

impl DynamicCast<QGraphicsWidget> for QGraphicsLayoutItem[src]

unsafe fn dynamic_cast(ptr: Ptr<QGraphicsLayoutItem>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* dynamic_cast<QGraphicsWidget*>(QGraphicsLayoutItem* ptr).

impl Size for QGraphicsWidget[src]

unsafe fn size(&self) -> usize[src]

This property holds the size of the widget

Calls C++ function: QSizeF QGraphicsWidget::size() const.

C++ documentation:

This property holds the size of the widget

Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.

Resizing a widget triggers the widget to immediately receive a GraphicsSceneResize event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.

This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.

By default, this property contains a size with zero width and height.

Access functions:

QSizeF size() const
void resize(const QSizeF &size)
void resize(qreal w, qreal h)

Notifier signal:

See also setGeometry(), QGraphicsSceneResizeEvent, and QGraphicsLayout.

impl StaticDowncast<QGraphicsProxyWidget> for QGraphicsWidget[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsWidget>
) -> Ptr<QGraphicsProxyWidget>
[src]

Calls C++ function: QGraphicsProxyWidget* static_cast<QGraphicsProxyWidget*>(QGraphicsWidget* ptr).

impl StaticDowncast<QGraphicsWidget> for QGraphicsObject[src]

unsafe fn static_downcast(ptr: Ptr<QGraphicsObject>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* static_cast<QGraphicsWidget*>(QGraphicsObject* ptr).

impl StaticDowncast<QGraphicsWidget> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* static_cast<QGraphicsWidget*>(QObject* ptr).

impl StaticDowncast<QGraphicsWidget> for QGraphicsItem[src]

unsafe fn static_downcast(ptr: Ptr<QGraphicsItem>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* static_cast<QGraphicsWidget*>(QGraphicsItem* ptr).

impl StaticDowncast<QGraphicsWidget> for QGraphicsLayoutItem[src]

unsafe fn static_downcast(ptr: Ptr<QGraphicsLayoutItem>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* static_cast<QGraphicsWidget*>(QGraphicsLayoutItem* ptr).

impl StaticUpcast<QGraphicsItem> for QGraphicsWidget[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsWidget>) -> Ptr<QGraphicsItem>[src]

Calls C++ function: QGraphicsItem* static_cast<QGraphicsItem*>(QGraphicsWidget* ptr).

impl StaticUpcast<QGraphicsLayoutItem> for QGraphicsWidget[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsWidget>) -> Ptr<QGraphicsLayoutItem>[src]

Calls C++ function: QGraphicsLayoutItem* static_cast<QGraphicsLayoutItem*>(QGraphicsWidget* ptr).

impl StaticUpcast<QGraphicsObject> for QGraphicsWidget[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsWidget>) -> Ptr<QGraphicsObject>[src]

Calls C++ function: QGraphicsObject* static_cast<QGraphicsObject*>(QGraphicsWidget* ptr).

impl StaticUpcast<QGraphicsWidget> for QGraphicsProxyWidget[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsProxyWidget>) -> Ptr<QGraphicsWidget>[src]

Calls C++ function: QGraphicsWidget* static_cast<QGraphicsWidget*>(QGraphicsProxyWidget* ptr).

impl StaticUpcast<QObject> for QGraphicsWidget[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsWidget>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QGraphicsWidget* 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.