com.trolltech.qt.gui
Class QLabel

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.core.QObject
              extended by com.trolltech.qt.gui.QWidget
                  extended by com.trolltech.qt.gui.QFrame
                      extended by com.trolltech.qt.gui.QLabel
All Implemented Interfaces:
QPaintDeviceInterface, QtJambiInterface

public class QLabel
extends QFrame

The QLabel widget provides a text or image display.

QLabel is used for displaying text or an image. No user interaction functionality is provided. The visual appearance of the label can be configured in various ways, and it can be used for specifying a focus mnemonic key for another widget.

A QLabel can contain any of the following content types:

ContentSetting
Plain textPass a QString to setText.
Rich textPass a QString that contains rich text to setText.
A pixmapPass a QPixmap to setPixmap.
A moviePass a QMovie to setMovie.
A numberPass an int or a double to setNum, which converts the number to plain text.
NothingThe same as an empty plain text. This is the default. Set by clear.

When the content is changed using any of these functions, any previous content is cleared.

The look of a QLabel can be tuned in several ways. All the settings of QFrame are available for specifying a widget frame. The positioning of the content within the QLabel widget area can be tuned with setAlignment and setIndent. Text content can also wrap lines along word bounderies with setWordWrap. For example, this code sets up a sunken panel with a two-line text in the bottom right corner (both lines being flush with the right side of the label):

    QLabel *label = new QLabel(this);
    label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
    label->setText("first line\nsecond line");
    label->setAlignment(Qt::AlignBottom | Qt::AlignRight);

A QLabel is often used as a label for an interactive widget. For this use QLabel provides a useful mechanism for adding an mnemonic (see QKeysequence) that will set the keyboard focus to the other widget (called the QLabel's "buddy"). For example:

    QLineEdit* phoneEdit = new QLineEdit(this);
    QLabel* phoneLabel = new QLabel("&Phone:", this);
    phoneLabel->setBuddy(phoneEdit);

In this example, keyboard focus is transferred to the label's buddy (the QLineEdit) when the user presses Alt+P. If the buddy was a button (inheriting from QAbstractButton), triggering the mnemonic would emulate a button click.

Screenshot of a Macintosh style labelA label shown in the Macintosh widget style.
Screenshot of a Plastique style labelA label shown in the Plastique widget style.
Screenshot of a Windows XP style labelA label shown in the Windows XP widget style.

See Also:
QLineEdit, QTextEdit, QPixmap, QMovie, GUI Design Handbook: Label

Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QFrame
QFrame.Shadow, QFrame.Shape, QFrame.StyleMask
 
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget
QWidget.RenderFlag, QWidget.RenderFlags
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Field Summary
 QSignalEmitter.Signal1<java.lang.String> linkActivated
          This signal is emitted when the user clicks a link.
 QSignalEmitter.Signal1<java.lang.String> linkHovered
          This signal is emitted when the user hovers over a link.
 
Fields inherited from class com.trolltech.qt.gui.QWidget
customContextMenuRequested
 
Constructor Summary
QLabel()
          Equivalent to QLabel(0, 0).
QLabel(QWidget parent)
          Equivalent to QLabel(parent, 0).
QLabel(QWidget parent, Qt.WindowFlags f)
          Constructs an empty label.
QLabel(java.lang.String text)
          Equivalent to QLabel(text, 0, 0).
QLabel(java.lang.String text, QWidget parent)
          Equivalent to QLabel(text, parent, 0).
QLabel(java.lang.String text, QWidget parent, Qt.WindowFlags f)
          Constructs a label that displays the text, text.
 
Method Summary
 Qt.Alignment alignment()
          Returns the alignment of the label's contents.
 QWidget buddy()
          Returns this label's buddy, or 0 if no buddy is currently set.
protected  void changeEvent(QEvent arg__1)
          This function is reimplemented for internal reasons.
 void clear()
          Clears any label contents.
protected  void contextMenuEvent(QContextMenuEvent ev)
          This function is reimplemented for internal reasons.
 boolean event(QEvent e)
          This function is reimplemented for internal reasons.
protected  void focusInEvent(QFocusEvent ev)
          This function is reimplemented for internal reasons.
protected  boolean focusNextPrevChild(boolean next)
          This function is reimplemented for internal reasons.
protected  void focusOutEvent(QFocusEvent ev)
          This function is reimplemented for internal reasons.
static QLabel fromNativePointer(QNativePointer nativePointer)
          This function returns the QLabel instance pointed to by nativePointer
 boolean hasScaledContents()
          Returns whether the label will scale its contents to fill all available space..
 int heightForWidth(int arg__1)
          This function is reimplemented for internal reasons.
 int indent()
          Returns the label's text indent in pixels.
protected  void keyPressEvent(QKeyEvent ev)
          This function is reimplemented for internal reasons.
 int margin()
          Returns the width of the margin.
 QSize minimumSizeHint()
          This function is reimplemented for internal reasons.
protected  void mouseMoveEvent(QMouseEvent ev)
          This function is reimplemented for internal reasons.
protected  void mousePressEvent(QMouseEvent ev)
          This function is reimplemented for internal reasons.
protected  void mouseReleaseEvent(QMouseEvent ev)
          This function is reimplemented for internal reasons.
 QMovie movie()
          Returns a pointer to the label's movie, or 0 if no movie has been set.
 boolean openExternalLinks()
          Specifies whether QLabel should automatically open links using QDesktopServices::openUrl() instead of emitting the anchorClicked() signal.
protected  void paintEvent(QPaintEvent arg__1)
          This function is reimplemented for internal reasons.
 QPicture picture()
          Returns the label's picture or null if the label doesn't have a picture.
 QPixmap pixmap()
          Returns the label's pixmap or null if the label doesn't have a picture.
 void setAlignment(Qt.Alignment arg__1)
          Sets the alignment of the label's contents to arg__1.
 void setAlignment(Qt.AlignmentFlag... arg__1)
          Sets the alignment of the label's contents to arg__1.
 void setBuddy(QWidget arg__1)
          Sets this label's buddy to arg__1.
 void setIndent(int arg__1)
          Sets the label's text indent in pixels to arg__1.
 void setMargin(int arg__1)
          Sets the width of the margin to arg__1.
 void setMovie(QMovie movie)
          Sets the label contents to movie.
 void setNum(double arg__1)
          Sets the label contents to plain text containing the textual representation of double arg__1.
 void setNum(int arg__1)
          Sets the label contents to plain text containing the textual representation of integer arg__1.
 void setOpenExternalLinks(boolean open)
          Specifies whether QLabel should automatically open links using QDesktopServices::openUrl() instead of emitting the anchorClicked() signal.
 void setPicture(QPicture arg__1)
          Sets the label contents to arg__1.
 void setPixmap(QPixmap arg__1)
          Sets the label's pixmap to arg__1.
 void setScaledContents(boolean arg__1)
          Sets whether the label will scale its contents to fill all available space.
 void setText(java.lang.String arg__1)
          Sets the label's text to arg__1.
 void setTextFormat(Qt.TextFormat arg__1)
          Sets the label's text format to arg__1.
 void setTextInteractionFlags(Qt.TextInteractionFlag... flags)
          Specifies how the label should interact with user input if it displays text.
 void setTextInteractionFlags(Qt.TextInteractionFlags flags)
          Specifies how the label should interact with user input if it displays text.
 void setWordWrap(boolean on)
          Sets the label's word-wrapping policy to on.
 QSize sizeHint()
          This function is reimplemented for internal reasons.
 java.lang.String text()
          Returns the label's text.
 Qt.TextFormat textFormat()
          Returns the label's text format.
 Qt.TextInteractionFlags textInteractionFlags()
          Specifies how the label should interact with user input if it displays text.
 boolean wordWrap()
          Returns the label's word-wrapping policy.
 
Methods inherited from class com.trolltech.qt.gui.QFrame
drawFrame, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth
 
Methods inherited from class com.trolltech.qt.gui.QWidget
acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuPolicy, createWinId, cursor, depth, destroy, destroy, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, ensurePolished, enterEvent, focusNextChild, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyReleaseEvent, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumWidth, mouseDoubleClickEvent, mouseGrabber, move, move, moveEvent, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, overrideWindowState, overrideWindowState, paintEngine, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, render, repaint, repaint, repaint, repaint, resetInputContext, resize, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setBaseSize, setContentsMargins, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedSize, setFixedWidth, setFocus, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGeometry, setHidden, setInputContext, setLayout, setLayoutDirection, setLocale, setMask, setMask, setMaximumHeight, setMaximumSize, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setParent, setParent, setShortcutAutoRepeat, setShortcutAutoRepeat, setShortcutEnabled, setShortcutEnabled, setSizeIncrement, setSizeIncrement, setSizePolicy, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, underMouse, unsetCursor, unsetLayoutDirection, unsetLocale, update, update, update, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, widthMM, window, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y
 
Methods inherited from class com.trolltech.qt.core.QObject
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
disconnect, disconnect, signalSender
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Field Detail

linkActivated

public final QSignalEmitter.Signal1<java.lang.String> linkActivated

This signal is emitted when the user clicks a link. The URL referred to by the anchor is passed in link.

Compatible Slot Signatures:
void mySlot(java.lang.String link)
void mySlot()
See Also:
linkHovered


linkHovered

public final QSignalEmitter.Signal1<java.lang.String> linkHovered

This signal is emitted when the user hovers over a link. The URL referred to by the anchor is passed in link.

Compatible Slot Signatures:
void mySlot(java.lang.String link)
void mySlot()
See Also:
linkActivated

Constructor Detail

QLabel

public QLabel(QWidget parent)

Equivalent to QLabel(parent, 0).


QLabel

public QLabel()

Equivalent to QLabel(0, 0).


QLabel

public QLabel(QWidget parent,
              Qt.WindowFlags f)

Constructs an empty label.

The parent and widget flag f, arguments are passed to the QFrame constructor.

See Also:
setAlignment, setFrameStyle, setIndent

QLabel

public QLabel(java.lang.String text,
              QWidget parent)

Equivalent to QLabel(text, parent, 0).


QLabel

public QLabel(java.lang.String text)

Equivalent to QLabel(text, 0, 0).


QLabel

public QLabel(java.lang.String text,
              QWidget parent,
              Qt.WindowFlags f)

Constructs a label that displays the text, text.

The parent and widget flag f, arguments are passed to the QFrame constructor.

See Also:
setText, setAlignment, setFrameStyle, setIndent
Method Detail

alignment

public final Qt.Alignment alignment()

Returns the alignment of the label's contents.

See Also:
setAlignment, text

buddy

public final QWidget buddy()

Returns this label's buddy, or 0 if no buddy is currently set.

See Also:
setBuddy

clear

public final void clear()

Clears any label contents.


hasScaledContents

public final boolean hasScaledContents()

Returns whether the label will scale its contents to fill all available space..

When enabled and the label shows a pixmap, it will scale the pixmap to fill the available space.

This property's default is false.


indent

public final int indent()

Returns the label's text indent in pixels.

If a label displays text, the indent applies to the left edge if alignment is Qt::AlignLeft, to the right edge if alignment is Qt::AlignRight, to the top edge if alignment is Qt::AlignTop, and to to the bottom edge if alignment is Qt::AlignBottom.

If indent is negative, or if no indent has been set, the label computes the effective indent as follows: If frameWidth is 0, the effective indent becomes 0. If frameWidth is greater than 0, the effective indent becomes half the width of the "x" character of the widget's current font.

See Also:
setIndent, alignment, margin, frameWidth, font

margin

public final int margin()

Returns the width of the margin.

The margin is the distance between the innermost pixel of the frame and the outermost pixel of contents.

The default margin is 0.

See Also:
setMargin, indent

movie

public final QMovie movie()

Returns a pointer to the label's movie, or 0 if no movie has been set.

See Also:
setMovie

openExternalLinks

public final boolean openExternalLinks()

Specifies whether QLabel should automatically open links using QDesktopServices::openUrl() instead of emitting the anchorClicked() signal.

Note: The textInteractionFlags set on the label need to include either LinksAccessibleByMouse or LinksAccessibleByKeyboard.

The default value is false.

See Also:
setOpenExternalLinks, textInteractionFlags

setAlignment

public final void setAlignment(Qt.AlignmentFlag... arg__1)

Sets the alignment of the label's contents to arg__1.

See Also:
alignment, text

setAlignment

public final void setAlignment(Qt.Alignment arg__1)

Sets the alignment of the label's contents to arg__1.

See Also:
alignment, text

setBuddy

public final void setBuddy(QWidget arg__1)

Sets this label's buddy to arg__1.

When the user presses the shortcut key indicated by this label, the keyboard focus is transferred to the label's buddy widget.

The buddy mechanism is only available for QLabels that contain text in which one character is prefixed with an ampersand, '&'. This character is set as the shortcut key. See the QShortcut documentation for details (to display an actual ampersand, use '&&').

In a dialog, you might create two data entry widgets and a label for each, and set up the geometry layout so each label is just to the left of its data entry widget (its "buddy"), for example:

    QLineEdit *nameEd  = new QLineEdit(this);
    QLabel    *nameLb  = new QLabel("&Name:", this);
    nameLb->setBuddy(nameEd);
    QLineEdit *phoneEd = new QLineEdit(this);
    QLabel    *phoneLb = new QLabel("&Phone:", this);
    phoneLb->setBuddy(phoneEd);
    // (layout setup not shown)

With the code above, the focus jumps to the Name field when the user presses Alt+N, and to the Phone field when the user presses Alt+P.

To unset a previously set buddy, call this function with arg__1 set to 0.

See Also:
buddy, setText, QShortcut, setAlignment

setIndent

public final void setIndent(int arg__1)

Sets the label's text indent in pixels to arg__1.

If a label displays text, the indent applies to the left edge if alignment is Qt::AlignLeft, to the right edge if alignment is Qt::AlignRight, to the top edge if alignment is Qt::AlignTop, and to to the bottom edge if alignment is Qt::AlignBottom.

If indent is negative, or if no indent has been set, the label computes the effective indent as follows: If frameWidth is 0, the effective indent becomes 0. If frameWidth is greater than 0, the effective indent becomes half the width of the "x" character of the widget's current font.

See Also:
indent, alignment, margin, frameWidth, font

setMargin

public final void setMargin(int arg__1)

Sets the width of the margin to arg__1.

The margin is the distance between the innermost pixel of the frame and the outermost pixel of contents.

The default margin is 0.

See Also:
margin, indent

setMovie

public final void setMovie(QMovie movie)

Sets the label contents to movie. Any previous content is cleared. The label does NOT take ownership of the movie.

The buddy shortcut, if any, is disabled.

See Also:
movie, setBuddy

setNum

public final void setNum(int arg__1)

Sets the label contents to plain text containing the textual representation of integer arg__1. Any previous content is cleared. Does nothing if the integer's string representation is the same as the current contents of the label.

The buddy shortcut, if any, is disabled.

See Also:
setText, QString::setNum, setBuddy

setNum

public final void setNum(double arg__1)

Sets the label contents to plain text containing the textual representation of double arg__1. Any previous content is cleared. Does nothing if the double's string representation is the same as the current contents of the label.

The buddy shortcut, if any, is disabled.

See Also:
setText, QString::setNum, setBuddy

setOpenExternalLinks

public final void setOpenExternalLinks(boolean open)

Specifies whether QLabel should automatically open links using QDesktopServices::openUrl() instead of emitting the anchorClicked() signal.

Note: The textInteractionFlags set on the label need to include either LinksAccessibleByMouse or LinksAccessibleByKeyboard.

The default value is false.

See Also:
openExternalLinks, textInteractionFlags

setPicture

public final void setPicture(QPicture arg__1)

Sets the label contents to arg__1. Any previous content is cleared.

The buddy shortcut, if any, is disabled.

See Also:
picture, setBuddy

setPixmap

public final void setPixmap(QPixmap arg__1)

Sets the label's pixmap to arg__1.

If no pixmap has been set this will return 0.

Setting the pixmap clears any previous content. The buddy shortcut, if any, is disabled.


setScaledContents

public final void setScaledContents(boolean arg__1)

Sets whether the label will scale its contents to fill all available space. to arg__1.

When enabled and the label shows a pixmap, it will scale the pixmap to fill the available space.

This property's default is false.

See Also:
hasScaledContents

setText

public final void setText(java.lang.String arg__1)

Sets the label's text to arg__1.

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.

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.

See Also:
text, setTextFormat, setBuddy, alignment

setTextFormat

public final void setTextFormat(Qt.TextFormat arg__1)

Sets the label's text format to arg__1.

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

The default format is Qt::AutoText.

See Also:
textFormat, text

setTextInteractionFlags

public final void setTextInteractionFlags(Qt.TextInteractionFlag... flags)

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.

See Also:
textInteractionFlags

setTextInteractionFlags

public final void setTextInteractionFlags(Qt.TextInteractionFlags flags)

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.

See Also:
textInteractionFlags

setWordWrap

public final void setWordWrap(boolean on)

Sets the label's word-wrapping policy to on.

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

See Also:
wordWrap

text

public final java.lang.String text()

Returns 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.

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.

See Also:
setTextFormat, setBuddy, alignment

textFormat

public final Qt.TextFormat textFormat()

Returns the label's text format.

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

The default format is Qt::AutoText.

See Also:
setTextFormat, text

textInteractionFlags

public final Qt.TextInteractionFlags 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.

See Also:
setTextInteractionFlags

wordWrap

public final boolean wordWrap()

Returns 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.

See Also:
setWordWrap

changeEvent

protected void changeEvent(QEvent arg__1)

This function is reimplemented for internal reasons.

Overrides:
changeEvent in class QFrame

contextMenuEvent

protected void contextMenuEvent(QContextMenuEvent ev)

This function is reimplemented for internal reasons.

Overrides:
contextMenuEvent in class QWidget
See Also:
event, QContextMenuEvent, customContextMenuRequested

event

public boolean event(QEvent e)

This function is reimplemented for internal reasons.

Overrides:
event in class QFrame
See Also:
closeEvent, focusInEvent, focusOutEvent, enterEvent, keyPressEvent, keyReleaseEvent, leaveEvent, mouseDoubleClickEvent, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, moveEvent, paintEvent, resizeEvent, QObject::event, QObject::timerEvent

focusInEvent

protected void focusInEvent(QFocusEvent ev)

This function is reimplemented for internal reasons.

Overrides:
focusInEvent in class QWidget
See Also:
focusOutEvent, setFocusPolicy, keyPressEvent, keyReleaseEvent, event, QFocusEvent

focusNextPrevChild

protected boolean focusNextPrevChild(boolean next)

This function is reimplemented for internal reasons.

Overrides:
focusNextPrevChild in class QWidget
See Also:
focusNextChild, focusPreviousChild

focusOutEvent

protected void focusOutEvent(QFocusEvent ev)

This function is reimplemented for internal reasons.

Overrides:
focusOutEvent in class QWidget
See Also:
focusInEvent, setFocusPolicy, keyPressEvent, keyReleaseEvent, event, QFocusEvent

heightForWidth

public int heightForWidth(int arg__1)

This function is reimplemented for internal reasons.

Overrides:
heightForWidth in class QWidget

keyPressEvent

protected void keyPressEvent(QKeyEvent ev)

This function is reimplemented for internal reasons.

Overrides:
keyPressEvent in class QWidget
See Also:
keyReleaseEvent, QKeyEvent::ignore, setFocusPolicy, focusInEvent, focusOutEvent, event, QKeyEvent, Tetrix Example

minimumSizeHint

public QSize minimumSizeHint()

This function is reimplemented for internal reasons.

Overrides:
minimumSizeHint in class QWidget
See Also:
QSize::isValid, resize, setMinimumSize, sizePolicy

mouseMoveEvent

protected void mouseMoveEvent(QMouseEvent ev)

This function is reimplemented for internal reasons.

Overrides:
mouseMoveEvent in class QWidget
See Also:
setMouseTracking, mousePressEvent, mouseReleaseEvent, mouseDoubleClickEvent, event, QMouseEvent, Example

mousePressEvent

protected void mousePressEvent(QMouseEvent ev)

This function is reimplemented for internal reasons.

Overrides:
mousePressEvent in class QWidget
See Also:
mouseReleaseEvent, mouseDoubleClickEvent, mouseMoveEvent, event, QMouseEvent, Example

mouseReleaseEvent

protected void mouseReleaseEvent(QMouseEvent ev)

This function is reimplemented for internal reasons.

Overrides:
mouseReleaseEvent in class QWidget
See Also:
mousePressEvent, mouseDoubleClickEvent, mouseMoveEvent, event, QMouseEvent, Example

paintEvent

protected void paintEvent(QPaintEvent arg__1)

This function is reimplemented for internal reasons.

Overrides:
paintEvent in class QFrame
See Also:
event, repaint, update, QPainter, QPixmap, QPaintEvent, Analog Clock Example

sizeHint

public QSize sizeHint()

This function is reimplemented for internal reasons.

Overrides:
sizeHint in class QFrame
See Also:
QSize::isValid, minimumSizeHint, sizePolicy, setMinimumSize, updateGeometry

fromNativePointer

public static QLabel fromNativePointer(QNativePointer nativePointer)
This function returns the QLabel instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

picture

public final QPicture picture()
Returns the label's picture or null if the label doesn't have a picture.


pixmap

public final QPixmap pixmap()
Returns the label's pixmap or null if the label doesn't have a picture.