|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.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
.
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
|
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 | |
---|---|
QSignalEmitter.Signal1 |
allowedAreasChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
dockLocationChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
featuresChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
topLevelChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
visibilityChanged
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
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)
|
|
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)
|
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. |
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)
|
void |
setAllowedAreas(Qt.DockWidgetAreas areas)
This property holds areas where the dock widget may be placed. |
void |
setFeatures(QDockWidget.DockWidgetFeature[] features)
|
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 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 |
Field Detail |
---|
public final QSignalEmitter.Signal1 allowedAreasChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.core.Qt$DockWidgetAreas(named: allowedAreas)>:
This signal is emitted when the allowedAreas
property changes. The allowedAreas parameter gives the new value of the property.
public final QSignalEmitter.Signal1 dockLocationChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.core.Qt$DockWidgetArea(named: area)>:
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. This happens when the dock widget is moved programmatically or is dragged to a new location by the user.
public final QSignalEmitter.Signal1 featuresChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QDockWidget$DockWidgetFeatures(named: features)>:
This signal is emitted when the features
property changes. The features parameter gives the new value of the property.
public final QSignalEmitter.Signal1 topLevelChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: topLevel)>:
This signal is emitted when the 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
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: visible)>:
This signal is emitted when the dock widget becomes visible (or invisible). This happens when the widget is hidden or shown, as well as when it is docked in a tabbed dock area and its tab becomes selected or unselected.
Constructor Detail |
---|
public QDockWidget(QWidget parent, Qt.WindowType[] flags)
public QDockWidget(QWidget parent)
public QDockWidget()
public QDockWidget(QWidget parent, Qt.WindowFlags flags)
public QDockWidget(java.lang.String title, QWidget parent, Qt.WindowType[] flags)
public QDockWidget(java.lang.String title, QWidget parent)
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)
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)
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()
DockWidgetClosable
, DockWidgetMovable
and DockWidgetFloatable
. DockWidgetFeature
.
public final boolean isAreaAllowed(Qt.DockWidgetArea area)
public final boolean isFloating()
QMainWindow
, instead of being docked in the QMainWindow
. By default, this property is true.
isWindow()
.
public final void setAllowedAreas(Qt.DockWidgetArea[] areas)
public final void setAllowedAreas(Qt.DockWidgetAreas areas)
Qt::AllDockWidgetAreas
. Qt::DockWidgetArea
.
public final void setFeatures(QDockWidget.DockWidgetFeature[] features)
public final void setFeatures(QDockWidget.DockWidgetFeatures features)
DockWidgetClosable
, DockWidgetMovable
and DockWidgetFloatable
. DockWidgetFeature
.
public final void setFloating(boolean floating)
QMainWindow
, instead of being docked in the QMainWindow
. By default, this property is true.
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 = (QDockWidget)parentWidget(); if (dockWidget.features().isSet(QDockWidget.DockWidgetFeature.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.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()
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()
.
protected final void initStyleOption(QStyleOptionDockWidget option)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |