[][src]Struct qt_widgets::QToolTip

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

The QToolTip class provides tool tips (balloon help) for any widget.

C++ class: QToolTip.

C++ documentation:

The QToolTip class provides tool tips (balloon help) for any widget.

The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.

Rich text displayed in a tool tip is implicitly word-wrapped unless specified differently with <p style='white-space:pre'>.

The simplest and most common way to set a widget's tool tip is by calling its QWidget::setToolTip() function.

It is also possible to show different tool tips for different regions of a widget, by using a QHelpEvent of type QEvent::ToolTip. Intercept the help event in your widget's event() function and call QToolTip::showText() with the text you want to display. The Tooltips example illustrates this technique.

If you are calling QToolTip::hideText(), or QToolTip::showText() with an empty string, as a result of a ToolTip-event you should also call ignore() on the event, to signal that you don't want to start any tooltip specific modes.

Note that, if you want to show tooltips in an item view, the model/view architecture provides functionality to set an item's tool tip; e.g., the QTableWidgetItem::setToolTip() function. However, if you want to provide custom tool tips in an item view, you must intercept the help event in the QAbstractItemView::viewportEvent() function and handle it yourself.

The default tool tip color and font can be customized with setPalette() and setFont(). When a tooltip is currently on display, isVisible() returns true and text() the currently visible text.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

Methods

impl QToolTip[src]

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

The QToolTip class provides tool tips (balloon help) for any widget.

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

C++ documentation:

The QToolTip class provides tool tips (balloon help) for any widget.

The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.

Rich text displayed in a tool tip is implicitly word-wrapped unless specified differently with <p style='white-space:pre'>.

The simplest and most common way to set a widget's tool tip is by calling its QWidget::setToolTip() function.

It is also possible to show different tool tips for different regions of a widget, by using a QHelpEvent of type QEvent::ToolTip. Intercept the help event in your widget's event() function and call QToolTip::showText() with the text you want to display. The Tooltips example illustrates this technique.

If you are calling QToolTip::hideText(), or QToolTip::showText() with an empty string, as a result of a ToolTip-event you should also call ignore() on the event, to signal that you don't want to start any tooltip specific modes.

Note that, if you want to show tooltips in an item view, the model/view architecture provides functionality to set an item's tool tip; e.g., the QTableWidgetItem::setToolTip() function. However, if you want to provide custom tool tips in an item view, you must intercept the help event in the QAbstractItemView::viewportEvent() function and handle it yourself.

The default tool tip color and font can be customized with setPalette() and setFont(). When a tooltip is currently on display, isVisible() returns true and text() the currently visible text.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

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

Returns the font used to render tooltips.

Calls C++ function: static QFont QToolTip::font().

C++ documentation:

Returns the font used to render tooltips.

This function was introduced in Qt 4.2.

See also setFont().

pub unsafe fn hide_text()[src]

Hides the tool tip. This is the same as calling showText() with an empty string.

Calls C++ function: static void QToolTip::hideText().

C++ documentation:

Hides the tool tip. This is the same as calling showText() with an empty string.

This function was introduced in Qt 4.2.

See also showText().

pub unsafe fn is_visible() -> bool[src]

Returns true if this tooltip is currently shown.

Calls C++ function: static bool QToolTip::isVisible().

C++ documentation:

Returns true if this tooltip is currently shown.

This function was introduced in Qt 4.4.

See also showText().

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

The QToolTip class provides tool tips (balloon help) for any widget.

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

C++ documentation:

The QToolTip class provides tool tips (balloon help) for any widget.

The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.

Rich text displayed in a tool tip is implicitly word-wrapped unless specified differently with <p style='white-space:pre'>.

The simplest and most common way to set a widget's tool tip is by calling its QWidget::setToolTip() function.

It is also possible to show different tool tips for different regions of a widget, by using a QHelpEvent of type QEvent::ToolTip. Intercept the help event in your widget's event() function and call QToolTip::showText() with the text you want to display. The Tooltips example illustrates this technique.

If you are calling QToolTip::hideText(), or QToolTip::showText() with an empty string, as a result of a ToolTip-event you should also call ignore() on the event, to signal that you don't want to start any tooltip specific modes.

Note that, if you want to show tooltips in an item view, the model/view architecture provides functionality to set an item's tool tip; e.g., the QTableWidgetItem::setToolTip() function. However, if you want to provide custom tool tips in an item view, you must intercept the help event in the QAbstractItemView::viewportEvent() function and handle it yourself.

The default tool tip color and font can be customized with setPalette() and setFont(). When a tooltip is currently on display, isVisible() returns true and text() the currently visible text.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

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

Returns the palette used to render tooltips.

Calls C++ function: static QPalette QToolTip::palette().

C++ documentation:

Returns the palette used to render tooltips.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

See also setPalette().

pub unsafe fn set_font(arg1: impl CastInto<Ref<QFont>>)[src]

Sets the font used to render tooltips.

Calls C++ function: static void QToolTip::setFont(const QFont& arg1).

C++ documentation:

Sets the font used to render tooltips.

This function was introduced in Qt 4.2.

See also font().

pub unsafe fn set_palette(arg1: impl CastInto<Ref<QPalette>>)[src]

Sets the palette used to render tooltips.

Calls C++ function: static void QToolTip::setPalette(const QPalette& arg1).

C++ documentation:

Sets the palette used to render tooltips.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

This function was introduced in Qt 4.2.

See also palette().

pub unsafe fn show_text_3a(
    pos: impl CastInto<Ref<QPoint>>,
    text: impl CastInto<Ref<QString>>,
    w: impl CastInto<Ptr<QWidget>>
)
[src]

This is an overloaded function.

Calls C++ function: static void QToolTip::showText(const QPoint& pos, const QString& text, QWidget* w = …).

C++ documentation:

This is an overloaded function.

This is analogous to calling QToolTip::showText(pos, text, w, QRect())

pub unsafe fn show_text_4a(
    pos: impl CastInto<Ref<QPoint>>,
    text: impl CastInto<Ref<QString>>,
    w: impl CastInto<Ptr<QWidget>>,
    rect: impl CastInto<Ref<QRect>>
)
[src]

Shows text as a tool tip, with the global position pos as the point of interest. The tool tip will be shown with a platform specific offset from this point of interest.

Calls C++ function: static void QToolTip::showText(const QPoint& pos, const QString& text, QWidget* w, const QRect& rect).

C++ documentation:

Shows text as a tool tip, with the global position pos as the point of interest. The tool tip will be shown with a platform specific offset from this point of interest.

If you specify a non-empty rect the tip will be hidden as soon as you move your cursor out of this area.

The rect is in the coordinates of the widget you specify with w. If the rect is not empty you must specify a widget. Otherwise this argument can be 0 but it is used to determine the appropriate screen on multi-head systems.

If text is empty the tool tip is hidden. If the text is the same as the currently shown tooltip, the tip will not move. You can force moving by first hiding the tip with an empty text, and then showing the new tip at the new position.

pub unsafe fn show_text_5a(
    pos: impl CastInto<Ref<QPoint>>,
    text: impl CastInto<Ref<QString>>,
    w: impl CastInto<Ptr<QWidget>>,
    rect: impl CastInto<Ref<QRect>>,
    msec_show_time: c_int
)
[src]

This is an overloaded function.

Calls C++ function: static void QToolTip::showText(const QPoint& pos, const QString& text, QWidget* w, const QRect& rect, int msecShowTime).

C++ documentation:

This is an overloaded function.

This is similar to QToolTip::showText(pos, text, w, rect) but with an extra parameter msecDisplayTime that specifies how long the tool tip will be displayed, in milliseconds.

This function was introduced in Qt 5.2.

pub unsafe fn show_text_2a(
    pos: impl CastInto<Ref<QPoint>>,
    text: impl CastInto<Ref<QString>>
)
[src]

This is an overloaded function.

Calls C++ function: static void QToolTip::showText(const QPoint& pos, const QString& text).

C++ documentation:

This is an overloaded function.

This is analogous to calling QToolTip::showText(pos, text, w, QRect())

pub unsafe fn text() -> CppBox<QString>[src]

Returns the tooltip text, if a tooltip is visible, or an empty string if a tooltip is not visible.

Calls C++ function: static QString QToolTip::text().

C++ documentation:

Returns the tooltip text, if a tooltip is visible, or an empty string if a tooltip is not visible.

This function was introduced in Qt 4.4.

Trait Implementations

impl CppDeletable for QToolTip[src]

unsafe fn delete(&self)[src]

The QToolTip class provides tool tips (balloon help) for any widget.

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

C++ documentation:

The QToolTip class provides tool tips (balloon help) for any widget.

The tip is a short piece of text reminding the user of the widget's function. It is drawn immediately below the given position in a distinctive black-on-yellow color combination. The tip can be any rich text formatted string.

Rich text displayed in a tool tip is implicitly word-wrapped unless specified differently with <p style='white-space:pre'>.

The simplest and most common way to set a widget's tool tip is by calling its QWidget::setToolTip() function.

It is also possible to show different tool tips for different regions of a widget, by using a QHelpEvent of type QEvent::ToolTip. Intercept the help event in your widget's event() function and call QToolTip::showText() with the text you want to display. The Tooltips example illustrates this technique.

If you are calling QToolTip::hideText(), or QToolTip::showText() with an empty string, as a result of a ToolTip-event you should also call ignore() on the event, to signal that you don't want to start any tooltip specific modes.

Note that, if you want to show tooltips in an item view, the model/view architecture provides functionality to set an item's tool tip; e.g., the QTableWidgetItem::setToolTip() function. However, if you want to provide custom tool tips in an item view, you must intercept the help event in the QAbstractItemView::viewportEvent() function and handle it yourself.

The default tool tip color and font can be customized with setPalette() and setFont(). When a tooltip is currently on display, isVisible() returns true and text() the currently visible text.

Note: Tool tips use the inactive color group of QPalette, because tool tips are not active windows.

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.