KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KDDockWidgets::Core::MDILayout Class Reference

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>

Inheritance diagram for KDDockWidgets::Core::MDILayout:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::Core::MDILayout:
Collaboration graph
[legend]

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::DropAreaasDropArea () const
 
LayoutingHost * asLayoutingHost () const
 
Core::MDILayoutasMDILayout () 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::FloatingWindowfloatingWindow () 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::MainWindowmainWindow (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.
 
Viewview () const
 Returns the view associated with this controller, if any.
 
int width () const
 
std::shared_ptr< Viewwindow () const
 
int x () const
 
int y () const
 

Additional Inherited Members

- Static Public Member Functions inherited from KDDockWidgets::Core::Layout
static LayoutfromLayoutingHost (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MDILayout()

MDILayout::MDILayout ( View parent = nullptr)
explicit

Definition at line 23 of file core/MDILayout.cpp.

References KDDockWidgets::Core::Layout::setRootItem().

◆ ~MDILayout()

MDILayout::~MDILayout ( )
override

Definition at line 30 of file core/MDILayout.cpp.

Member Function Documentation

◆ addDockWidget()

void MDILayout::addDockWidget ( Core::DockWidget dw,
Point  localPt,
const InitialOption addingOption = {} 
)

◆ moveDockWidget() [1/2]

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().

◆ moveDockWidget() [2/2]

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().

◆ resizeDockWidget() [1/2]

void MDILayout::resizeDockWidget ( Core::DockWidget dw,
Size  size 
)

◆ resizeDockWidget() [2/2]

void MDILayout::resizeDockWidget ( Core::Group group,
Size  size 
)

◆ setDockWidgetGeometry()

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().


The documentation for this class was generated from the following files:

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8