Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QFrame

    java.lang.Object
      com.trolltech.qt.internal.QSignalEmitterInternal
          com.trolltech.qt.QSignalEmitter
              com.trolltech.qt.QtJambiObject
                  com.trolltech.qt.core.QObject
                      com.trolltech.qt.gui.QWidget
                          com.trolltech.qt.gui.QFrame

All Implemented Interfaces:
  QPaintDeviceInterface, QtJambiInterface

Direct Known Subclasses:
  QAbstractScrollArea, QLabel, QLCDNumber, QSplitter, QStackedWidget, QToolBox

    public class QFrame

extends QWidget

The `QFrame` class is the base class of widgets that can have a frame. `QMenu` uses this to "raise" the menu above the surrounding screen. `QProgressBar` has a "sunken" look. `QLabel` has a flat look. The frames of widgets like these can be changed.

        QLabel label = new QLabel(this);
        label.setFrameStyle(QFrame.Shape.Panel.value() | QFrame.Shadow.Raised.value());
        label.setLineWidth(2);

        QProgressBar pbar = new QProgressBar(this);
        label.setFrameStyle(QFrame.Shape.NoFrame.value());

The `QFrame` class can also be used directly for creating simple placeholder frames without any contents.

The frame style is specified by a `frame shape` and a `shadow style` that is used to visually separate the frame from surrounding widgets. These properties can be set together using the `setFrameStyle()` function and read with `frameStyle()`.

The frame shapes are `NoFrame` , `Box` , `Panel` , `StyledPanel` , `HLine` and `VLine` ; the shadow styles are `Plain` , `Raised` and `Sunken` .

A frame widget has three attributes that describe the thickness of the border: `lineWidth`, `midLineWidth`, and `frameWidth`.

- The line width is the width of the frame border. It can be modified to customize the frame's appearance.
- The mid-line width specifies the width of an extra line in the middle of the frame, which uses a third color to obtain a special 3D effect. Notice that a mid-line is only drawn for `Box` , `HLine` and `VLine` frames that are raised or sunken.
- The frame width is determined by the frame style, and the `frameWidth()` function is used to obtain the value defined for the style used.

The margin between the frame and the contents of the frame can be customized with the `QWidget::setContentsMargins()` function. This table shows some of the combinations of styles and line widths:

Nested Class Summary
`static class` | `QFrame.Shadow` This enum type defines the types of shadow that are used to give a 3D effect to frames.
`static class` | `QFrame.Shape` This enum type lists the built-in shapes supported by `QTabBar`.
`static class` | `QFrame.StyleMask` This enum defines two constants that can be used to extract the two components of `frameStyle()`: Normally, you don't need to use these, since frameShadow() and frameShape() already extract the `Shadow` and the `Shape` parts of `frameStyle()`.

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.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal`

Field Summary

Fields inherited from class com.trolltech.qt.gui.QWidget
`customContextMenuRequested`

Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`currentSender`

Constructor Summary
`QFrame()` Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.
`QFrame(QWidget parent)` Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.
`QFrame(QWidget parent, Qt.WindowFlags f)` Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.
`QFrame(QWidget parent, Qt.WindowType[] f)` Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.

Method Summary
`QRect` | `frameRect()` This property holds the frame's rectangle.
`QFrame.Shadow` | `frameShadow()` This property holds the frame shadow value from the frame style.
`QFrame.Shape` | `frameShape()` This property holds the frame shape value from the frame style.
`int` | `frameStyle()` Returns the frame style.
`int` | `frameWidth()` This property holds the width of the frame that is drawn.
`int` | `lineWidth()` This property holds the line width.
`int` | `midLineWidth()` This property holds the width of the mid-line.
`void` | `setFrameRect(QRect arg__1)` This property holds the frame's rectangle.
`void` | `setFrameShadow(QFrame.Shadow arg__1)` This property holds the frame shadow value from the frame style.
`void` | `setFrameShape(QFrame.Shape arg__1)` This property holds the frame shape value from the frame style.
`void` | `setFrameStyle(int arg__1)` Sets the frame style to `style`.
`void` | `setLineWidth(int arg__1)` This property holds the line width.
`void` | `setMidLineWidth(int arg__1)` This property holds the width of the mid-line.

Methods inherited from class com.trolltech.qt.gui.QWidget
`acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsRect, contextMenuEvent, contextMenuPolicy, cursor, depth, destroy, destroy, destroy, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, ensurePolished, enterEvent, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabKeyboard, grabMouse, grabMouse, grabShortcut, grabShortcut, hasFocus, hasMouseTracking, height, heightForWidth, heightMM, hide, hideEvent, inputContext, inputMethodEvent, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isFullScreen, isHidden, isMaximized, isMinimized, isModal, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, keyPressEvent, keyReleaseEvent, languageChange, layout, layoutDirection, leaveEvent, locale, logicalDpiX, logicalDpiY, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, numColors, overrideWindowFlags, overrideWindowFlags, paintEngine, paintEvent, paintingActive, palette, parentWidget, physicalDpiX, physicalDpiY, pos, raise, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, render, render, render, 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, setWindowFilePath, setWindowFlags, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, 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, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, winId, x, y`

Methods inherited from class com.trolltech.qt.core.QObject
`childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread`

Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
`__qt_signalInitialization`

Methods inherited from class java.lang.Object
`clone, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QFrame

    public QFrame(QWidget parent,
                  Qt.WindowType[] f)

  Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.

  The `parent` and `f` arguments are passed to the `QWidget` constructor.

### QFrame

    public QFrame(QWidget parent)

  Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.

  The `parent` and `f` arguments are passed to the `QWidget` constructor.

### QFrame

    public QFrame()

  Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.

  The `parent` and `f` arguments are passed to the `QWidget` constructor.

### QFrame

    public QFrame(QWidget parent,
                  Qt.WindowFlags f)

  Constructs a frame widget with frame style `NoFrame` and a 1-pixel frame width.

  The `parent` and `f` arguments are passed to the `QWidget` constructor.

Method Detail

### frameRect

    public final QRect frameRect()

  This property holds the frame's rectangle. The frame's rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting the rectangle does does not cause a widget update. The frame rectangle is automatically adjusted when the widget changes size.

  If you set the rectangle to a null rectangle (for example, `QRect`(0, 0, 0, 0)), then the resulting frame rectangle is equivalent to the `widget rectangle`.

### frameShadow

    public final QFrame.Shadow frameShadow()

  This property holds the frame shadow value from the frame style.

See also:
  `frameStyle()`, and `frameShape()`.

### frameShape

    public final QFrame.Shape frameShape()

  This property holds the frame shape value from the frame style.

See also:
  `frameStyle()`, and `frameShadow()`.

### frameStyle

    public final int frameStyle()

  Returns the frame style.

  The default value is `QFrame::NoFrame` .

See also:
  `setFrameStyle()`, `frameShape()`, and `frameShadow()`.

### frameWidth

    public final int frameWidth()

  This property holds the width of the frame that is drawn. Note that the frame width depends on the `frame style`, not only the line width and the mid-line width. For example, the style specified by `NoFrame` always has a frame width of 0, whereas the style `Panel` has a frame width equivalent to the line width.

See also:
  `lineWidth()`, `midLineWidth()`, and `frameStyle()`.

### lineWidth

    public final int lineWidth()

  This property holds the line width. Note that the total line width for frames used as separators (`HLine` and `VLine` ) is specified by `frameWidth`.

  The default value is 1.

See also:
  `midLineWidth`, and `frameWidth`.

### midLineWidth

    public final int midLineWidth()

  This property holds the width of the mid-line. The default value is 0.

See also:
  `lineWidth`, and `frameWidth`.

### setFrameRect

    public final void setFrameRect(QRect arg__1)

  This property holds the frame's rectangle. The frame's rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting the rectangle does does not cause a widget update. The frame rectangle is automatically adjusted when the widget changes size.

  If you set the rectangle to a null rectangle (for example, `QRect`(0, 0, 0, 0)), then the resulting frame rectangle is equivalent to the `widget rectangle`.

### setFrameShadow

    public final void setFrameShadow(QFrame.Shadow arg__1)

  This property holds the frame shadow value from the frame style.

See also:
  `frameStyle()`, and `frameShape()`.

### setFrameShape

    public final void setFrameShape(QFrame.Shape arg__1)

  This property holds the frame shape value from the frame style.

See also:
  `frameStyle()`, and `frameShadow()`.

### setFrameStyle

    public final void setFrameStyle(int arg__1)

  Sets the frame style to `style`.

  The `style` is the bitwise OR between a frame shape and a frame shadow style. See the picture of the frames in the main class documentation.

  The frame shapes are given in `QFrame::Shape` and the shadow styles in `QFrame::Shadow` .

  If a mid-line width greater than 0 is specified, an additional line is drawn for `Raised` or `Sunken` `Box` , `HLine` , and `VLine` frames. The mid-color of the current color group is used for drawing middle lines.

See also:
  `frameStyle()`.

### setLineWidth

    public final void setLineWidth(int arg__1)

  This property holds the line width. Note that the total line width for frames used as separators (`HLine` and `VLine` ) is specified by `frameWidth`.

  The default value is 1.

See also:
  `midLineWidth`, and `frameWidth`.

### setMidLineWidth

    public final void setMidLineWidth(int arg__1)

  This property holds the width of the mid-line. The default value is 0.

See also:
  `lineWidth`, and `frameWidth`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD