#include <Libs/Widgets/ctkFittedTextBrowser.h>
|
QScopedPointer< ctkFittedTextBrowserPrivate > | d_ptr |
|
ctkFittedTextBrowser is a QTextBrowser that adapts its height depending on its contents and the width available. It always tries to show the whole contents. ctkFittedTextBrowser doesn't resize itself but acts on the sizeHint, minimumSizeHint and heightForWidth. Here sizeHint() and minimumSizeHint() are the same as ctkFittedTextBrowser always try to show the whole contents.
The widget can further optimize use of available space by collapsing text. If the option is enabled then only a short teaser is shown and the user has to click on "More..." to see the full text.
Definition at line 42 of file ctkFittedTextBrowser.h.
◆ ctkFittedTextBrowser()
ctkFittedTextBrowser::ctkFittedTextBrowser |
( |
QWidget * |
parent = 0 | ) |
|
◆ ~ctkFittedTextBrowser()
virtual ctkFittedTextBrowser::~ctkFittedTextBrowser |
( |
| ) |
|
|
virtual |
◆ anchorClicked
void ctkFittedTextBrowser::anchorClicked |
( |
const QUrl & |
url | ) |
|
|
protectedslot |
◆ collapsed()
bool ctkFittedTextBrowser::collapsed |
( |
| ) |
const |
Show only first line/the full text.
◆ collapsibleText()
Q_INVOKABLE QString ctkFittedTextBrowser::collapsibleText |
( |
| ) |
const |
Return text set by setCollapsibleText.
◆ heightForWidth()
virtual int ctkFittedTextBrowser::heightForWidth |
( |
int |
width | ) |
const |
|
virtual |
Reimplemented for internal reasons.
◆ heightForWidthMayHaveChanged
void ctkFittedTextBrowser::heightForWidthMayHaveChanged |
( |
| ) |
|
|
protectedslot |
◆ hideDetailsText()
QString ctkFittedTextBrowser::hideDetailsText |
( |
| ) |
const |
Text that is displayed at the end of non-collapsed text.
◆ minimumSizeHint()
virtual QSize ctkFittedTextBrowser::minimumSizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented for internal reasons.
◆ resizeEvent()
virtual void ctkFittedTextBrowser::resizeEvent |
( |
QResizeEvent * |
e | ) |
|
|
protectedvirtual |
◆ setCollapsed()
void ctkFittedTextBrowser::setCollapsed |
( |
bool |
collapsed | ) |
|
Show only first line/the full text. Only has effect if collapsible = true.
◆ setCollapsibleHtml
void ctkFittedTextBrowser::setCollapsibleHtml |
( |
const QString & |
text | ) |
|
|
slot |
Set text that can be displayed in a shortened form (collapsed) for saving space.
- See also
- setCollapsibleText
◆ setCollapsiblePlainText
void ctkFittedTextBrowser::setCollapsiblePlainText |
( |
const QString & |
text | ) |
|
|
slot |
Set text that can be displayed in a shortened form (collapsed) for saving space.
- See also
- setCollapsibleText
◆ setCollapsibleText
void ctkFittedTextBrowser::setCollapsibleText |
( |
const QString & |
text | ) |
|
|
slot |
Set text that can be displayed in a shortened form (collapsed) for saving space, by only showing first line with "More..." link appended. When the user clicks on the link then the full text is displayed (and a "Less..." link). The teaser is the beginning of the text up to the first newline character (for plain text) or
tag (for html). The separator is removed when the text is expanded so that the full text can continue on the same line as the teaser.
The text can be plain text or HTML and the the right format will be guessed. Use setCollapsedHtml() or setCollapsedPlainText() directly to avoid guessing.
◆ setHideDetailsText()
void ctkFittedTextBrowser::setHideDetailsText |
( |
const QString & |
text | ) |
|
Text that is displayed at the end of non-collapsed text. Clicking on the text collapses the widget.
◆ setShowDetailsText()
void ctkFittedTextBrowser::setShowDetailsText |
( |
const QString & |
text | ) |
|
Text that is displayed at the end of collapsed text. Clicking on the text expands the widget.
◆ showDetailsText()
QString ctkFittedTextBrowser::showDetailsText |
( |
| ) |
const |
Text that is displayed at the end of collapsed text.
◆ sizeHint()
virtual QSize ctkFittedTextBrowser::sizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented for internal reasons.
◆ d_ptr
QScopedPointer<ctkFittedTextBrowserPrivate> ctkFittedTextBrowser::d_ptr |
|
protected |
◆ collapsed
bool ctkFittedTextBrowser::collapsed |
|
readwrite |
◆ hideDetailsText
QString ctkFittedTextBrowser::hideDetailsText |
|
readwrite |
◆ showDetailsText
QString ctkFittedTextBrowser::showDetailsText |
|
readwrite |
The documentation for this class was generated from the following file: