Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
AboutLabel Class Reference

#include <aboutdialog.h>

+ Inheritance diagram for AboutLabel:
+ Collaboration diagram for AboutLabel:

Public Member Functions

 AboutLabel (QWidget *parent=nullptr)
 
void setText (const QString &text, const QByteArray &resources)
 
QSize minimumSizeHint () const override
 
- Public Member Functions inherited from QTextBrowser
 QTextBrowser (QWidget *parent=nullptr)
 Constructs an empty QTextBrowser with parent parent.
 
virtual ~QTextBrowser ()
 
QUrl source () const
 
QTextDocument::ResourceType sourceType () const
 
QStringList searchPaths () const
 
void setSearchPaths (const QStringList &paths)
 
bool isBackwardAvailable () const
 
bool isForwardAvailable () const
 
void clearHistory ()
 
QString historyTitle (int) const
 Returns the documentTitle() of the HistoryItem.
 
QUrl historyUrl (int) const
 Returns the url of the HistoryItem.
 
int backwardHistoryCount () const
 Returns the number of locations backward in the history.
 
int forwardHistoryCount () const
 Returns the number of locations forward in the history.
 
bool openExternalLinks () const
 
void setOpenExternalLinks (bool open)
 
bool openLinks () const
 
void setOpenLinks (bool open)
 
- Public Member Functions inherited from QTextEdit
 QTextEdit (QWidget *parent=nullptr)
 Constructs an empty QTextEdit with parent parent.
 
 QTextEdit (const QString &text, QWidget *parent=nullptr)
 Constructs a QTextEdit with parent parent.
 
virtual ~QTextEdit ()
 Destructor.
 
void setDocument (QTextDocument *document)
 
QTextDocumentdocument () const
 
void setPlaceholderText (const QString &placeholderText)
 
QString placeholderText () const
 
void setTextCursor (const QTextCursor &cursor)
 Sets the visible cursor.
 
QTextCursor textCursor () const
 Returns a copy of the QTextCursor that represents the currently visible cursor.
 
bool isReadOnly () const
 
void setReadOnly (bool ro)
 
void setTextInteractionFlags (Qt::TextInteractionFlags flags)
 
Qt::TextInteractionFlags textInteractionFlags () const
 
qreal fontPointSize () const
 Returns the point size of the font of the current format.
 
QString fontFamily () const
 Returns the font family of the current format.
 
int fontWeight () const
 Returns the font weight of the current format.
 
bool fontUnderline () const
 Returns true if the font of the current format is underlined; otherwise returns false.
 
bool fontItalic () const
 Returns true if the font of the current format is italic; otherwise returns false.
 
QColor textColor () const
 Returns the text color of the current format.
 
QColor textBackgroundColor () const
 
QFont currentFont () const
 Returns the font of the current format.
 
Qt::Alignment alignment () const
 Returns the alignment of the current paragraph.
 
void mergeCurrentCharFormat (const QTextCharFormat &modifier)
 Merges the properties specified in modifier into the current character format by calling QTextCursor::mergeCharFormat on the editor's cursor.
 
void setCurrentCharFormat (const QTextCharFormat &format)
 Sets the char format that is be used when inserting new text to format by calling QTextCursor::setCharFormat() on the editor's cursor.
 
QTextCharFormat currentCharFormat () const
 Returns the char format that is used when inserting new text.
 
AutoFormatting autoFormatting () const
 
void setAutoFormatting (AutoFormatting features)
 
bool tabChangesFocus () const
 
void setTabChangesFocus (bool b)
 
void setDocumentTitle (const QString &title)
 
QString documentTitle () const
 
bool isUndoRedoEnabled () const
 
void setUndoRedoEnabled (bool enable)
 
LineWrapMode lineWrapMode () const
 
void setLineWrapMode (LineWrapMode mode)
 
int lineWrapColumnOrWidth () const
 
void setLineWrapColumnOrWidth (int w)
 
QTextOption::WrapMode wordWrapMode () const
 the mode QTextEdit will use when wrapping text by words
 
void setWordWrapMode (QTextOption::WrapMode policy)
 
bool find (const QString &exp, QTextDocument::FindFlags options=QTextDocument::FindFlags())
 Finds the next occurrence of the string, exp, using the given options.
 
QString toPlainText () const
 QString QTextEdit::toPlainText() const.
 
QString toHtml () const
 
void ensureCursorVisible ()
 Ensures that the cursor is visible by scrolling the text edit if necessary.
 
QMenucreateStandardContextMenu ()
 \reimp
 
QMenucreateStandardContextMenu (const QPoint &position)
 
QTextCursor cursorForPosition (const QPoint &pos) const
 returns a QTextCursor at position pos (in viewport coordinates).
 
QRect cursorRect (const QTextCursor &cursor) const
 returns a rectangle (in viewport coordinates) that includes the cursor.
 
QRect cursorRect () const
 returns a rectangle (in viewport coordinates) that includes the cursor of the text edit.
 
QString anchorAt (const QPoint &pos) const
 Returns the reference of the anchor at position pos, or an empty string if no anchor exists at that point.
 
bool overwriteMode () const
 
void setOverwriteMode (bool overwrite)
 
qreal tabStopDistance () const
 
void setTabStopDistance (qreal distance)
 
int cursorWidth () const
 
void setCursorWidth (int width)
 
bool acceptRichText () const
 
void setAcceptRichText (bool accept)
 
void setExtraSelections (const QList< ExtraSelection > &selections)
 \variable QTextEdit::ExtraSelection::cursor A cursor that contains a selection in a QTextDocument
 
QList< ExtraSelectionextraSelections () const
 
void moveCursor (QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
 
bool canPaste () const
 
void print (QPagedPaintDevice *printer) const
 
QVariant inputMethodQuery (Qt::InputMethodQuery property) const override
 \reimp
 
Q_INVOKABLE QVariant inputMethodQuery (Qt::InputMethodQuery query, QVariant argument) const
 

Private Member Functions

QVariant loadResource (int type, const QUrl &name) override
 This function is called when the document is loaded and for each image in the document.
 
void doSetSource (const QUrl &name, QTextDocument::ResourceType type) override
 Attempts to load the document at the given url with the specified type.
 

Additional Inherited Members

- Public Types inherited from QTextEdit
enum  LineWrapMode { NoWrap , WidgetWidth , FixedPixelWidth , FixedColumnWidth }
 \value NoWrap \value WidgetWidth \value FixedPixelWidth \value FixedColumnWidth More...
 
enum  AutoFormattingFlag { AutoNone = 0 , AutoBulletList = 0x00000001 , AutoAll = 0xffffffff }
 \value AutoNone Don't do any automatic formatting. More...
 
- Public Slots inherited from QTextBrowser
void setSource (const QUrl &name, QTextDocument::ResourceType type=QTextDocument::UnknownResource)
 Attempts to load the document at the given url with the specified type.
 
virtual void backward ()
 Changes the document displayed to the previous document in the list of documents built by navigating links.
 
virtual void forward ()
 Changes the document displayed to the next document in the list of documents built by navigating links.
 
virtual void home ()
 Changes the document displayed to be the first document from the history.
 
virtual void reload ()
 Reloads the current set source.
 
- Public Slots inherited from QTextEdit
void setFontPointSize (qreal s)
 Sets the point size of the current format to s.
 
void setFontFamily (const QString &fontFamily)
 Sets the font family of the current format to fontFamily.
 
void setFontWeight (int w)
 Sets the font weight of the current format to the given weight, where the value used is in the range defined by the QFont::Weight enum.
 
void setFontUnderline (bool b)
 If underline is true, sets the current format to underline; otherwise sets the current format to non-underline.
 
void setFontItalic (bool b)
 If italic is true, sets the current format to italic; otherwise sets the current format to non-italic.
 
void setTextColor (const QColor &c)
 Sets the text color of the current format to c.
 
void setTextBackgroundColor (const QColor &c)
 
void setCurrentFont (const QFont &f)
 Sets the font of the current format to f.
 
void setAlignment (Qt::Alignment a)
 Sets the alignment of the current paragraph to a.
 
void setPlainText (const QString &text)
 Changes the text of the text edit to the string text.
 
void setHtml (const QString &text)
 
void setText (const QString &text)
 
void cut ()
 Copies the selected text to the clipboard and deletes it from the text edit.
 
void copy ()
 Copies any selected text to the clipboard.
 
void paste ()
 Pastes the text from the clipboard into the text edit at the current cursor position.
 
void undo ()
 
void redo ()
 
void clear ()
 Deletes all the text in the text edit.
 
void selectAll ()
 Selects all text.
 
void insertPlainText (const QString &text)
 Convenience slot that inserts text at the current cursor position.
 
void insertHtml (const QString &text)
 Convenience slot that inserts text which is assumed to be of html formatting at the current cursor position.
 
void append (const QString &text)
 Appends a new paragraph with text to the end of the text edit.
 
void scrollToAnchor (const QString &name)
 Scrolls the text edit so that the anchor with the given name is visible; does nothing if the name is empty, or is already visible, or isn't found.
 
void zoomIn (int range=1)
 Zooms in on the text by making the base font size range points larger and recalculating all font sizes to be the new size.
 
void zoomOut (int range=1)
 Zooms out on the text by making the base font size range points smaller and recalculating all font sizes to be the new size.
 
- Signals inherited from QTextBrowser
void backwardAvailable (bool)
 This signal is emitted when the availability of backward() changes.
 
void forwardAvailable (bool)
 This signal is emitted when the availability of forward() changes.
 
void historyChanged ()
 
void sourceChanged (const QUrl &)
 This signal is emitted when the source has changed, src being the new source.
 
void highlighted (const QUrl &)
 This signal is emitted when the user has selected but not activated an anchor in the document.
 
void anchorClicked (const QUrl &)
 This signal is emitted when the user clicks an anchor.
 
- Signals inherited from QTextEdit
void textChanged ()
 This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied.
 
void undoAvailable (bool b)
 This signal is emitted whenever undo operations become available (available is true) or unavailable (available is false).
 
void redoAvailable (bool b)
 This signal is emitted whenever redo operations become available (available is true) or unavailable (available is false).
 
void currentCharFormatChanged (const QTextCharFormat &format)
 This signal is emitted if the current character format has changed, for example caused by a change of the cursor position.
 
void copyAvailable (bool b)
 This signal is emitted when text is selected or de-selected in the text edit.
 
void selectionChanged ()
 This signal is emitted whenever the selection changes.
 
void cursorPositionChanged ()
 This signal is emitted whenever the position of the cursor changed.
 
- Protected Member Functions inherited from QTextBrowser
bool event (QEvent *e) override
 \reimp
 
virtual void keyPressEvent (QKeyEvent *ev) override
 The event ev is used to provide the following keyboard shortcuts: \table \header.
 
virtual void mouseMoveEvent (QMouseEvent *ev) override
 \reimp
 
virtual void mousePressEvent (QMouseEvent *ev) override
 \reimp
 
virtual void mouseReleaseEvent (QMouseEvent *ev) override
 \reimp
 
virtual void focusOutEvent (QFocusEvent *ev) override
 \reimp
 
virtual bool focusNextPrevChild (bool next) override
 \reimp
 
virtual void paintEvent (QPaintEvent *e) override
 \reimp
 
- Protected Member Functions inherited from QTextEdit
virtual void timerEvent (QTimerEvent *e) override
 
virtual void keyReleaseEvent (QKeyEvent *e) override
 \reimp
 
virtual void resizeEvent (QResizeEvent *e) override
 \reimp
 
virtual void mouseDoubleClickEvent (QMouseEvent *e) override
 \reimp
 
virtual void contextMenuEvent (QContextMenuEvent *e) override
 Shows the standard context menu created with createStandardContextMenu().
 
virtual void focusInEvent (QFocusEvent *e) override
 \reimp
 
virtual void showEvent (QShowEvent *) override
 \reimp
 
virtual void changeEvent (QEvent *e) override
 \reimp
 
virtual QMimeDatacreateMimeDataFromSelection () const
 This function returns a new MIME data object to represent the contents of the text edit's current selection.
 
virtual bool canInsertFromMimeData (const QMimeData *source) const
 This function returns true if the contents of the MIME data object, specified by source, can be decoded and inserted into the document.
 
virtual void insertFromMimeData (const QMimeData *source)
 This function inserts the contents of the MIME data object, specified by source, into the text edit at the current cursor position.
 
virtual void inputMethodEvent (QInputMethodEvent *) override
 \reimp
 
 QTextEdit (QTextEditPrivate &dd, QWidget *parent)
 
virtual void scrollContentsBy (int dx, int dy) override
 \reimp
 
virtual void doSetTextCursor (const QTextCursor &cursor)
 
void zoomInF (float range)
 
- Properties inherited from QTextBrowser
QUrl source
 the name of the displayed document.
 
QTextDocument::ResourceType sourceType
 the type of the displayed document
 
QStringList searchPaths
 the search paths used by the text browser to find supporting content
 
bool openExternalLinks
 
bool openLinks
 
- Properties inherited from QTextEdit
AutoFormatting autoFormatting
 the enabled set of auto formatting features
 
bool tabChangesFocus
 whether \uicontrol Tab changes focus or is accepted as input
 
QString documentTitle
 the title of the document parsed from the text.
 
bool undoRedoEnabled
 whether undo and redo are enabled.
 
LineWrapMode lineWrapMode
 the line wrap mode
 
int lineWrapColumnOrWidth
 the position (in pixels or columns depending on the wrap mode) where text will be wrapped
 
bool readOnly
 whether the text edit is read-only
 
QString html
 This property provides an HTML interface to the text of the text edit.
 
QString plainText
 the text editor's contents as plain text.
 
bool overwriteMode
 whether text entered by the user will overwrite existing text
 
qreal tabStopDistance
 the tab stop distance in pixels
 
bool acceptRichText
 whether the text edit accepts rich text insertions by the user
 
int cursorWidth
 
Qt::TextInteractionFlags textInteractionFlags
 
QTextDocumentdocument
 the underlying document of the text editor.
 
QString placeholderText
 the editor placeholder text
 

Detailed Description

Definition at line 19 of file aboutdialog.h.

Constructor & Destructor Documentation

◆ AboutLabel()

QT_BEGIN_NAMESPACE AboutLabel::AboutLabel ( QWidget * parent = nullptr)

Definition at line 21 of file aboutdialog.cpp.

References QObjectData::parent.

Member Function Documentation

◆ doSetSource()

void AboutLabel::doSetSource ( const QUrl & url,
QTextDocument::ResourceType type )
overrideprivatevirtual

Attempts to load the document at the given url with the specified type.

setSource() calls doSetSource. In Qt 5, setSource(const QUrl &url) was virtual. In Qt 6, doSetSource() is virtual instead, so that it can be overridden in subclasses.

Reimplemented from QTextBrowser.

Definition at line 59 of file aboutdialog.cpp.

◆ loadResource()

QVariant AboutLabel::loadResource ( int type,
const QUrl & name )
overrideprivatevirtual

This function is called when the document is loaded and for each image in the document.

The type indicates the type of resource to be loaded. An invalid QVariant is returned if the resource cannot be loaded.

The default implementation ignores type and tries to locate the resources by interpreting name as a file name. If it is not an absolute path it tries to find the file in the paths of the \l searchPaths property and in the same directory as the current source. On success, the result is a QVariant that stores a QByteArray with the contents of the file.

If you reimplement this function, you can return other QVariant types. The table below shows which variant types are supported depending on the resource type:

\table \header

Reimplemented from QTextBrowser.

Definition at line 48 of file aboutdialog.cpp.

◆ minimumSizeHint()

QSize AboutLabel::minimumSizeHint ( ) const
override

Definition at line 40 of file aboutdialog.cpp.

◆ setText()

void AboutLabel::setText ( const QString & text,
const QByteArray & resources )

Definition at line 31 of file aboutdialog.cpp.


The documentation for this class was generated from the following files: