QDockArea(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

🌸 QDockArea(3qt) β€” the manual page, but make it make sense 🌸

okay so bestie, this is the QDockArea page from the Qt docs (manual name QDockArea(3qt), iykyk). Sit down, grab a strawberry πŸ“, we're gonna go through every single line of this thing together. No skipping. Periodt.


✨ NAME ✨

QDockArea β€” manages and lays out QDockWindows. That's the whole job. She's a project manager for windows πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <qdockarea.h>

Inherits QWidget. Yes bestie, she's a widget, we been knew.

πŸ‘‘ Public Members

enum HandlePosition { Normal, Reverse }
QDockArea ( Orientation o, HandlePosition h = Normal, QWidget * parent = 0, const char * name = 0 )
~QDockArea ()
void moveDockWindow ( QDockWindow * w, const QPoint & p, const QRect & r, bool swap )
void removeDockWindow ( QDockWindow * w, bool makeFloating, bool swap, bool fixNewLines = TRUE )
void moveDockWindow ( QDockWindow * w, int index = -1 )
bool hasDockWindow ( QDockWindow * w, int * index = 0 )
Orientation orientation () const
HandlePosition handlePosition () const
bool isEmpty () const
int count () const
QPtrList<QDockWindow> dockWindowList () const
bool isDockWindowAccepted ( QDockWindow * dw )
void setAcceptDockWindow ( QDockWindow * dw, bool accept )

🌈 Public Slots

void lineUp ( bool keepNewLines )

πŸ’… Properties

  • int count β€” the number of dock windows in the dock area (read only)
  • bool empty β€” whether the dock area is empty (read only)
  • HandlePosition handlePosition β€” where the dock window splitter handle is placed in the dock area (read only)
  • Orientation orientation β€” the dock area's orientation (read only)

QTextStream & operator<< ( QTextStream & ts, const QDockArea & dockArea )
QTextStream & operator>> ( QTextStream & ts, QDockArea & dockArea )

(yeah she shows up twice in this page, she's an icon, we'll get to her full story at the end 🫢)


πŸ’– DESCRIPTION πŸ’–

So. The QDockArea class manages and lays out QDockWindows. Literally her entire personality.

A QDockArea is a container that manages a list of QDockWindows and lays them out inside its own little area. Working together with the QDockWindows, she's the one responsible for docking and undocking them, and for moving them around inside the dock area. QDockAreas also handle the wrapping of QDockWindows so the available space gets filled as compactly as humanly possible. And plot twist: QDockAreas can hold QToolBars too, because QToolBar is a QDockWindow subclass. Slay, inheritance πŸ’œ

QMainWindow comes with four QDockAreas already built in, which you can use for your QToolBars and QDockWindows, so most of the time you don't need to touch the QDockArea class directly. BUT β€” and this is the lowkey annoying part β€” even though QMainWindow has support for its own dock areas, it's not convenient for adding new QDockAreas. So if you need to create your own dock areas, the suggestion is: make a subclass of QWidget and add your QDockAreas to your subclass. That's the move.

[Image Omitted] β€” there was a picture here, and bestie, it's gone. rip to that image πŸ™ˆ

Lines. QDockArea 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're usually added at the right hand side of the top-most line that has room (unless the user manually placed them). When users move dock windows around they may leave empty lines or gaps in non-empty lines. Dock windows can be lined up to minimize wasted space using the lineUp() function. Cleanup era ✨

The QDockArea class maintains a position list of all its child dock windows. Dock windows are added to a dock area from position 0 onwards. 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 that's 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(). She keeps receipts, fr fr.

To dock or undock a dock window use QDockWindow::dock() and QDockWindow::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(). Very much a vibe check situation.

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 and restore, the classic glow-up arc πŸ¦‹

Save the positions to a QTextStream:

ts << *myDockArea;

Restore the positions from a QTextStream:

ts >> *myDockArea;

See also Main Window and Related Classes.

🧚 Member Type Documentation 🧚

QDockArea::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. Floating girls don't get one πŸ’…)

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

  • QDockArea::Normal β€” The splitter handles of dock windows are placed at the right or bottom.
  • QDockArea::Reverse β€” The splitter handles of dock windows are placed at the left or top.

πŸ”₯ MEMBER FUNCTION DOCUMENTATION πŸ”₯

QDockArea::QDockArea ( Orientation o, HandlePosition h = Normal, QWidget * parent = 0, const char * name = 0 )

Constructs a QDockArea with orientation o, HandlePosition h, parent parent and called name. Build-a-bestie workshop 🫢

QDockArea::~QDockArea ()

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. So like, she only takes down the ones still living with her, not the ones who moved out 😭

int QDockArea::count () const

Returns the number of dock windows in the dock area. See the "count" property for details. Just counting her girlies πŸ”’

QPtrList<QDockWindow> QDockArea::dockWindowList () const

Returns a list of the dock windows in the dock area. The whole roster, in one place πŸ“‹

HandlePosition QDockArea::handlePosition () const

Returns where the dock window splitter handle is placed in the dock area. See the "handlePosition" property for details.

bool QDockArea::hasDockWindow ( QDockWindow * 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. She either knows them or she doesn't, no in-between.

bool QDockArea::isDockWindowAccepted ( QDockWindow * dw )

Returns TRUE if dock window dw could be docked into the dock area; otherwise returns FALSE. It's giving guest list πŸŽ€

See also setAcceptDockWindow().

bool QDockArea::isEmpty () const

Returns TRUE if the dock area is empty; otherwise returns FALSE. See the "empty" property for details.

void QDockArea::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. Decluttering, but make it a slot ✨

void QDockArea::moveDockWindow ( QDockWindow * w, int index = -1 )

Moves the QDockWindow 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. Put her where she belongs πŸ’…

void QDockArea::moveDockWindow ( QDockWindow * w, const QPoint & p, const QRect & r, bool swap )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

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 QDockWindow. You shouldn't need to call it yourself. Like, stay out of the group chat bestie, it's handled πŸ™ˆ

Orientation QDockArea::orientation () const

Returns the dock area's orientation. See the "orientation" property for details.

void QDockArea::removeDockWindow ( QDockWindow * 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 QDockWindow::dock() and QDockWindow::undock() instead. Seriously. Hands off. 🫣

void QDockArea::setAcceptDockWindow ( QDockWindow * 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. Setting boundaries, we love to see it πŸ’–

See also isDockWindowAccepted().

🌸 Property Documentation 🌸

int count

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

Get this property's value with count().

bool empty

This property holds whether the dock area is empty.

Get this property's value with isEmpty().

HandlePosition handlePosition

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

The default position is Normal.

Get this property's value with handlePosition().

Orientation orientation

This property holds the dock area's orientation.

There is no default value; the orientation is specified in the constructor. She's not gonna guess, tell her directly 😀

Get this property's value with orientation().


QTextStream & operator<< ( QTextStream & ts, const QDockArea & dockArea )

Writes the layout of the dock windows in dock area dockArea to the text stream ts. Saving the whole situation for later, iconic behavior πŸ’Ύ

See also operator>>().

QTextStream & operator>> ( QTextStream & ts, QDockArea & 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. You can't restore a save file that doesn't exist, bestie, that's just not how this works.

See also operator<<().


πŸ‘‘ SEE ALSO πŸ‘‘


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. Read the license file, she's not asking twice πŸ’œ


🌈 AUTHOR 🌈

Generated automatically from the source code. Not a human, just vibes and a script, honestly kind of main character energy.


πŸ’€ BUGS πŸ’€

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. (good bug reports are a love language, fr fr)

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdockarea.3qt) and the Qt version (3.3.8). Include the version, she's begging you πŸ™


okay that's the whole page, no notes, nothing skipped, we ate and left absolutely no crumbs πŸ“βœ¨

this masterpiece was brought to you by Trolltech AS on 2 February 2007 β€” the QDockArea(3qt) page, Qt version 3.3.8, that's the one, mwah πŸ’…πŸ¦‹

πŸ“¦ where this page comes from