Qt:Документация 4.3.2/q3dockarea

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] Q3DockArea Class Reference
[ Qt3Support module]

The Q3DockArea class manages and lays out Q3DockWindows. Далее...

 #include <Q3DockArea>

This class is part of the Qt 3 support library. It is provided to keep old source code working. Мы настоятельно не рекомендуем использовать этот класс в новом коде. See Porting to Qt 4 for more information.

Наследует QWidget.

[править] Открытые типы

[править] Свойства

  • 56 свойств, унаследованных от QWidget
  • 1 свойство, унаследованное от QObject

[править] Открытые функции

  • 201 свойство, унаследованное от QWidget
  • 29 открытых функций, унаследованных от QObject
  • 12 открытых функций, унаследованных от QPaintDevice

[править] Открытые слоты

  • 19 открытых слотов, унаследованных от QWidget
  • 1 открытый слот, унаследованный от QObject

[править] Связанные не-члены

  • QTextStream & operator<< ( QTextStream & ts, const Q3DockArea & dockArea )
  • QTextStream & operator>> ( QTextStream & ts, Q3DockArea & dockArea )

[править] Дополнительные унаследованные члены

  • 1 сигнал, унаследованный от QWidget
  • 1 сигнал, унаследованный от QObject
  • 4 статических открытых члена, унаследованных от QWidget
  • 5 статических открытых членов, унаследованных от QObject
  • 38 защищенных функций, унаследованных от QWidget
  • 7 защищенных функций, унаследованных от QObject
  • 1 защищенная функция, унаследованных от QPaintDevice
  • 1 защищенный слот, унаследованый от QWidget

[править] Подробное описание

The Q3DockArea class manages and lays out Q3DockWindows.

A Q3DockArea is a container which manages a list of Q3DockWindows which it lays out within its area. In cooperation with the Q3DockWindows it is responsible for the docking and undocking of Q3DockWindows and moving them inside the dock area. Q3DockAreas also handle the wrapping of Q3DockWindows to fill the available space as compactly as possible. Q3DockAreas can contain Q3ToolBars since Q3ToolBar is a Q3DockWindow subclass.

QMainWindow contains four Q3DockAreas which you can use for your Q3ToolBars and Q3DockWindows, so in most situations you do not need to use the Q3DockArea class directly. Although QMainWindow contains support for its own dock areas it isn't convenient for adding new Q3DockAreas. If you need to create your own dock areas we suggest that you create a subclass of QWidget and add your Q3DockAreas to your subclass.

Файл:Qmainwindow-qdockareas.png

Lines. Q3DockArea uses the concept of lines. A line is a horizontal region which may contain dock windows side-by-side. A dock area may have room for more than one line. When dock windows are docked into a dock area they are usually added at the right hand side of the top-most line that has room (unless manually placed by the user). When users move dock windows they may leave empty lines or gaps in non-empty lines. Qt::Dock windows can be lined up to minimize wasted space using the lineUp() function.

The Q3DockArea class maintains a position list of all its child dock windows. Qt::Dock windows are added to a dock area from position 0 onwards. Qt::Dock windows are laid out sequentially in position order from left to right, and in the case of multiple lines of dock windows, from top to bottom. If a dock window is floated it still retains its position since this is where the window will return if the user double clicks its caption. A dock window's position can be determined with hasDockWindow(). The position can be changed with moveDockWindow().

To dock or undock a dock window use Q3DockWindow::dock() and Q3DockWindow::undock() respectively. If you want to control which dock windows can dock in a dock area use setAcceptDockWindow(). To see if a dock area contains a particular dock window use hasDockWindow(); to see how many dock windows a dock area contains use count().

The streaming operators can write the positions of the dock windows in the dock area to a QTextStream. The positions can be read back later to restore the saved positions.

Save the positions to a QTextStream:

 ts << *myDockArea;

Restore the positions from a QTextStream:

 ts >> *myDockArea;

[править] Описание типов

[править]
enum Q3DockArea::HandlePosition

A dock window has two kinds of handles, the dock window handle used for dragging the dock window, and the splitter handle used to resize the dock window in relation to other dock windows using a splitter. (The splitter handle is only visible for docked windows.)

This enum specifies where the dock window splitter handle is placed in the dock area.


Константа Значение Описание
Q3DockArea::Normal 0 The splitter handles of dock windows are placed at the right or bottom.
Q3DockArea::Reverse 1 The splitter handles of dock windows are placed at the left or top.

[править] Описание cвойств

[править]
count : const int

This property holds the number of dock windows in the dock area.

Функции доступа:

  • int count () const

[править]
empty : const bool

This property holds whether the dock area is empty.

Функции доступа:

  • bool isEmpty () const

[править]
handlePosition : const HandlePosition

This property holds where the dock window splitter handle is placed in the dock area.

The default position is Normal.

Функции доступа:

  • HandlePosition handlePosition () const

[править]
orientation : const Qt::Orientation

This property holds the dock area's orientation.

There is no default value; the orientation is specified in the constructor.

Функции доступа:

  • Qt::Orientation orientation () const

[править] Описание функций-членов

[править]
Q3DockArea::Q3DockArea ( Qt::Orientation o, HandlePosition h = Normal, QWidget * parent = 0, const char * name = 0 )

Constructs a Q3DockArea with orientation o, HandlePosition h, parent parent and called name.

[править]
Q3DockArea::~Q3DockArea ()

Destroys the dock area and all the dock windows docked in the dock area.

Does not affect any floating dock windows or dock windows in other dock areas, even if they first appeared in this dock area. Floating dock windows are effectively top level windows and are not child windows of the dock area. When a floating dock window is docked (dragged into a dock area) its parent becomes the dock area.

[править]
QList< Q3DockWindow *> Q3DockArea::dockWindowList () const

Returns a list of the dock windows in the dock area.

[править]
bool Q3DockArea::hasDockWindow ( Q3DockWindow * w, int * index = 0 )

Returns true if the dock area contains the dock window w; otherwise returns false. If index is not 0 it will be set as follows: if the dock area contains the dock window *index is set to w's index position; otherwise *index is set to -1.

[править]
bool Q3DockArea::isDockWindowAccepted ( Q3DockWindow * dw )

Returns true if dock window dw could be docked into the dock area; otherwise returns false.

See also setAcceptDockWindow().

[править]
void Q3DockArea::lineUp ( bool keepNewLines ) [slot]

Lines up the dock windows in this dock area to minimize wasted space. If keepNewLines is true, only space within lines is cleaned up. If keepNewLines is false the number of lines might be changed.

[править]
void Q3DockArea::moveDockWindow ( Q3DockWindow * w, int index = -1 )

Moves the Q3DockWindow w within the dock area. If w is not already docked in this area, w is docked first. If index is -1 or larger than the number of docked widgets, w is appended at the end, otherwise it is inserted at the position index.

[править]
void Q3DockArea::moveDockWindow ( Q3DockWindow * w, const QPoint & p, const QRect & r, bool swap )

Эта перегруженная функция предоставлена для удобства.

Moves the dock window w inside the dock area where p is the new position (in global screen coordinates), r is the suggested rectangle of the dock window and swap specifies whether or not the orientation of the docked widget needs to be changed.

This function is used internally by Q3DockWindow. You shouldn't need to call it yourself.

[править]
void Q3DockArea::removeDockWindow ( Q3DockWindow * w, bool makeFloating, bool swap, bool fixNewLines = true )

Removes the dock window w from the dock area. If makeFloating is true, w gets floated, and if swap is true, the orientation of w gets swapped. If fixNewLines is true (the default) newlines in the area will be fixed.

You should never need to call this function yourself. Use Q3DockWindow::dock() and Q3DockWindow::undock() instead.

[править]
void Q3DockArea::setAcceptDockWindow ( Q3DockWindow * dw, bool accept )

If accept is true, dock window dw can be docked in the dock area. If accept is false, dock window dw cannot be docked in the dock area.

See also isDockWindowAccepted().


[править] Связанные не-члены

[править]
QTextStream & operator<< ( QTextStream & ts, const Q3DockArea & dockArea )

Эта перегруженная функция предоставлена для удобства.

Writes the layout of the dock windows in dock area dockArea to the text stream ts.

[править]
QTextStream & operator>> ( QTextStream & ts, Q3DockArea & dockArea )

Эта перегруженная функция предоставлена для удобства.

Reads the layout description of the dock windows in dock area dockArea from the text stream ts and restores it. The layout description must have been previously written by the operator<<() function.



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2