KWidgetsAddons
kcontextualhelpbutton.cpp
23 explicit KContextualHelpButtonPrivate(KContextualHelpButton *q, const QString &contextualHelpText, const QWidget *heightHintWidget);
41 * @param fallbackSize Used as the width. Also used as the height if there is no m_heightHintWidget.
58KContextualHelpButton::KContextualHelpButton(const QString &contextualHelpText, const QWidget *heightHintWidget, QWidget *parent)
69KContextualHelpButtonPrivate::KContextualHelpButtonPrivate(KContextualHelpButton *q, const QString &contextualHelpText, const QWidget *heightHintWidget)
76 // i18n: This text will only ever be read by assistive technology like screen readers for visually-impaired. It shows up nowhere on the visible user
77 // interface. Usually we start button labels with a verb, however the help text contained within this button will automatically be read by the screen
78 // reader without requiring additional user input. In this sense the label here is more of an announcement that the text read afterwards is help relevant
81 q_ptr->setAttribute(Qt::WidgetAttribute::WA_CustomWhatsThis); // Makes sure clicking this button in whatsThisMode triggers it instead of doing nothing.
89 m_popupLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); // Makes the label and links within it keyboard-accessible.
109 q_ptr->setAccessibleDescription(QTextDocumentFragment::fromHtml(contextualHelpText).toPlainText()); // Makes sure html tags aren't read out.
151 return {fallbackSize.width(), m_heightHintWidget ? m_heightHintWidget->sizeHint().height() : fallbackSize.height()};
An icon-only button for showing contextually relevant help or explanations.
Definition kcontextualhelpbutton.h:71
KContextualHelpButton(const QString &contextualHelpText, const QWidget *heightHintWidget, QWidget *parent)
Definition kcontextualhelpbutton.cpp:58
void setHeightHintWidget(const QWidget *heightHintWidget)
The KContextualHelpButton will report the heightHintWidget 's sizeHint().height() as its own sizeHint...
Definition kcontextualhelpbutton.cpp:124
void setContextualHelpText(const QString &contextualHelpText)
Sets the text to show when hovering or pressing this button.
Definition kcontextualhelpbutton.cpp:98
QSize sizeHint() const override
This override is an implementation detail of setHeightHintWidget()
Definition kcontextualhelpbutton.cpp:144
const QWidget * heightHintWidget() const
Definition kcontextualhelpbutton.cpp:134
QIcon fromTheme(const QString &name)
text
void setWordWrap(bool on)
QString tr(const char *sourceText, const char *disambiguation, int n)
int height() const const
int width() const const
WhatsThisCursor
TextBrowserInteraction
QTextDocumentFragment fromHtml(const QString &text, const QTextDocument *resourceProvider)
InstantPopup
virtual QSize sizeHint() const const override
void setAccessibleDescription(const QString &description)
void setCursor(const QCursor &)
toolTip
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.