|
|
||||||||||
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.QWidgetItem
public class QWidgetItem
The QWidgetItem class is a layout item that represents a widget.
Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating widgets in layouts:
Class | Functions |
---|---|
QBoxLayout | addWidget(), insertWidget(), setStretchFactor() |
QGridLayout | addWidget() |
QStackedLayout | addWidget(), insertWidget(), currentWidget(), setCurrentWidget(), widget() |
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 | |
---|---|
QWidgetItem(QWidget w)
Creates an item containing the given w. |
Method Summary | |
---|---|
Qt.Alignment |
alignment()
Returns the alignment of this item. |
QSizePolicy.ControlTypes |
controlTypes()
Returns the control type(s) for the layout item. |
Qt.Orientations |
expandingDirections()
Returns whether this layout item can make use of more space than sizeHint. |
static QWidgetItem |
fromNativePointer(QNativePointer nativePointer)
This function returns the QWidgetItem instance pointed to by nativePointer |
QRect |
geometry()
Returns the rectangle covered by this layout item. |
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 if the widget is hidden; otherwise returns false. |
QLayout |
layout()
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. |
QSize |
maximumSize()
Implemented in subclasses to return the maximum size of this item. |
int |
minimumHeightForWidth(int arg__1)
Returns the minimum height this widget needs for the given width, arg__1. |
QSize |
minimumSize()
Implemented in subclasses to return the minimum size of this item. |
void |
setAlignment(Qt.Alignment a)
Sets the alignment of this item to a. |
void |
setGeometry(QRect arg__1)
Implemented in subclasses to set this item's geometry to arg__1. |
QSize |
sizeHint()
Implemented in subclasses to return the preferred size of this item. |
QSpacerItem |
spacerItem()
If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. |
QWidget |
widget()
Returns the widget managed by this item. |
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 QWidgetItem(QWidget w)
Creates an item containing the given w.
Method Detail |
---|
public final Qt.Alignment alignment()
Returns the alignment of this item.
alignment
in interface QLayoutItemInterface
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 QLayoutItemInterface
public 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 QLayoutItemInterface
public Qt.Orientations expandingDirections()
Returns whether this layout item can make use of more space than sizeHint. A value of Qt::Vertical or Qt::Horizontal means that it wants to grow in only one dimension, whereas Qt::Vertical | Qt::Horizontal means that it wants to grow in both dimensions.
expandingDirections
in interface QLayoutItemInterface
public QRect geometry()
Returns the rectangle covered by this layout item.
geometry
in interface QLayoutItemInterface
public 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 QLayoutItemInterface
public 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 QLayoutItemInterface
public void invalidate()
Invalidates any cached information in this layout item.
invalidate
in interface QLayoutItemInterface
public boolean isEmpty()
Returns true if the widget is hidden; otherwise returns false.
isEmpty
in interface QLayoutItemInterface
public 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 QLayoutItemInterface
public QSize maximumSize()
Implemented in subclasses to return the maximum size of this item.
maximumSize
in interface QLayoutItemInterface
public 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 QLayoutItemInterface
public QSize minimumSize()
Implemented in subclasses to return the minimum size of this item.
minimumSize
in interface QLayoutItemInterface
public void setGeometry(QRect arg__1)
Implemented in subclasses to set this item's geometry to arg__1.
setGeometry
in interface QLayoutItemInterface
public QSize sizeHint()
Implemented in subclasses to return the preferred size of this item.
sizeHint
in interface QLayoutItemInterface
public QSpacerItem spacerItem()
If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. This function provides type-safe casting.
spacerItem
in interface QLayoutItemInterface
public QWidget widget()
Returns the widget managed by this item.
widget
in interface QLayoutItemInterface
public static QWidgetItem 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 |