Skip to content

PythonQt.QtGui.QLabel · declarations 002

Back to PythonQt.QtGui.QLabel

setPixmap

setPixmap(a: Any) -> None

X.setPixmap(a)

Upstream PySide2 reference signatures (binding differences may apply):

setPixmap(self, arg__1: PySide2.QtGui.QPixmap) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setPixmap

setScaledContents

setScaledContents(arg__1: bool) -> None

X.setScaledContents(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setScaledContents(self, arg__1: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setScaledContents

setSelection

setSelection(arg__1: int, arg__2: int) -> None

X.setSelection(arg__1, arg__2)

Supplemental documentation: Qt 5 reference:

void QLabel::setSelection(int start, int length)

Selects text from position start and for length characters.

Note: The textInteractionFlags set on the label need to include either TextSelectableByMouse or TextSelectableByKeyboard.

This function was introduced in Qt 4.7.

See also selectedText().

Upstream PySide2 reference signatures (binding differences may apply):

setSelection(self, arg__1: int, arg__2: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setSelection

setText

setText(a: Any) -> None

X.setText(a)

Upstream PySide2 reference signatures (binding differences may apply):

setText(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setText

setTextFormat

setTextFormat(arg__1: Any) -> None

X.setTextFormat(arg__1)

Upstream PySide2 reference signatures (binding differences may apply):

setTextFormat(self, arg__1: PySide2.QtCore.Qt.TextFormat) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setTextFormat

setTextInteractionFlags

setTextInteractionFlags(arg0: flags) -> None

X.setTextInteractionFlags(flags)

Upstream PySide2 reference signatures (binding differences may apply):

setTextInteractionFlags(self, flags: PySide2.QtCore.Qt.TextInteractionFlags) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setTextInteractionFlags

setWordWrap

setWordWrap(on: bool) -> None

X.setWordWrap(on)

Upstream PySide2 reference signatures (binding differences may apply):

setWordWrap(self, on: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#setWordWrap

sizeHint instance-attribute

sizeHint: QSize

Qt 5 reference:

[override virtual] QSize QLabel::sizeHint() const

Reimplements: QFrame::sizeHint() const.

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#sizeHint

text instance-attribute

text: str

Qt 5 reference:

text : QString

This property holds the label's text

If no text has been set this will return an empty string. Setting the text clears any previous content.

The text will be interpreted either as plain text or as rich text, depending on the text format setting; see setTextFormat(). The default setting is Qt::AutoText; i.e. QLabel will try to auto-detect the format of the text set. See Supported HTML Subset for the definition of rich text.

If a buddy has been set, the buddy mnemonic key is updated from the new text.

Note that QLabel is well-suited to display small rich text documents, such as small documents that get their document specific settings (font, text color, link color) from the label's palette and font properties. For large documents, use QTextEdit in read-only mode instead. QTextEdit can also provide a scroll bar when necessary.

Note: This function enables mouse tracking if text contains rich text.

Access functions:

QString text() const
void setText(const QString \&)

See also setTextFormat(), setBuddy(), and alignment.

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#text

textFormat instance-attribute

textFormat: Any

Qt 5 reference:

textFormat : Qt::TextFormat

This property holds the label's text format

See the Qt::TextFormat enum for an explanation of the possible options.

The default format is Qt::AutoText.

Access functions:

Qt::TextFormat textFormat() const
void setTextFormat(Qt::TextFormat)

See also text().

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#textFormat

textInteractionFlags instance-attribute

textInteractionFlags: Any

Qt 5 reference:

textInteractionFlags : Qt::TextInteractionFlags

Specifies how the label should interact with user input if it displays text.

If the flags contain Qt::LinksAccessibleByKeyboard the focus policy is also automatically set to Qt::StrongFocus. If Qt::TextSelectableByKeyboard is set then the focus policy is set to Qt::ClickFocus.

The default value is Qt::LinksAccessibleByMouse.

This property was introduced in Qt 4.2.

Access functions:

Qt::TextInteractionFlags textInteractionFlags() const
void setTextInteractionFlags(Qt::TextInteractionFlags flags)

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#textInteractionFlags

windowIconChanged

windowIconChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QLabel.windowIconChanged; argument details are not documented.

windowIconTextChanged

windowIconTextChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QLabel.windowIconTextChanged; argument details are not documented.

windowTitleChanged

windowTitleChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QLabel.windowTitleChanged; argument details are not documented.

wordWrap instance-attribute

wordWrap: bool

Qt 5 reference:

wordWrap : bool

This property holds the label's word-wrapping policy

If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all.

By default, word wrap is disabled.

Access functions:

bool wordWrap() const
void setWordWrap(bool on)

See also text.

Source: https://doc.qt.io/archives/qt-5.15/qlabel.html#wordWrap