19#ifndef KD_DOCKWIDGET_BASE_H
20#define KD_DOCKWIDGET_BASE_H
22#include "docks_export.h"
56#ifndef PYTHON_BINDINGS
63 Q_PROPERTY(
bool isFocused READ isFocused NOTIFY isFocusedChanged)
64 Q_PROPERTY(
bool isFloating READ isFloating WRITE setFloating NOTIFY isFloatingChanged)
65 Q_PROPERTY(
QString uniqueName READ uniqueName CONSTANT)
66 Q_PROPERTY(
QString title READ title WRITE setTitle NOTIFY titleChanged)
67 Q_PROPERTY(
QObject *widget READ widget NOTIFY widgetChanged)
76 Option_NotClosable = 1,
77 Option_NotDockable = 2,
78 Option_DeleteOnClose = 4,
79 Option_MDINestable = 8
83 Q_DECLARE_FLAGS(Options, Option)
91 Q_DECLARE_FLAGS(LayoutSaverOptions, LayoutSaverOption)
97 All = ToggleAction | TitleBar | TabBar
100 Q_DECLARE_FLAGS(IconPlaces, IconPlace)
112 Options options = KDDockWidgets::DockWidgetBase::Options(),
113 LayoutSaverOptions layoutSaverOptions = KDDockWidgets::DockWidgetBase::LayoutSaverOptions());
156 virtual void setWidget(QWidgetOrQuick *widget);
170 bool isFloating()
const;
178 bool setFloating(
bool floats);
184 Q_INVOKABLE
QAction *toggleAction()
const;
190 Q_INVOKABLE
QAction *floatAction()
const;
210 void setTitle(
const QString &title);
222 QRect frameGeometry()
const;
228 Options options()
const;
232 KDDockWidgets::DockWidgetBase::LayoutSaverOptions layoutSaverOptions()
const;
241 void setOptions(Options);
251 bool isTabbed()
const;
259 bool isCurrentTab()
const;
264 Q_INVOKABLE
void setAsCurrentTab();
271 int tabIndex()
const;
276 int currentTabIndex()
const;
286 void setIcon(
const QIcon &icon, IconPlaces places = IconPlace::All);
295 QIcon icon(IconPlace place = IconPlace::TitleBar)
const;
301 Q_INVOKABLE
void forceClose();
309 TitleBar *titleBar()
const;
315 Q_INVOKABLE
bool isOpen()
const;
338 void setAffinityName(
const QString &name);
346 Q_INVOKABLE
void show();
355 Q_INVOKABLE
void raise();
367 bool isMainWindow()
const;
376 bool isInMainWindow()
const;
380 MainWindowBase *mainWindow()
const;
386 bool isFocused()
const;
397 Q_INVOKABLE
void moveToSideBar();
403 bool isOverlayed()
const;
413 bool isInSideBar()
const;
419 bool hasPreviousDockedLocation()
const;
423 QSize lastOverlayedSize()
const;
429 static DockWidgetBase *byName(
const QString &uniqueName);
432 bool skipsRestore()
const;
441 void setFloatingGeometry(
QRect geo);
447 void setUserType(
int userType);
448 int userType()
const;
452 void setMDIPosition(
QPoint pos);
454 void setMDISize(
QSize size);
461 bool isPersistentCentralDockWidget()
const;
469 void setFloatingWindowFlags(FloatingWindowFlags);
470 KDDockWidgets::FloatingWindowFlags floatingWindowFlags()
const;
473#ifdef KDDOCKWIDGETS_QTWIDGETS
529 void onParentChanged();
530 void onShown(
bool spontaneous);
531 void onHidden(
bool spontaneous);
533#ifndef PYTHON_BINDINGS
535 bool onResize(
QSize newSize)
override;
538#if defined(DOCKS_DEVELOPER_MODE)
544 friend class MultiSplitter;
545 friend class LayoutWidget;
546 friend class MDILayoutWidget;
547 friend class FloatingWindow;
549 friend class DropArea;
550 friend class ::TestDocks;
551 friend class StateDragging;
571 Private *dptr() const;
Class to save and restore dockwidget layouts.
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...