KDDockWidgets API Documentation 2.1
|
Represents a dock widget. More...
#include <DockWidget.h>
Signals | |
void | actualTitleBarChanged () |
void | groupGeometryChanged (QRect) |
The geometry of the group container this dock widget is in changed For example, when dragging a dockwidget. | |
void | guestItemChanged () |
void | isFloatingChanged () |
void | isFocusedChanged () |
void | optionsChanged () |
void | titleChanged () |
Signals inherited from KDDockWidgets::QtQuick::View | |
void | geometryUpdated () |
void | itemGeometryChanged () |
Public Member Functions | |
DockWidget (const QString &uniqueName, DockWidgetOptions={}, LayoutSaverOptions={}, Qt::WindowFlags=Qt::Tool, QQmlEngine *engine=nullptr) | |
constructs a new DockWidget | |
~DockWidget () override | |
destructor | |
QObject * | actualTitleBarView () const |
Returns the title bar view Qt6 requires us to include TitleBar_p.h, so instead the Q_PROPERTY uses QObject so we don't include private headers in public headers. | |
Q_INVOKABLE KDDockWidgets::QtQuick::Action * | floatAction () const |
std::shared_ptr< Core::View > | focusCandidate () const override |
QQuickItem * | groupVisualItem () const |
Returns the visual item which represents Group in the screen Equivalent to Group::visualItem(). | |
QQuickItem * | guestItem () const |
Returns the guest item that we're hosting. | |
QSize | maxSizeHint () const override |
Reimplemented for internal purposes. . | |
QSize | minSize () const override |
Reimplemented for internal purposes. . | |
Q_INVOKABLE void | onGeometryUpdated () |
Called by QtQuick when min-size changes. | |
void | raise () override |
void | setGuestItem (const QString &qmlFilename, QQmlContext *context=nullptr) |
Q_INVOKABLE void | setGuestItem (QQuickItem *) |
Reimplemented for internal purposes. . | |
void | show () override |
Q_INVOKABLE KDDockWidgets::QtQuick::Action * | toggleAction () const |
Public Member Functions inherited from KDDockWidgets::QtQuick::View | |
View (Core::Controller *controller, Core::ViewType type, QQuickItem *parent=nullptr, Qt::WindowFlags windowFlags={}) | |
~View () override=default | |
void | activateWindow () override |
std::shared_ptr< Core::View > | asWrapper () override |
Returns this view, but as a wrapper. | |
std::shared_ptr< Core::View > | childViewAt (QPoint p) const override |
QVector< std::shared_ptr< Core::View > > | childViews () const override |
@Returns a list of child views | |
bool | close () override |
void | enableAttribute (Qt::WidgetAttribute attr, bool enable=true) override |
Qt::WindowFlags | flags () const override |
Qt::FocusPolicy | focusPolicy () const override |
QRect | geometry () const override |
void | grabMouse () override |
bool | hasAttribute (Qt::WidgetAttribute attr) const override |
bool | hasFocus () const override |
void | hide () override |
bool | isActiveWindow () const override |
bool | isExplicitlyHidden () const override |
bool | isFixedHeight () const |
bool | isFixedWidth () const |
bool | isMaximized () const override |
bool | isMinimized () const override |
bool | isRootView () const override final |
bool | isVisible () const override |
QPoint | mapFromGlobal (QPoint globalPt) const override |
QPoint | mapTo (Core::View *parent, QPoint pos) const override |
QPoint | mapToGlobal (QPoint localPt) const override |
QSize | maxSizeHint () const override |
QSize | minSize () const override |
void | move (int x, int y) override |
QRect | normalGeometry () const override |
void | onWindowStateChangeEvent (QWindowStateChangeEvent *) |
std::shared_ptr< Core::View > | parentView () const override |
Returns the gui element's parent. Like QWidget::parentWidget() | |
QQuickView * | quickView () const |
void | raise () override |
void | raiseAndActivate () override |
Q_INVOKABLE void | redirectMouseEvents (QQuickItem *from) |
void | releaseKeyboard () override |
void | releaseMouse () override |
void | render (QPainter *) override |
std::shared_ptr< Core::View > | rootView () const override |
Returns the top-level gui element which this view is inside It's the root view of the window. | |
void | setCursor (Qt::CursorShape shape) override |
void | setFixedHeight (int h) override |
void | setFixedSize (Size) |
void | setFixedWidth (int w) override |
void | setFlag (Qt::WindowType f, bool on=true) override |
void | setFocus (Qt::FocusReason reason) override |
void | setFocusPolicy (Qt::FocusPolicy) override |
void | setGeometry (QRect) override |
void | setHeight (int h) override |
void | setMaximumSize (QSize sz) override |
void | setMinimumSize (QSize sz) override |
void | setMouseTracking (bool enable) override |
void | setNormalGeometry (QRect geo) |
void | setParent (Core::View *parent) override |
void | setParent (QQuickItem *parent) |
void | setSize (int w, int h) override final |
void | setVisible (bool is) override |
void | setWidth (int w) override |
void | setWindowIcon (const QIcon &icon) override |
void | setWindowOpacity (double v) override |
void | setWindowTitle (const QString &title) override |
void | setZOrder (int) override |
Sets the z order Not supported on all platforms and only relevant for MDI mode. | |
void | show () override |
Q_INVOKABLE void | showMaximized () override |
Q_INVOKABLE void | showMinimized () override |
Q_INVOKABLE void | showNormal () override |
void | update () override |
void | updateGeometry () |
QString | viewName () const override |
virtual QQuickItem * | visualItem () const |
std::shared_ptr< Core::Window > | window () const override |
Returns the window this view is inside For the Qt frontend, this wraps a QWindow. Like QWidget::window() | |
int | zOrder () const override |
Public Member Functions inherited from KDDockWidgets::QtCommon::View_qt | |
View_qt (Core::Controller *controller, Core::ViewType type, QObject *thisObj) | |
~View_qt () override | |
Core::HANDLE | handle () const override |
Returns a handle for the GUI element This value only makes sense to the frontend. For example, for QtQuick it might be a QQuickItem, while for QtWidgets it's a QWidget. Can be whatever the frontend developer wants, as long as it uniquely identifies the GUI element. KDDW backend only uses it for comparison purposes. | |
void | setViewName (const QString &name) override |
Equivalent to Qt's QObject::objectName() | |
QObject * | thisObject () const |
virtual QVariant | viewProperty (const char *name) const |
Equivalent to Qt's QObject::property() | |
Public Member Functions inherited from KDDockWidgets::Core::View | |
View (Controller *controller, ViewType) | |
template<typename T > | |
T * | asController () |
Returns the View's controller, casted as T. | |
Core::DockWidget * | asDockWidgetController () const |
Core::DropArea * | asDropAreaController () const |
Core::FloatingWindow * | asFloatingWindowController () const |
asFooController() are deprecated. Use asController<T>() instead | |
Core::Group * | asGroupController () const |
Core::Layout * | asLayout () const |
Core::MainWindow * | asMainWindowController () const |
Core::MDILayout * | asMDILayoutController () const |
Core::Stack * | asStackController () const |
Core::TabBar * | asTabBarController () const |
Core::TitleBar * | asTitleBarController () const |
virtual std::shared_ptr< View > | childViewAt (Point localPos) const =0 |
Controller * | controller () const |
Returns this view's controller. | |
virtual void | createPlatformWindow () |
bool | deliverViewEventToFilters (Event *e) |
Delivers mouse events and such to event filters. | |
void | dumpDebug () |
Prints some debug to stderr. | |
bool | equals (const std::shared_ptr< View > &) const |
bool | equals (const View *other) const |
Returns whether this view represents the same GUI element as the other. | |
int | height () const |
bool | inDtor () const |
Returns whether the DTOR is currently running. freed() might be true while inDtor false, as the implementation of free() is free to delay it (with deleteLater() for example) | |
virtual void | init () |
void | installViewEventFilter (EventFilterInterface *) |
Installs an event filter in this view to intercept the event it receives Analogue to QObject::installEventFilter() in the Qt world. | |
virtual bool | is (ViewType) const |
Returns whether the view is of the specified type Virtual so it can be overridden by ViewWrapper. When we're wrapping an existing GUI element only the specific frontend can know what's the actual type. | |
bool | isFixedHeight () const |
bool | isFixedWidth () const |
virtual bool | isNull () const |
Returns whether the gui item represented by this view was already deleted Usually false, as KDDW internal gui elements inherit View, and nobody will access them after destruction. However, ViewWrapper derived classes, wrap an existing gui element, which might get deleted. Override isNull() in our ViewWrapper subclasses and return true if the wrapped gui element was already deleted. | |
virtual Point | mapFromGlobal (Point) const =0 |
virtual Point | mapTo (View *, Point) const =0 |
virtual Point | mapToGlobal (Point) const =0 |
int | minimumHeight () const |
int | minimumWidth () const |
void | move (Point) |
virtual bool | onFocusInEvent (FocusEvent *) |
virtual bool | onResize (int h, int w) |
bool | onResize (Size) |
Point | pos () const |
Rect | rect () const |
void | removeViewEventFilter (EventFilterInterface *) |
Removes the event filter. | |
void | resize (int w, int h) |
void | resize (Size) |
Size | screenSize () const |
Returns the size of the screen that this view belongs to. | |
virtual void | setGeometry (Rect)=0 |
virtual void | setMaximumSize (Size sz)=0 |
virtual void | setMinimumSize (Size)=0 |
void | setSize (Size) |
virtual void | setWindowIcon (const Icon &)=0 |
Size | size () const |
int | width () const |
int | x () const |
int | y () const |
Public Member Functions inherited from KDDockWidgets::Core::DockWidgetViewInterface | |
DockWidgetViewInterface (DockWidget *) | |
virtual | ~DockWidgetViewInterface () |
TitleBar * | actualTitleBar () const |
void | addDockWidgetAsTab (DockWidgetViewInterface *other, const KDDockWidgets::InitialOption &initialOption={}) |
void | addDockWidgetToContainingWindow (DockWidgetViewInterface *other, KDDockWidgets::Location location, DockWidgetViewInterface *relativeTo=nullptr, const KDDockWidgets::InitialOption &initialOption={}) |
Vector< QString > | affinities () const |
DockWidget * | dockWidget () const |
void | forceClose () |
Group * | group () const |
Icon | icon (IconPlace place=IconPlace::TitleBar) const |
bool | isFloating () const |
bool | isFocused () const |
bool | isOpen () const |
void | moveToSideBar () |
void | open () |
DockWidgetOptions | options () const |
void | raise () |
void | setAffinities (const Vector< QString > &) |
void | setAffinityName (const QString &name) |
void | setAsCurrentTab () |
void | setFloating (bool) |
void | setIcon (const Icon &icon, IconPlaces places=IconPlace::All) |
void | setMDIPosition (Point pos) |
Sets this dock widgets position to pos within the MDI layout This only applies if the main window is in MDI mode, which it is not by default. | |
void | setMDISize (Size size) |
like setMDIPosition(), but for the size. | |
void | setMDIZ (int z) |
like setMDIPosition(), but for the Z only implemented for QtQuick | |
void | setOptions (DockWidgetOptions) |
void | setTitle (const QString &) |
void | show () |
QString | title () const |
QString | uniqueName () const |
Protected Member Functions | |
bool | event (QEvent *e) override |
Protected Member Functions inherited from KDDockWidgets::QtQuick::View | |
bool | event (QEvent *) override |
bool | eventFilter (QObject *watched, QEvent *ev) override |
void | itemChange (QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override |
virtual void | onHoverEvent (QHoverEvent *, QPoint) |
Override in case you want to have different styling on hover. | |
void | QQUICKITEMgeometryChanged (const QRectF &newGeometry, const QRectF &oldGeometry) override |
Protected Member Functions inherited from KDDockWidgets::Core::View | |
View (const View &)=delete | |
View & | operator= (const View &)=delete |
Protected Member Functions inherited from KDDockWidgets::Core::DockWidgetViewInterface | |
DockWidgetViewInterface (const DockWidgetViewInterface &)=delete | |
DockWidgetViewInterface & | operator= (const DockWidgetViewInterface &)=delete |
Properties | |
QObject * | actualTitleBar |
QObject * | guestItem |
bool | isFloating |
bool | isFocused |
KDDockWidgets::DockWidgetOptions | options |
QString | title |
QString | uniqueName |
Properties inherited from KDDockWidgets::QtQuick::View | |
bool | isFixedHeight |
bool | isFixedWidth |
Additional Inherited Members | |
Static Public Member Functions inherited from KDDockWidgets::QtQuick::View | |
static std::shared_ptr< Core::View > | asQQuickWrapper (QQuickItem *item) |
static bool | close (QQuickItem *) |
static QQuickItem * | createItem (const QString &filename, QQuickItem *parent, QQmlContext *ctx=nullptr) |
Convenience to create a QQuickItem parented to parent . Uses the engine from the parent. | |
static QQuickItem * | createItem (QQmlEngine *engine, const QString &filename, QQmlContext *context=nullptr) |
Convenience to create a QQuickItem. | |
static bool | isRootView (const QQuickItem *) |
static void | makeItemFillParent (QQuickItem *item) |
This is equivalent to "anchors.fill: parent but in C++. | |
static std::shared_ptr< Core::View > | parentViewFor (const QQuickItem *) |
static void | raiseAndActivate (QQuickItem *) |
Static Public Member Functions inherited from KDDockWidgets::QtCommon::View_qt | |
static QObject * | asQObject (View *) |
Static Public Member Functions inherited from KDDockWidgets::Core::View | |
static bool | equals (const View *one, const View *two) |
static Controller * | firstParentOfType (View *view, ViewType) |
Returns the controller of the first parent view of the specified type Goes up the view hierarchy chain until it finds it. Returns nullptr otherwise. | |
static Size | hardcodedMinimumSize () |
The minimum minimum size a dock widget can have. | |
Public Attributes inherited from KDDockWidgets::Core::View | |
Private *const | d |
Protected Attributes inherited from KDDockWidgets::QtCommon::View_qt | |
EventFilter *const | m_eventFilter |
QObject *const | m_thisObj |
Protected Attributes inherited from KDDockWidgets::Core::View | |
Controller *const | m_controller |
bool | m_inDtor = false |
Protected Attributes inherited from KDDockWidgets::Core::DockWidgetViewInterface | |
DockWidget *const | m_dockWidget |
Represents a dock widget.
Most of the interface lives in Core::DockWidget, to facilitate sharing with QtQuick.
Definition at line 43 of file qtquick/views/DockWidget.h.
|
explicit |
constructs a new DockWidget
uniqueName | the name of the dockwidget, should be unique. Use title for user visible text. |
options | optional options controlling behaviour |
layoutSaverOptions | options regarding LayoutSaver behaviour |
engine | the QML engine this dock widget will be created on. If not specified then Config::self().qmlEngine() will be used |
There's no parent argument. The DockWidget is either parented to FloatingWindow or MainWindow when visible, or stays without a parent when hidden.
Definition at line 56 of file qtquick/views/DockWidget.cpp.
References actualTitleBarChanged(), KDDockWidgets::Core::DockWidget::d, KDDockWidgets::Core::DockWidgetViewInterface::dockWidget(), KDDockWidgets::Core::DockWidget::init(), isFloatingChanged(), isFocusedChanged(), KDDockWidgets::Core::DockWidgetViewInterface::m_dockWidget, optionsChanged(), KDDockWidgets::QtQuick::View::setFocusPolicy(), KDDockWidgets::QtQuick::View::setVisible(), Qt::StrongFocus, and titleChanged().
|
override |
destructor
Definition at line 87 of file qtquick/views/DockWidget.cpp.
|
signal |
Referenced by DockWidget().
QObject * DockWidget::actualTitleBarView | ( | ) | const |
Returns the title bar view Qt6 requires us to include TitleBar_p.h, so instead the Q_PROPERTY uses QObject so we don't include private headers in public headers.
Definition at line 150 of file qtquick/views/DockWidget.cpp.
References actualTitleBar.
|
overrideprotected |
Definition at line 114 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::Core::DockWidgetViewInterface::dockWidget(), KDDockWidgets::QtQuick::View::event(), KDDockWidgets::Core::DockWidget::open(), QEvent::Show, and QEvent::type().
QtQuick::Action * DockWidget::floatAction | ( | ) | const |
Definition at line 185 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::Core::DockWidgetViewInterface::m_dockWidget, and KDDockWidgets::Core::DockWidget::toggleAction().
|
overridevirtual |
Implements KDDockWidgets::Core::DockWidgetViewInterface.
Definition at line 190 of file qtquick/views/DockWidget.cpp.
|
signal |
The geometry of the group container this dock widget is in changed For example, when dragging a dockwidget.
QQuickItem * DockWidget::groupVisualItem | ( | ) | const |
Returns the visual item which represents Group in the screen Equivalent to Group::visualItem().
Definition at line 159 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::QtQuick::asView_qtquick(), KDDockWidgets::Core::DockWidgetViewInterface::group(), KDDockWidgets::Core::Controller::view(), and KDDockWidgets::QtQuick::View::visualItem().
QQuickItem * DockWidget::guestItem | ( | ) | const |
Returns the guest item that we're hosting.
Definition at line 106 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::QtQuick::asQQuickItem(), KDDockWidgets::Core::DockWidget::guestView(), and KDDockWidgets::Core::DockWidgetViewInterface::m_dockWidget.
|
signal |
|
signal |
Referenced by DockWidget().
|
signal |
Referenced by DockWidget().
|
overridevirtual |
Reimplemented for internal purposes.
.
Implements KDDockWidgets::Core::View.
Definition at line 138 of file qtquick/views/DockWidget.cpp.
References QSize::boundedTo(), KDDockWidgets::Core::DockWidgetViewInterface::dockWidget(), and KDDockWidgets::QtQuick::View::maxSizeHint().
|
overridevirtual |
Reimplemented for internal purposes.
.
Implements KDDockWidgets::Core::View.
Definition at line 126 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::Core::DockWidgetViewInterface::dockWidget(), QSize::expandedTo(), and KDDockWidgets::QtQuick::View::minSize().
void DockWidget::onGeometryUpdated | ( | ) |
Called by QtQuick when min-size changes.
Definition at line 169 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::QtQuick::asView_qtquick(), KDDockWidgets::Core::DockWidgetViewInterface::group(), KDDockWidgets::QtQuick::Group::updateConstraints(), and KDDockWidgets::Core::Controller::view().
|
signal |
Referenced by DockWidget().
|
inlineoverridevirtual |
If this view is a root view, then raises its window, otherwise, raises itself relatively to its siblings and does not raise its window
Implements KDDockWidgets::Core::View.
Definition at line 117 of file qtquick/views/DockWidget.h.
void DockWidget::setGuestItem | ( | const QString & | qmlFilename, |
QQmlContext * | context = nullptr |
||
) |
Sets the DockWidget's guest item
qmlFilename | The path to a QML file to load. This path is passed to QQmlComponent. |
context | An optional QQmlContext. This is passed to QQmlComponent::create(). |
Definition at line 92 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::QtQuick::View::createItem(), and setGuestItem().
Referenced by setGuestItem().
void DockWidget::setGuestItem | ( | QQuickItem * | item | ) |
Reimplemented for internal purposes.
.
Definition at line 98 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::QtQuick::View::asQQuickWrapper(), KDDockWidgets::Core::DockWidgetViewInterface::dockWidget(), KDDockWidgets::QtQuick::View::makeItemFillParent(), and KDDockWidgets::Core::DockWidget::setGuestView().
|
inlineoverridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 110 of file qtquick/views/DockWidget.h.
|
signal |
Referenced by DockWidget().
QtQuick::Action * DockWidget::toggleAction | ( | ) | const |
Definition at line 180 of file qtquick/views/DockWidget.cpp.
References KDDockWidgets::Core::DockWidgetViewInterface::m_dockWidget, and KDDockWidgets::Core::DockWidget::toggleAction().
|
read |
Definition at line 47 of file qtquick/views/DockWidget.h.
Referenced by actualTitleBarView().
|
read |
Definition at line 52 of file qtquick/views/DockWidget.h.
|
readwrite |
Definition at line 49 of file qtquick/views/DockWidget.h.
|
read |
Definition at line 48 of file qtquick/views/DockWidget.h.
|
readwrite |
Definition at line 53 of file qtquick/views/DockWidget.h.
|
readwrite |
Definition at line 51 of file qtquick/views/DockWidget.h.
|
read |
Definition at line 50 of file qtquick/views/DockWidget.h.