⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qdockwindow.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QDockWindow 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQDockWindow \- Widget which can be docked inside a QDockArea or floated as a top level window on the desktop.PP\fC#include <qdockwindow.h>\fR.PPInherits QFrame..PPInherited by QToolBar..PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBPlace\fR { InDock, OutsideDock }".br.ti -1c.BI "enum \fBCloseMode\fR { Never = 0, Docked = 1, Undocked = 2, Always = Docked | Undocked }".br.ti -1c.BI "\fBQDockWindow\fR ( Place p = InDock, QWidget * parent = 0, const char * name = 0, WFlags f = 0 )".br.ti -1c.BI "virtual void \fBsetWidget\fR ( QWidget * w )".br.ti -1c.BI "QWidget * \fBwidget\fR () const".br.ti -1c.BI "Place \fBplace\fR () const".br.ti -1c.BI "QDockArea * \fBarea\fR () const".br.ti -1c.BI "virtual void \fBsetCloseMode\fR ( int m )".br.ti -1c.BI "bool \fBisCloseEnabled\fR () const".br.ti -1c.BI "int \fBcloseMode\fR () const".br.ti -1c.BI "virtual void \fBsetResizeEnabled\fR ( bool b )".br.ti -1c.BI "virtual void \fBsetMovingEnabled\fR ( bool b )".br.ti -1c.BI "bool \fBisResizeEnabled\fR () const".br.ti -1c.BI "bool \fBisMovingEnabled\fR () const".br.ti -1c.BI "virtual void \fBsetHorizontallyStretchable\fR ( bool b )".br.ti -1c.BI "virtual void \fBsetVerticallyStretchable\fR ( bool b )".br.ti -1c.BI "bool \fBisHorizontallyStretchable\fR () const".br.ti -1c.BI "bool \fBisVerticallyStretchable\fR () const".br.ti -1c.BI "void setHorizontalStretchable ( bool b )  \fI(obsolete)\fR".br.ti -1c.BI "void setVerticalStretchable ( bool b )  \fI(obsolete)\fR".br.ti -1c.BI "bool isHorizontalStretchable () const  \fI(obsolete)\fR".br.ti -1c.BI "bool isVerticalStretchable () const  \fI(obsolete)\fR".br.ti -1c.BI "bool \fBisStretchable\fR () const".br.ti -1c.BI "virtual void \fBsetOffset\fR ( int o )".br.ti -1c.BI "int \fBoffset\fR () const".br.ti -1c.BI "virtual void \fBsetFixedExtentWidth\fR ( int w )".br.ti -1c.BI "virtual void \fBsetFixedExtentHeight\fR ( int h )".br.ti -1c.BI "QSize \fBfixedExtent\fR () const".br.ti -1c.BI "virtual void \fBsetNewLine\fR ( bool b )".br.ti -1c.BI "bool \fBnewLine\fR () const".br.ti -1c.BI "Qt::Orientation \fBorientation\fR () const".br.ti -1c.BI "QBoxLayout * \fBboxLayout\fR ()".br.ti -1c.BI "virtual void \fBsetOpaqueMoving\fR ( bool b )".br.ti -1c.BI "bool \fBopaqueMoving\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBundock\fR ( QWidget * w )".br.ti -1c.BI "virtual void \fBdock\fR ()".br.ti -1c.BI "virtual void \fBsetOrientation\fR ( Orientation o )".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBorientationChanged\fR ( Orientation o )".br.ti -1c.BI "void \fBplaceChanged\fR ( QDockWindow::Place p )".br.ti -1c.BI "void \fBvisibilityChanged\fR ( bool visible )".br.in -1c.SS "Properties".in +1c.ti -1c.BI "int \fBcloseMode\fR - the close mode of a dock window".br.ti -1c.BI "bool \fBhorizontallyStretchable\fR - whether the dock window is horizontally stretchable".br.ti -1c.BI "bool \fBmovingEnabled\fR - whether the user can move the dock window within the dock " "area" ", move the dock window to another dock " "area" ", or float the dock window".br.ti -1c.BI "bool \fBnewLine\fR - whether the dock window prefers to start a new line in the dock area".br.ti -1c.BI "int \fBoffset\fR - the dock window's preferred offset from the dock area's left edge (top edge for vertical dock " "areas" ")".br.ti -1c.BI "bool \fBopaqueMoving\fR - whether the dock window will be shown normally whilst it is being moved".br.ti -1c.BI "Place \fBplace\fR - whether the dock window is in a dock area  \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBresizeEnabled\fR - whether the dock window is resizeable".br.ti -1c.BI "bool \fBstretchable\fR - whether the dock window is stretchable in the current orientation()  \fI(read " "only" ")\fR".br.ti -1c.BI "bool \fBverticallyStretchable\fR - whether the dock window is vertically stretchable. A dock window is horizontally stretchable if you call setVerticallyStretchable(TRUE) or setResizeEnabled(TRUE)".br.in -1c.SH DESCRIPTIONThe QDockWindow class provides a widget which can be docked inside a QDockArea or floated as a top level window on the desktop..PPThis class handles moving, resizing, docking and undocking dock windows. QToolBar is a subclass of QDockWindow so the functionality provided for dock windows is available with the same API for toolbars..PPIf the user drags the dock window into the dock area the dock window will be docked. If the user drags the dock area outside any dock areas the dock window will be undocked (floated) and will become a top level window. Double clicking a floating dock window's titlebar will dock the dock window to the last dock area it was docked in. Double clicking a docked dock window's handle will undock (float) the dock window. Single clicking a docked dock window's handle will minimize the dock window (only its handle will appear, below the menu bar). Single clicking the minimized handle will restore the dock window to the last dock area that it was docked in. If the user clicks the close button (which appears on floating dock windows by default) the dock window will disappear. You can control whether or not a dock window has a close button with setCloseMode()..PPQMainWindow provides four dock areas (top, left, right and bottom) which can be used by dock windows. For many applications using the dock areas provided by QMainWindow will be sufficient. (See the QDockArea documentation if you want to create your own dock areas.) In QMainWindow a right-click popup menu (the dock window menu) is available which lists dock windows and can be used to show or hide them..PPWhen you construct a dock window you \fImust\fR pass it a QDockArea or a QMainWindow as its parent if you want it docked. Pass 0 for the parent if you want it floated..PP.nf.br    QToolBar *fileTools = new QToolBar( this, "File Actions" );.br    moveDockWindow( fileTools, Left );.br.fi.PPIn the example above we create a new QToolBar in the constructor of a QMainWindow subclass (so that the \fIthis\fR pointer points to the QMainWindow). By default the toolbar will be added to the Top dock area, but we've moved it to the Left dock area..PPA dock window is often used to contain a single widget. In these cases the widget can be set by calling setWidget(). If you're constructing a dock window that contains multiple widgets, e.g. a toolbar, arrange the widgets within a box layout inside the dock window. To do this use the boxLayout() function to get a pointer to the dock window's box layout, then add widgets to the layout using the box layout's QBoxLayout::addWidget() function. The dock window will dynamically set the orientation of the layout to be vertical or horizontal as necessary, although you can control this yourself with setOrientation()..PPAlthough a common use of dock windows is for toolbars, they can be used with any widgets. (See the \fIQt Designer\fR and \fIQt Linguist\fR applications, for example.) When using larger widgets it may make sense for the dock window to be resizable by calling setResizeEnabled(). Resizable dock windows are given splitter-like handles to allow the user to resize them within their dock area. When resizable dock windows are undocked they become top level windows and can be resized like any other top level windows, e.g. by dragging a corner or edge..PPDock windows can be docked and undocked using dock() and undock(). A dock window's orientation can be set with setOrientation(). You can also use QDockArea::moveDockWindow(). If you're using a QMainWindow, QMainWindow::moveDockWindow() and QMainWindow::removeDockWindow() are available..PPA dock window can have some preferred settings, for example, you can set a preferred offset from the left edge (or top edge for vertical dock areas) of the dock area using setOffset(). If you'd prefer a dock window to start on a new line when it is docked use setNewLine(). The setFixedExtentWidth() and setFixedExtentHeight() functions can be used to define the dock window's preferred size, and the setHorizontallyStretchable() and setVerticallyStretchable() functions set whether the dock window can be stretched or not. Dock windows can be moved by default, but this can be changed with setMovingEnabled(). When a dock window is moved it is shown as a rectangular outline, but it can be shown normally using setOpaqueMoving()..PPWhen a dock window's visibility changes, i.e. it is shown or hidden, the visibilityChanged() signal is emitted. When a dock window is docked or undocked the placeChanged() signal is emitted..PPSee also Main Window and Related Classes..SS "Member Type Documentation".SH "QDockWindow::CloseMode"This enum type specifies when (if ever) a dock window has a close button..TP\fCQDockWindow::Never\fR - The dock window never has a close button and cannot be closed by the user..TP\fCQDockWindow::Docked\fR - The dock window has a close button only when docked..TP\fCQDockWindow::Undocked\fR - The dock window has a close button only when floating..TP\fCQDockWindow::Always\fR - The dock window always has a close button.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -