|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QFrame
public class QFrame
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(...); label.setFrameStyle(QFrame::Panel | QFrame::Raised); label.setLineWidth(2); QProgressBar pbar(...); label.setFrameStyle(QFrame::NoFrame);
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 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 defines the shapes of frame available. |
static class |
QFrame.StyleMask
This enum defines two constants that can be used to extract the two components 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<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 |
---|
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QFrame()
Equivalent to QFrame(0, 0). |
|
QFrame(QWidget parent)
Equivalent to QFrame(parent, 0). |
|
QFrame(QWidget parent,
Qt.WindowFlags f)
Constructs a frame widget with frame style NoFrame and a 1-pixel frame width. |
Method Summary | |
---|---|
protected void |
changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons. |
protected void |
drawFrame(QPainter arg__1)
|
boolean |
event(QEvent e)
This function is reimplemented for internal reasons. |
QRect |
frameRect()
Returns the frame's rectangle. |
QFrame.Shadow |
frameShadow()
Returns the frame shadow value from the frame style. |
QFrame.Shape |
frameShape()
Returns the frame shape value from the frame style. |
int |
frameStyle()
Returns the frame style. |
int |
frameWidth()
Returns the width of the frame that is drawn.. |
static QFrame |
fromNativePointer(QNativePointer nativePointer)
This function returns the QFrame instance pointed to by nativePointer |
int |
lineWidth()
Returns the line width. |
int |
midLineWidth()
Returns the width of the mid-line. |
protected void |
paintEvent(QPaintEvent arg__1)
This function is reimplemented for internal reasons. |
void |
setFrameRect(QRect arg__1)
Sets the frame's rectangle to arg__1. |
void |
setFrameShadow(QFrame.Shadow arg__1)
Sets the frame shadow value from the frame style to arg__1. |
void |
setFrameShape(QFrame.Shape arg__1)
Sets the frame shape value from the frame style to arg__1. |
void |
setFrameStyle(int arg__1)
Sets the frame style to arg__1. |
void |
setLineWidth(int arg__1)
Sets the line width to arg__1. |
void |
setMidLineWidth(int arg__1)
Sets the width of the mid-line to arg__1. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
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 |
Constructor Detail |
---|
public QFrame(QWidget parent)
Equivalent to QFrame(parent, 0).
public QFrame()
Equivalent to QFrame(0, 0).
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 |
---|
protected final void drawFrame(QPainter arg__1)
public final QRect frameRect()
Returns 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.
public final QFrame.Shadow frameShadow()
Returns the frame shadow value from the frame style.
public final QFrame.Shape frameShape()
Returns the frame shape value from the frame style.
public final int frameStyle()
Returns the frame style.
The default value is QFrame::NoFrame.
public final int frameWidth()
Returns 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.
public final int lineWidth()
Returns 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.
public final int midLineWidth()
Returns the width of the mid-line.
The default value is 0.
public final void setFrameRect(QRect arg__1)
Sets the frame's rectangle to arg__1.
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.
public final void setFrameShadow(QFrame.Shadow arg__1)
Sets the frame shadow value from the frame style to arg__1.
public final void setFrameShape(QFrame.Shape arg__1)
Sets the frame shape value from the frame style to arg__1.
public final void setFrameStyle(int arg__1)
Sets the frame style to arg__1.
The arg__1 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.
public final void setLineWidth(int arg__1)
Sets the line width to arg__1.
Note that the total line width for frames used as separators (HLine and VLine) is specified by frameWidth.
The default value is 1.
public final void setMidLineWidth(int arg__1)
Sets the width of the mid-line to arg__1.
The default value is 0.
protected void changeEvent(QEvent arg__1)
This function is reimplemented for internal reasons.
changeEvent
in class QWidget
public boolean event(QEvent e)
This function is reimplemented for internal reasons.
event
in class QWidget
protected void paintEvent(QPaintEvent arg__1)
This function is reimplemented for internal reasons.
paintEvent
in class QWidget
public QSize sizeHint()
This function is reimplemented for internal reasons.
sizeHint
in class QWidget
public static QFrame fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |