KWidgetsAddons
kcontextualhelpbutton.h
22 * KContextualHelpButton allows hiding text of any length behind a small icon-only button. Hovering over the button with a mouse cursor or pressing the button
23 * will show the text. It can contain images and links. It is accessible by keyboard and to screen readers.
27 * Sometimes users require help or an explanation, even experts. This help should be readily available exactly where and when a user needs it.
28 * A KContextualHelpButton makes clear that inline help is available without really cluttering up the user interface. In that sense it is superior to setting
29 * tooltips which are completely invisible until invoked and therefore easy to miss. Especially for touch users the KContextualHelpButton is preferable.
33 * If the text is important for the user to understand and can be kept very short, place it inline below the control it affects.
34 * If there is no room to put this KContextualHelpButton, use QWidget::setToolTip() for shorter texts and QWidget::SetWhatsThis() for longer text or text that
35 * should contain hyperlinks. If your software is not already using the KXmlGui framework, consider using KToolTipHelper from KXmlGui to make the whatsThis()
44 * contextualHelpButton->setContextualHelpText(xi18nc("@info", "<para>A nicely formatted help text. Notice the 'para' tags at the side!</para>"));
47 * The most common use of this component might be on settings pages which oftentimes use a QFormLayout.
48 * Here is an example on how to use it next to a QCheckBox. Unfortunately we need to make the KContextualHelpButton aware of the QCheckBox here or it will
57 * "<para>A help text containing an icon <img src=':/icon.png'> and a <a href=\"http://www.kde.org\">link</a>.</para>"),
66 * This class is meant to be kept somewhat consistent with the QML equivalent which is also called ContextualHelpButton.
73 Q_PROPERTY(QString contextualHelpText READ contextualHelpText WRITE setContextualHelpText NOTIFY contextualHelpTextChanged)
77 * @param contextualHelpText The text to show when hovering or clicking this button. Consider formatting this nicely using xi18nc().
78 * @param heightHintWidget The KContextualHelpButton will report the \p heightHintWidget 's sizeHint().height() as its own sizeHint().height().
79 * This is useful to make sure that adding this KContextualHelpButton to a layout will not increase the layout's total height.
80 * @param parent The parent widget that gets ownership over the lifetime of this KContextualHelpButton.
82 explicit KContextualHelpButton(const QString &contextualHelpText, const QWidget *heightHintWidget, QWidget *parent);
90 * Sets the text to show when hovering or pressing this button. Consider formatting the text nicely using xi18nc().
100 * The KContextualHelpButton will report the \p heightHintWidget 's sizeHint().height() as its own sizeHint().height().
An icon-only button for showing contextually relevant help or explanations.
Definition kcontextualhelpbutton.h:71
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
virtual QSize sizeHint() const const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:51 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.