KDDockWidgets API Documentation 2.1
|
The MDILayout class implements a layout suitable for MDI style docking. Where dock widgets are free to be positioned in arbitrary positions, not restricted by layouting. More...
#include <MDILayout.h>
Public Member Functions | |
MDILayout (View *parent=nullptr) | |
~MDILayout () override | |
void | addDockWidget (Core::DockWidget *dw, Point localPt, const InitialOption &addingOption={}) |
docks the dock widgets into this MDI area, at the specified position | |
void | moveDockWidget (Core::DockWidget *dw, Point pos) |
Moves a dock widget dw to point pos . | |
void | moveDockWidget (Core::Group *group, Point pos) |
Moves a dock widget group to point pos Convenience overload. | |
void | resizeDockWidget (Core::DockWidget *dw, Size size) |
Sets the size of dock widget dw to size . | |
void | resizeDockWidget (Core::Group *group, Size size) |
Sets the size of dock widget group to size Convenience overload. | |
void | setDockWidgetGeometry (Core::Group *group, Rect) |
sets the size and position of the dock widget group | |
Public Member Functions inherited from KDDockWidgets::Core::Layout | |
Layout (ViewType, View *) | |
~Layout () | |
Core::DropArea * | asDropArea () const |
LayoutingHost * | asLayoutingHost () const |
Core::MDILayout * | asMDILayout () const |
bool | checkSanity () const |
Runs some sanity checks. Returns true if everything is OK. | |
void | clearLayout () |
clears the layout | |
bool | containsGroup (const Core::Group *) const |
Returns true if this layout contains the specified group. | |
bool | containsItem (const Core::Item *) const |
Returns true if this layout contains the specified item. | |
int | count () const |
Returns the number of Item objects in this layout. This includes non-visible (placeholder) Items too. | |
Layout::Private * | d_ptr () |
virtual bool | deserialize (const LayoutSaver::MultiSplitter &) |
Vector< Core::DockWidget * > | dockWidgets () const |
Returns the list of dock widgets contained in this layout. | |
void | dumpLayout () const |
dumps the layout to stderr | |
Core::FloatingWindow * | floatingWindow () const |
Vector< Core::Group * > | groups () const |
Returns this list of Group objects contained in this layout. | |
bool | isInMainWindow (bool honourNesting=false) const |
Returns whether this layout is in a MainWindow. | |
Core::Item * | itemForGroup (const Core::Group *group) const |
returns the Item that holds group in this layout | |
Vector< Core::Item * > | items () const |
The list of items in this layout. | |
int | layoutHeight () const |
returns the contents height. Usually it's the same height as the respective parent MultiSplitter. | |
Size | layoutMaximumSizeHint () const |
returns the layout's maximum size hint | |
Size | layoutMinimumSize () const |
returns the layout's minimum size setLayoutMinimumSize | |
Size | layoutSize () const |
Returns the size of the contents. | |
int | layoutWidth () const |
returns the contents width. Usually it's the same width as the respective parent MultiSplitter. | |
Core::MainWindow * | mainWindow (bool honourNesting=false) const |
void | onCloseEvent (CloseEvent *) |
int | placeholderCount () const |
Returns the number of placeholder items in this layout. This is the same as count minus visibleCount. | |
void | removeItem (Core::Item *item) |
Removes an item from this MultiSplitter. | |
void | restorePlaceholder (Core::DockWidget *dw, Core::Item *, int tabIndex) |
restores the dockwidget dw to its previous position | |
Core::ItemContainer * | rootItem () const |
LayoutSaver::MultiSplitter | serialize () const |
void | setLayoutSize (Size) |
setter for the contents size The "contents size" is just the size() of this layout. However, since resizing QWidgets is async and we need it to be sync. As sometimes adding widgets will increase the MultiSplitter size (due to widget's min-size constraints). | |
void | updateSizeConstraints () |
Updates the min size of this layout. | |
void | viewAboutToBeDeleted () |
int | visibleCount () const |
Returns the number of visible Items in this layout. Which is count minus placeholderCount. | |
Public Member Functions inherited from KDDockWidgets::Core::Controller | |
Controller (ViewType type, View *) | |
virtual | ~Controller () |
bool | close () |
void | destroyLater () |
Controller::Private * | dptr () const |
Rect | geometry () const |
int | height () const |
bool | inDtor () const |
bool | is (ViewType) const |
Returns whether this controller is of the specified type. | |
bool | isFixedHeight () const |
bool | isFixedWidth () const |
bool | isVisible () const |
Point | mapToGlobal (Point) const |
Point | pos () const |
Rect | rect () const |
void | setParentView (View *parent) |
void | setVisible (bool) |
void | show () const |
Size | size () const |
ViewType | type () const |
Returns the type of this controller. | |
View * | view () const |
Returns the view associated with this controller, if any. | |
int | width () const |
std::shared_ptr< View > | window () const |
int | x () const |
int | y () const |
Additional Inherited Members | |
Static Public Member Functions inherited from KDDockWidgets::Core::Layout | |
static Layout * | fromLayoutingHost (LayoutingHost *) |
Protected Member Functions inherited from KDDockWidgets::Core::Layout | |
Vector< Core::Group * > | groupsFrom (View *groupOrMultiSplitter) const |
returns the groups contained in groupOrMultiSplitter- If groupOrMultiSplitter- is a Group, it returns a list of 1 element, with that group If groupOrMultiSplitter- is a MultiSplitter then it returns a list of all groups it contains | |
void | setLayoutMinimumSize (Size) |
setter for the minimum size minimumSize | |
void | setRootItem (Core::ItemContainer *root) |
void | unrefOldPlaceholders (const Vector< Core::Group * > &groupsBeingAdded) const |
Removes unneeded placeholder items when adding new groups. | |
Protected Member Functions inherited from KDDockWidgets::Core::Controller | |
virtual void | setParentView_impl (View *parent) |
Protected Attributes inherited from KDDockWidgets::Core::Controller | |
bool | m_inDtor = false |
The MDILayout class implements a layout suitable for MDI style docking. Where dock widgets are free to be positioned in arbitrary positions, not restricted by layouting.
Definition at line 32 of file core/MDILayout.h.
|
explicit |
Definition at line 23 of file core/MDILayout.cpp.
References KDDockWidgets::Core::Layout::setRootItem().
|
override |
Definition at line 30 of file core/MDILayout.cpp.
void MDILayout::addDockWidget | ( | Core::DockWidget * | dw, |
Point | localPt, | ||
const InitialOption & | addingOption = {} |
||
) |
docks the dock widgets into this MDI area, at the specified position
Definition at line 34 of file core/MDILayout.cpp.
References KDDockWidgets::Core::Layout::asLayoutingHost(), KDDockWidgets::Core::DockWidget::d, KDDockWidgets::Core::Layout::itemForGroup(), KDDockWidgets::Core::Controller::size(), and KDDockWidgets::InitialOption::startsHidden().
Referenced by KDDockWidgets::Core::MainWindowMDIViewInterface::addDockWidget(), and KDDockWidgets::MainWindowMDIInstantiator::addDockWidget().
void MDILayout::moveDockWidget | ( | Core::DockWidget * | dw, |
Point | pos | ||
) |
Moves a dock widget dw
to point pos
.
Definition at line 85 of file core/MDILayout.cpp.
References KDDockWidgets::Core::DockWidget::d, moveDockWidget(), and KDDockWidgets::Core::Controller::pos().
Referenced by moveDockWidget().
void MDILayout::moveDockWidget | ( | Core::Group * | group, |
Point | pos | ||
) |
Moves a dock widget group
to point pos
Convenience overload.
Definition at line 90 of file core/MDILayout.cpp.
References KDDockWidgets::Core::Layout::itemForGroup(), and KDDockWidgets::Core::Controller::pos().
void MDILayout::resizeDockWidget | ( | Core::DockWidget * | dw, |
Size | size | ||
) |
Sets the size of dock widget dw
to size
.
Definition at line 106 of file core/MDILayout.cpp.
References KDDockWidgets::Core::DockWidget::d, resizeDockWidget(), and KDDockWidgets::Core::Controller::size().
Referenced by resizeDockWidget(), and KDDockWidgets::QtQuick::Group::setMDISize().
void MDILayout::resizeDockWidget | ( | Core::Group * | group, |
Size | size | ||
) |
Sets the size of dock widget group
to size
Convenience overload.
Definition at line 111 of file core/MDILayout.cpp.
References KDDockWidgets::Core::Group::isMDI(), KDDockWidgets::Core::Layout::itemForGroup(), KDDockWidgets::Core::View::minSize(), KDDockWidgets::Core::Controller::size(), and KDDockWidgets::Core::Controller::view().
void MDILayout::setDockWidgetGeometry | ( | Core::Group * | group, |
Rect | geometry | ||
) |
sets the size and position of the dock widget group
Definition at line 71 of file core/MDILayout.cpp.
References KDDockWidgets::Core::Controller::geometry(), and KDDockWidgets::Core::Layout::itemForGroup().