|
|||||||||
| 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.gui.QSpacerItem
public class QSpacerItem
The QSpacerItem class provides blank space in a layout.
Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating empty space in layouts:
| Class | Functions |
|---|---|
| QHBoxLayout | addSpacing(), addStretch(), insertSpacing(), insertStretch() |
| QGridLayout | setRowMinimumHeight(), setRowStretch(), setColumnMinimumWidth(), setColumnStretch() |
| Nested Class Summary |
|---|
| 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> |
| Constructor Summary | |
|---|---|
QSpacerItem(int w,
int h)
Equivalent to QSpacerItem(w, h, QSizePolicy::Minimum, QSizePolicy::Minimum). |
|
QSpacerItem(int w,
int h,
QSizePolicy.Policy hData)
Equivalent to QSpacerItem(w, h, hData, QSizePolicy::Minimum). |
|
QSpacerItem(int w,
int h,
QSizePolicy.Policy hData,
QSizePolicy.Policy vData)
Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData. |
|
| Method Summary | |
|---|---|
Qt.Alignment |
alignment()
Returns the alignment of this item. |
void |
changeSize(int w,
int h)
Equivalent to changeSize(w, h, QSizePolicy::Minimum, QSizePolicy::Minimum). |
void |
changeSize(int w,
int h,
QSizePolicy.Policy hData)
Equivalent to changeSize(w, h, hData, QSizePolicy::Minimum). |
void |
changeSize(int w,
int h,
QSizePolicy.Policy hData,
QSizePolicy.Policy vData)
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData. |
QSizePolicy.ControlTypes |
controlTypes()
Returns the control type(s) for the layout item. |
Qt.Orientations |
expandingDirections()
This function is reimplemented for internal reasons. |
static QSpacerItem |
fromNativePointer(QNativePointer nativePointer)
This function returns the QSpacerItem instance pointed to by nativePointer |
QRect |
geometry()
This function is reimplemented for internal reasons. |
boolean |
hasHeightForWidth()
Returns true if this layout's preferred height depends on its width; otherwise returns false. |
int |
heightForWidth(int arg__1)
Returns the preferred height for this layout item, given the width arg__1. |
void |
invalidate()
Invalidates any cached information in this layout item. |
boolean |
isEmpty()
Returns true. |
QLayout |
layout()
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. |
QSize |
maximumSize()
This function is reimplemented for internal reasons. |
int |
minimumHeightForWidth(int arg__1)
Returns the minimum height this widget needs for the given width, arg__1. |
QSize |
minimumSize()
This function is reimplemented for internal reasons. |
void |
setAlignment(Qt.Alignment a)
Sets the alignment of this item to a. |
void |
setGeometry(QRect arg__1)
This function is reimplemented for internal reasons. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
QSpacerItem |
spacerItem()
Returns a pointer to this object. |
QWidget |
widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. |
| Methods inherited from class com.trolltech.qt.QtJambiObject |
|---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
| Methods inherited from class com.trolltech.qt.QSignalEmitter |
|---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
| 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 QSpacerItem(int w,
int h,
QSizePolicy.Policy hData)
Equivalent to QSpacerItem(w, h, hData, QSizePolicy::Minimum).
public QSpacerItem(int w,
int h)
Equivalent to QSpacerItem(w, h, QSizePolicy::Minimum, QSizePolicy::Minimum).
public QSpacerItem(int w,
int h,
QSizePolicy.Policy hData,
QSizePolicy.Policy vData)
Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData.
The default values provide a gap that is able to stretch if nothing else wants the space.
| Method Detail |
|---|
public final Qt.Alignment alignment()
Returns the alignment of this item.
alignment in interface QLayoutItemInterface
public final void changeSize(int w,
int h,
QSizePolicy.Policy hData)
Equivalent to changeSize(w, h, hData, QSizePolicy::Minimum).
public final void changeSize(int w,
int h)
Equivalent to changeSize(w, h, QSizePolicy::Minimum, QSizePolicy::Minimum).
public final void changeSize(int w,
int h,
QSizePolicy.Policy hData,
QSizePolicy.Policy vData)
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData.
The default values provide a gap that is able to stretch if nothing else wants the space.
Note that if changeSize is called after the spacer item has been added to a layout, it is necessary to invalidate the layout in order for the spacer item's new size to take effect.
public final QSizePolicy.ControlTypes controlTypes()
Returns the control type(s) for the layout item. For a QWidgetItem, the control type comes from the widget's size policy; for a QLayoutItem, the control types is derived from the layout's contents.
controlTypes in interface QLayoutItemInterfacepublic final void setAlignment(Qt.Alignment a)
Sets the alignment of this item to a.
Note: Item alignment is only supported by QLayoutItem subclasses where it would have a visual effect. Except for QSpacerItem, which provides blank space for layouts, all public Qt classes that inherit QLayoutItem support item alignment.
setAlignment in interface QLayoutItemInterfacepublic Qt.Orientations expandingDirections()
This function is reimplemented for internal reasons.
expandingDirections in interface QLayoutItemInterfacepublic QRect geometry()
This function is reimplemented for internal reasons.
geometry in interface QLayoutItemInterfacepublic boolean hasHeightForWidth()
Returns true if this layout's preferred height depends on its width; otherwise returns false. The default implementation returns false.
Reimplement this function in layout managers that support height for width.
hasHeightForWidth in interface QLayoutItemInterfacepublic int heightForWidth(int arg__1)
Returns the preferred height for this layout item, given the width arg__1.
The default implementation returns -1, indicating that the preferred height is independent of the width of the item. Using the function hasHeightForWidth will typically be much faster than calling this function and testing for -1.
Reimplement this function in layout managers that support height for width. A typical implementation will look like this:
int MyLayout::heightForWidth(int w) const
{
if (cache_dirty || cached_width != w) {
// not all C++ compilers support "mutable"
MyLayout *that = (MyLayout*)this;
int h = calculateHeightForWidth(w);
that->cached_hfw = h;
return h;
}
return cached_hfw;
}
Caching is strongly recommended; without it layout will take exponential time.
heightForWidth in interface QLayoutItemInterfacepublic void invalidate()
Invalidates any cached information in this layout item.
invalidate in interface QLayoutItemInterfacepublic boolean isEmpty()
Returns true.
isEmpty in interface QLayoutItemInterfacepublic QLayout layout()
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. This function provides type-safe casting.
layout in interface QLayoutItemInterfacepublic QSize maximumSize()
This function is reimplemented for internal reasons.
maximumSize in interface QLayoutItemInterfacepublic int minimumHeightForWidth(int arg__1)
Returns the minimum height this widget needs for the given width, arg__1. The default implementation simply returns heightForWidth(arg__1).
minimumHeightForWidth in interface QLayoutItemInterfacepublic QSize minimumSize()
This function is reimplemented for internal reasons.
minimumSize in interface QLayoutItemInterfacepublic void setGeometry(QRect arg__1)
This function is reimplemented for internal reasons.
setGeometry in interface QLayoutItemInterfacepublic QSize sizeHint()
This function is reimplemented for internal reasons.
sizeHint in interface QLayoutItemInterfacepublic QSpacerItem spacerItem()
Returns a pointer to this object.
spacerItem in interface QLayoutItemInterfacepublic QWidget widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. This function provides type-safe casting.
widget in interface QLayoutItemInterfacepublic static QSpacerItem 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 | ||||||||