[][src]Struct qt_widgets::QWhatsThis

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

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

C++ class: QWhatsThis.

C++ documentation:

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

"What's This?" help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. "What's This?" help texts are typically longer and more detailed than tooltips, but generally provide less information than that supplied by separate help windows.

QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode.

To add "What's This?" text to a widget or an action, you simply call QWidget::setWhatsThis() or QAction::setWhatsThis().

The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See Qt::mightBeRichText() for details.

newAct = new QAction(tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); newAct->setWhatsThis(tr("Click this option to create a new file."));

An alternative way to enter "What's This?" mode is to call createAction(), and add the returned QAction to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into "What's This?" mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc.

You can enter "What's This?" mode programmatically with enterWhatsThisMode(), check the mode with inWhatsThisMode(), and return to normal mode with leaveWhatsThisMode().

If you want to control the "What's This?" behavior of a widget manually see Qt::WA_CustomWhatsThis.

It is also possible to show different help texts for different regions of a widget, by using a QHelpEvent of type QEvent::WhatsThis. Intercept the help event in your widget's QWidget::event() function and call QWhatsThis::showText() with the text you want to display for the position specified in QHelpEvent::pos(). If the text is rich text and the user clicks on a link, the widget also receives a QWhatsThisClickedEvent with the link's reference as QWhatsThisClickedEvent::href(). If a QWhatsThisClickedEvent is handled (i.e. QWidget::event() returns true), the help window remains visible. Call QWhatsThis::hideText() to hide it explicitly.

Methods

impl QWhatsThis[src]

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

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

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

C++ documentation:

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

"What's This?" help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. "What's This?" help texts are typically longer and more detailed than tooltips, but generally provide less information than that supplied by separate help windows.

QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode.

To add "What's This?" text to a widget or an action, you simply call QWidget::setWhatsThis() or QAction::setWhatsThis().

The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See Qt::mightBeRichText() for details.

newAct = new QAction(tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); newAct->setWhatsThis(tr("Click this option to create a new file."));

An alternative way to enter "What's This?" mode is to call createAction(), and add the returned QAction to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into "What's This?" mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc.

You can enter "What's This?" mode programmatically with enterWhatsThisMode(), check the mode with inWhatsThisMode(), and return to normal mode with leaveWhatsThisMode().

If you want to control the "What's This?" behavior of a widget manually see Qt::WA_CustomWhatsThis.

It is also possible to show different help texts for different regions of a widget, by using a QHelpEvent of type QEvent::WhatsThis. Intercept the help event in your widget's QWidget::event() function and call QWhatsThis::showText() with the text you want to display for the position specified in QHelpEvent::pos(). If the text is rich text and the user clicks on a link, the widget also receives a QWhatsThisClickedEvent with the link's reference as QWhatsThisClickedEvent::href(). If a QWhatsThisClickedEvent is handled (i.e. QWidget::event() returns true), the help window remains visible. Call QWhatsThis::hideText() to hide it explicitly.

pub unsafe fn create_action_1a(
    parent: impl CastInto<Ptr<QObject>>
) -> QPtr<QAction>
[src]

Returns a ready-made QAction, used to invoke "What's This?" context help, with the given parent.

Calls C++ function: static QAction* QWhatsThis::createAction(QObject* parent = …).

C++ documentation:

Returns a ready-made QAction, used to invoke "What's This?" context help, with the given parent.

The returned QAction provides a convenient way to let users enter "What's This?" mode.

pub unsafe fn create_action_0a() -> QPtr<QAction>[src]

Returns a ready-made QAction, used to invoke "What's This?" context help, with the given parent.

Calls C++ function: static QAction* QWhatsThis::createAction().

C++ documentation:

Returns a ready-made QAction, used to invoke "What's This?" context help, with the given parent.

The returned QAction provides a convenient way to let users enter "What's This?" mode.

pub unsafe fn enter_whats_this_mode()[src]

This function switches the user interface into "What's This?" mode. The user interface can be switched back into normal mode by the user (e.g. by them clicking or pressing Esc), or programmatically by calling leaveWhatsThisMode().

Calls C++ function: static void QWhatsThis::enterWhatsThisMode().

C++ documentation:

This function switches the user interface into "What's This?" mode. The user interface can be switched back into normal mode by the user (e.g. by them clicking or pressing Esc), or programmatically by calling leaveWhatsThisMode().

When entering "What's This?" mode, a QEvent of type Qt::EnterWhatsThisMode is sent to all toplevel widgets.

See also inWhatsThisMode() and leaveWhatsThisMode().

pub unsafe fn hide_text()[src]

If a "What's This?" window is showing, this destroys it.

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

C++ documentation:

If a "What's This?" window is showing, this destroys it.

See also showText().

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

Returns true if the user interface is in "What's This?" mode; otherwise returns false.

Calls C++ function: static bool QWhatsThis::inWhatsThisMode().

C++ documentation:

Returns true if the user interface is in "What's This?" mode; otherwise returns false.

See also enterWhatsThisMode().

pub unsafe fn leave_whats_this_mode()[src]

If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwise it does nothing.

Calls C++ function: static void QWhatsThis::leaveWhatsThisMode().

C++ documentation:

If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwise it does nothing.

When leaving "What's This?" mode, a QEvent of type Qt::LeaveWhatsThisMode is sent to all toplevel widgets.

See also enterWhatsThisMode() and inWhatsThisMode().

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

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

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

C++ documentation:

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

"What's This?" help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. "What's This?" help texts are typically longer and more detailed than tooltips, but generally provide less information than that supplied by separate help windows.

QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode.

To add "What's This?" text to a widget or an action, you simply call QWidget::setWhatsThis() or QAction::setWhatsThis().

The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See Qt::mightBeRichText() for details.

newAct = new QAction(tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); newAct->setWhatsThis(tr("Click this option to create a new file."));

An alternative way to enter "What's This?" mode is to call createAction(), and add the returned QAction to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into "What's This?" mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc.

You can enter "What's This?" mode programmatically with enterWhatsThisMode(), check the mode with inWhatsThisMode(), and return to normal mode with leaveWhatsThisMode().

If you want to control the "What's This?" behavior of a widget manually see Qt::WA_CustomWhatsThis.

It is also possible to show different help texts for different regions of a widget, by using a QHelpEvent of type QEvent::WhatsThis. Intercept the help event in your widget's QWidget::event() function and call QWhatsThis::showText() with the text you want to display for the position specified in QHelpEvent::pos(). If the text is rich text and the user clicks on a link, the widget also receives a QWhatsThisClickedEvent with the link's reference as QWhatsThisClickedEvent::href(). If a QWhatsThisClickedEvent is handled (i.e. QWidget::event() returns true), the help window remains visible. Call QWhatsThis::hideText() to hide it explicitly.

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

Shows text as a "What's This?" window, at global position pos. The optional widget argument, w, is used to determine the appropriate screen on multi-head systems.

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

C++ documentation:

Shows text as a "What's This?" window, at global position pos. The optional widget argument, w, is used to determine the appropriate screen on multi-head systems.

See also hideText().

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

Shows text as a "What's This?" window, at global position pos. The optional widget argument, w, is used to determine the appropriate screen on multi-head systems.

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

C++ documentation:

Shows text as a "What's This?" window, at global position pos. The optional widget argument, w, is used to determine the appropriate screen on multi-head systems.

See also hideText().

Trait Implementations

impl CppDeletable for QWhatsThis[src]

unsafe fn delete(&self)[src]

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

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

C++ documentation:

The QWhatsThis class provides a simple description of any widget, i.e. answering the question "What's This?".

"What's This?" help is part of an application's online help system, and provides users with information about the functionality and usage of a particular widget. "What's This?" help texts are typically longer and more detailed than tooltips, but generally provide less information than that supplied by separate help windows.

QWhatsThis provides a single window with an explanatory text that pops up when the user asks "What's This?". The default way for users to ask the question is to move the focus to the relevant widget and press Shift+F1. The help text appears immediately; it goes away as soon as the user does something else. (Note that if there is a shortcut for Shift+F1, this mechanism will not work.) Some dialogs provide a "?" button that users can click to enter "What's This?" mode; they then click the relevant widget to pop up the "What's This?" window. It is also possible to provide a a menu option or toolbar button to switch into "What's This?" mode.

To add "What's This?" text to a widget or an action, you simply call QWidget::setWhatsThis() or QAction::setWhatsThis().

The text can be either rich text or plain text. If you specify a rich text formatted string, it will be rendered using the default stylesheet, making it possible to embed images in the displayed text. To be as fast as possible, the default stylesheet uses a simple method to determine whether the text can be rendered as plain text. See Qt::mightBeRichText() for details.

newAct = new QAction(tr("&New"), this); newAct->setShortcut(tr("Ctrl+N")); newAct->setStatusTip(tr("Create a new file")); newAct->setWhatsThis(tr("Click this option to create a new file."));

An alternative way to enter "What's This?" mode is to call createAction(), and add the returned QAction to either a menu or a tool bar. By invoking this context help action (in the picture below, the button with the arrow and question mark icon) the user switches into "What's This?" mode. If they now click on a widget the appropriate help text is shown. The mode is left when help is given or when the user presses Esc.

You can enter "What's This?" mode programmatically with enterWhatsThisMode(), check the mode with inWhatsThisMode(), and return to normal mode with leaveWhatsThisMode().

If you want to control the "What's This?" behavior of a widget manually see Qt::WA_CustomWhatsThis.

It is also possible to show different help texts for different regions of a widget, by using a QHelpEvent of type QEvent::WhatsThis. Intercept the help event in your widget's QWidget::event() function and call QWhatsThis::showText() with the text you want to display for the position specified in QHelpEvent::pos(). If the text is rich text and the user clicks on a link, the widget also receives a QWhatsThisClickedEvent with the link's reference as QWhatsThisClickedEvent::href(). If a QWhatsThisClickedEvent is handled (i.e. QWidget::event() returns true), the help window remains visible. Call QWhatsThis::hideText() to hide it explicitly.

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.