|
|||||||||
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.QDockWidget
public class QDockWidget
The QDockWidget
class provides a widget that can be docked inside a QMainWindow
or floated as a top-level window on the desktop. QDockWidget
provides the concept of dock widgets, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the dock widget area around the central widget
in a QMainWindow
.
QDockWidget
API allows the programmer to restrict the dock widgets ability to move, float and close, as well as the areas in which they can be placed.QDockWidget
consists of a title bar and the content area. The title bar displays the dock widgets window title
, a float button and a close button. Depending on the state of the QDockWidget
, the float and close buttons may be either disabled or not shown at all. The visual appearance of the title bar and buttons is dependent on the style
in use.
A QDockWidget
acts as a wrapper for its child widget, set with setWidget()
. Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget
will respect them, adjusting its own constraints to include the frame and title. Size constraints should not be set on the QDockWidget
itself, because they change depending on whether it is docked; a docked QDockWidget
has no frame and a smaller title bar.
QMainWindow
, and Dock Widgets Example.
Nested Class Summary | |
---|---|
static class |
QDockWidget.DockWidgetFeature
|
static class |
QDockWidget.DockWidgetFeatures
This is a flags class for com.trolltech.qt.gui.QDockWidget.DockWidgetFeature |
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, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
allowedAreasChanged
This signal is emitted when the allowedAreas property changes. |
QSignalEmitter.Signal1 |
dockLocationChanged
This signal is emitted when the dock widget is moved to another dock area, or is moved to a different location in its current dock area. |
QSignalEmitter.Signal1 |
featuresChanged
This signal is emitted when the features property changes. |
QSignalEmitter.Signal1 |
topLevelChanged
This signal is emitted when the floating property changes. |
QSignalEmitter.Signal1 |
visibilityChanged
This signal is emitted when the dock widget becomes visible (or invisible). |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QDockWidget()
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(QWidget parent)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(QWidget parent,
Qt.WindowFlags flags)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(QWidget parent,
Qt.WindowType[] flags)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(java.lang.String title)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(java.lang.String title,
QWidget parent)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(java.lang.String title,
QWidget parent,
Qt.WindowFlags flags)
Constructs a QDockWidget with parent parent and window flags flags. |
|
QDockWidget(java.lang.String title,
QWidget parent,
Qt.WindowType[] flags)
Constructs a QDockWidget with parent parent and window flags flags. |
Method Summary | |
---|---|
Qt.DockWidgetAreas |
allowedAreas()
This property holds areas where the dock widget may be placed. |
QDockWidget.DockWidgetFeatures |
features()
This property holds whether the dock widget is movable, closable, and floatable. |
static QDockWidget |
fromNativePointer(QNativePointer nativePointer)
|
protected void |
initStyleOption(QStyleOptionDockWidget option)
Initialize option with the values from this QDockWidget. |
boolean |
isAreaAllowed(Qt.DockWidgetArea area)
Returns true if this dock widget can be placed in the given area; otherwise returns false. |
boolean |
isFloating()
This property holds whether the dock widget is floating. |
void |
setAllowedAreas(Qt.DockWidgetArea[] areas)
This property holds areas where the dock widget may be placed. |
void |
setAllowedAreas(Qt.DockWidgetAreas areas)
This property holds areas where the dock widget may be placed. |
void |
setFeatures(QDockWidget.DockWidgetFeature[] features)
This property holds whether the dock widget is movable, closable, and floatable. |
void |
setFeatures(QDockWidget.DockWidgetFeatures features)
This property holds whether the dock widget is movable, closable, and floatable. |
void |
setFloating(boolean floating)
This property holds whether the dock widget is floating. |
void |
setTitleBarWidget(QWidget widget)
Sets an arbitrary widget as the dock widget's title bar. |
void |
setWidget(QWidget widget)
Sets the widget for the dock widget to widget. |
QWidget |
titleBarWidget()
Returns the custom title bar widget set on the QDockWidget , or 0 if no custom title bar has been set. |
QAction |
toggleViewAction()
Returns a checkable action that can be used to show or close this dock widget. |
QWidget |
widget()
Returns the widget for the dock widget. |
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 java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 allowedAreasChanged
allowedAreas
property changes. The allowedAreas parameter gives the new value of the property.
public final QSignalEmitter.Signal1 dockLocationChanged
public final QSignalEmitter.Signal1 featuresChanged
features
property changes. The features parameter gives the new value of the property.
public final QSignalEmitter.Signal1 topLevelChanged
floating
property changes. The topLevel parameter is true if the dock widget is now floating; otherwise it is false. isWindow()
.
public final QSignalEmitter.Signal1 visibilityChanged
Constructor Detail |
---|
public QDockWidget(QWidget parent, Qt.WindowType[] flags)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.
public QDockWidget(QWidget parent)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.
public QDockWidget()
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.
public QDockWidget(QWidget parent, Qt.WindowFlags flags)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area.
public QDockWidget(java.lang.String title, QWidget parent, Qt.WindowType[] flags)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area. The window title is set to title. This title is used when the QDockWidget
is docked and undocked. It is also used in the context menu provided by QMainWindow
.
public QDockWidget(java.lang.String title, QWidget parent)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area. The window title is set to title. This title is used when the QDockWidget
is docked and undocked. It is also used in the context menu provided by QMainWindow
.
public QDockWidget(java.lang.String title)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area. The window title is set to title. This title is used when the QDockWidget
is docked and undocked. It is also used in the context menu provided by QMainWindow
.
public QDockWidget(java.lang.String title, QWidget parent, Qt.WindowFlags flags)
QDockWidget
with parent parent and window flags flags. The dock widget will be placed in the left dock widget area. The window title is set to title. This title is used when the QDockWidget
is docked and undocked. It is also used in the context menu provided by QMainWindow
.
Method Detail |
---|
public final Qt.DockWidgetAreas allowedAreas()
Qt::AllDockWidgetAreas
. Qt::DockWidgetArea
.
public final QDockWidget.DockWidgetFeatures features()
DockWidgetFeature
.
public final boolean isAreaAllowed(Qt.DockWidgetArea area)
public final boolean isFloating()
QMainWindow
, instead of being docked in the QMainWindow
. isWindow()
.
public final void setAllowedAreas(Qt.DockWidgetArea[] areas)
Qt::AllDockWidgetAreas
. Qt::DockWidgetArea
.
public final void setAllowedAreas(Qt.DockWidgetAreas areas)
Qt::AllDockWidgetAreas
. Qt::DockWidgetArea
.
public final void setFeatures(QDockWidget.DockWidgetFeature[] features)
DockWidgetFeature
.
public final void setFeatures(QDockWidget.DockWidgetFeatures features)
DockWidgetFeature
.
public final void setFloating(boolean floating)
QMainWindow
, instead of being docked in the QMainWindow
. isWindow()
.
public final void setTitleBarWidget(QWidget widget)
If a title bar widget is set, QDockWidget
will not use native window decorations when it is floated.
Here are some tips for implementing custom title bars:
QMouseEvent::ignore()
. These events then propagate to the QDockWidget
parent, which handles them in the usual manner, moving when the title bar is dragged, docking and undocking when it is double-clicked, etc.DockWidgetVerticalTitleBar
is set on QDockWidget
, the title bar widget is repositioned accordingly. In resizeEvent()
, the title bar should check what orientation it should assume: QDockWidget *dockWidget = qobject_cast<QDockWidget*>(parentWidget()); if (dockWidget->features() & QDockWidget::DockWidgetVerticalTitleBar) { // I need to be vertical } else { // I need to be horizontal }
QWidget::sizeHint()
and QWidget::minimumSizeHint()
. These functions should take into account the current orientation of the title bar.qobject_cast
as shown above, the title bar widget has full access to its parent QDockWidget
. Hence it can perform such operations as docking and hiding in response to user actions. titleBarWidget()
, and DockWidgetVerticalTitleBar
.
public final void setWidget(QWidget widget)
If the dock widget is visible when widget is added, you must show()
it explicitly.
Note that you must add the layout of the widget before you call this function; if not, the widget will not be visible.
widget()
.
public final QWidget titleBarWidget()
QDockWidget
, or 0 if no custom title bar has been set. setTitleBarWidget()
.
public final QAction toggleViewAction()
The action's text is set to the dock widget's window title.
QAction::text
, and QWidget::windowTitle
.
public final QWidget widget()
setWidget()
.
public static QDockWidget fromNativePointer(QNativePointer nativePointer)
protected final void initStyleOption(QStyleOptionDockWidget option)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |