KDDockWidgets API Documentation 2.0
|
#include <View.h>
Signals | |
void | geometryUpdated () |
void | itemGeometryChanged () |
Public Member Functions | |
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 | 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 | 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. | |
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() | |
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::objectProperty() | |
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. | |
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 |
Static Public Member Functions | |
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. | |
Protected Member Functions | |
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 |
Additional Inherited Members | |
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 |
Definition at line 52 of file qtquick/views/View.h.
|
explicit |
Definition at line 127 of file qtquick/views/View.cpp.
|
overridevirtualdefault |
Reimplemented from KDDockWidgets::Core::View.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 565 of file qtquick/views/View.cpp.
|
static |
Definition at line 723 of file qtquick/views/View.cpp.
Referenced by childViewAt(), childViews(), parentViewFor(), and KDDockWidgets::QtQuick::DockWidget::setGuestItem().
|
overridevirtual |
Returns this view, but as a wrapper.
Implements KDDockWidgets::Core::View.
Definition at line 733 of file qtquick/views/View.cpp.
Referenced by rootView().
|
override |
Definition at line 702 of file qtquick/views/View.cpp.
References asQQuickWrapper(), QPoint::x(), and QPoint::y().
|
overridevirtual |
@Returns a list of child views
Implements KDDockWidgets::Core::View.
Definition at line 809 of file qtquick/views/View.cpp.
References asQQuickWrapper(), and QVector::reserve().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 298 of file qtquick/views/View.cpp.
References close().
Referenced by close().
|
static |
Definition at line 283 of file qtquick/views/View.cpp.
References QEvent::isAccepted().
|
static |
Convenience to create a QQuickItem parented to parent
. Uses the engine from the parent.
Definition at line 840 of file qtquick/views/View.cpp.
References KDDockWidgets::cleanQRCFilename(), QFile::exists(), KDDockWidgets::QtQuick::Platform::instance(), and KDDockWidgets::QtQuick::Platform::qmlEngine().
|
static |
Convenience to create a QQuickItem.
Definition at line 163 of file qtquick/views/View.cpp.
Referenced by KDDockWidgets::QtQuick::ClassicDropIndicatorOverlay::ClassicDropIndicatorOverlay(), KDDockWidgets::QtQuick::RubberBand::RubberBand(), and KDDockWidgets::QtQuick::DockWidget::setGuestItem().
|
overridevirtual |
Enable/disable attributes. This is mostly for QtWidget compatibility Do not use. We don't depend on Qt::WidgetAttribute in a future version.
Implements KDDockWidgets::Core::View.
Definition at line 422 of file qtquick/views/View.cpp.
Referenced by move().
|
overrideprotected |
Definition at line 246 of file qtquick/views/View.cpp.
References QEvent::Close, KDDockWidgets::Core::View::d, and QEvent::type().
Referenced by KDDockWidgets::QtQuick::TitleBar::event(), KDDockWidgets::QtQuick::DockWidget::event(), and KDDockWidgets::QtQuick::TabBar::event().
Definition at line 254 of file qtquick/views/View.cpp.
References QEvent::ignore(), QEvent::isAccepted(), QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseMove, QEvent::Move, onWindowStateChangeEvent(), QEvent::Resize, QEvent::type(), and QEvent::WindowStateChange.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 444 of file qtquick/views/View.cpp.
Referenced by KDDockWidgets::QtQuick::TitleBar::event().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 764 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 462 of file qtquick/views/View.cpp.
References isRootView().
|
signal |
Referenced by updateGeometry().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 738 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 430 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 759 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 517 of file qtquick/views/View.cpp.
References setVisible().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 650 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 361 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 684 of file qtquick/views/View.cpp.
References Qt::WindowMaximized.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 676 of file qtquick/views/View.cpp.
References Qt::WindowMinimized.
|
finaloverridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 603 of file qtquick/views/View.cpp.
References isRootView().
Referenced by geometry(), isRootView(), move(), raise(), and setVisible().
|
static |
Definition at line 585 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 323 of file qtquick/views/View.cpp.
|
overrideprotected |
Definition at line 202 of file qtquick/views/View.cpp.
|
signal |
Referenced by QQUICKITEMgeometryChanged().
|
static |
This is equivalent to "anchors.fill: parent but in C++.
Definition at line 400 of file qtquick/views/View.cpp.
References QVariant::fromValue(), QObject::property(), QObject::setProperty(), and QVariant::value().
Referenced by KDDockWidgets::QtQuick::ClassicDropIndicatorOverlay::ClassicDropIndicatorOverlay(), KDDockWidgets::QtQuick::Group::insertDockWidget(), and KDDockWidgets::QtQuick::DockWidget::setGuestItem().
Definition at line 618 of file qtquick/views/View.cpp.
|
override |
Definition at line 623 of file qtquick/views/View.cpp.
References KDDockWidgets::QtQuick::asQQuickItem(), and KDDockWidgets::Core::View::pos().
Definition at line 613 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 455 of file qtquick/views/View.cpp.
References QSize::boundedTo(), and QSize::isEmpty().
Referenced by KDDockWidgets::QtQuick::DockWidget::maxSizeHint(), setMaximumSize(), and KDDockWidgets::QtQuick::Group::updateConstraints().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 449 of file qtquick/views/View.cpp.
References QSize::expandedTo().
Referenced by KDDockWidgets::QtQuick::DockWidget::minSize(), setMinimumSize(), and setSize().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 232 of file qtquick/views/View.cpp.
References enableAttribute(), isRootView(), Qt::WA_Moved, KDDockWidgets::Core::View::x(), and KDDockWidgets::Core::View::y().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 473 of file qtquick/views/View.cpp.
|
inlineprotectedvirtual |
Override in case you want to have different styling on hover.
Reimplemented in KDDockWidgets::QtQuick::TabBar.
Definition at line 173 of file qtquick/views/View.h.
void View::onWindowStateChangeEvent | ( | QWindowStateChangeEvent * | ) |
Definition at line 821 of file qtquick/views/View.cpp.
References window().
Referenced by eventFilter().
|
overridevirtual |
Returns the gui element's parent. Like QWidget::parentWidget()
Implements KDDockWidgets::Core::View.
Definition at line 728 of file qtquick/views/View.cpp.
References parentViewFor().
|
static |
Definition at line 709 of file qtquick/views/View.cpp.
References asQQuickWrapper(), and window().
Referenced by parentView().
|
overrideprotected |
Definition at line 303 of file qtquick/views/View.cpp.
References itemGeometryChanged(), QEvent::Move, QEvent::Resize, QRectF::size(), and QRectF::topLeft().
QQuickView * View::quickView | ( | ) | const |
Definition at line 608 of file qtquick/views/View.cpp.
|
overridevirtual |
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 571 of file qtquick/views/View.cpp.
References isRootView().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 560 of file qtquick/views/View.cpp.
References raiseAndActivate().
Referenced by raiseAndActivate().
|
static |
Definition at line 552 of file qtquick/views/View.cpp.
void View::redirectMouseEvents | ( | QQuickItem * | from | ) |
Definition at line 175 of file qtquick/views/View.cpp.
References MouseEventRedirector.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 748 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 743 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 788 of file qtquick/views/View.cpp.
References QImage::devicePixelRatio(), QPainter::drawImage(), KDDockWidgets::Core::View::pos(), QRect::size(), and QPainter::window().
|
overridevirtual |
Returns the top-level gui element which this view is inside It's the root view of the window.
Implements KDDockWidgets::Core::View.
Definition at line 391 of file qtquick/views/View.cpp.
References asWrapper(), and window().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 799 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 507 of file qtquick/views/View.cpp.
References setHeight().
Referenced by KDDockWidgets::QtQuick::TitleBar::TitleBar().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 502 of file qtquick/views/View.cpp.
References setWidth().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 435 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 753 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 769 of file qtquick/views/View.cpp.
Referenced by KDDockWidgets::QtQuick::DockWidget::DockWidget().
|
override |
Definition at line 157 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 497 of file qtquick/views/View.cpp.
Referenced by setFixedHeight().
|
override |
Definition at line 483 of file qtquick/views/View.cpp.
References KDDockWidgets::Core::View::d, maxSizeHint(), and updateGeometry().
|
override |
Definition at line 779 of file qtquick/views/View.cpp.
References KDDockWidgets::Core::View::d, minSize(), and updateGeometry().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 804 of file qtquick/views/View.cpp.
void View::setNormalGeometry | ( | QRect | geo | ) |
Definition at line 478 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 547 of file qtquick/views/View.cpp.
References KDDockWidgets::QtQuick::asQQuickItem(), and setParent().
Referenced by KDDockWidgets::QtQuick::FloatingWindow::~FloatingWindow(), and setParent().
void View::setParent | ( | QQuickItem * | parent | ) |
Definition at line 532 of file qtquick/views/View.cpp.
References KDDockWidgets::Core::View::m_inDtor, and setVisible().
|
finaloverridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 367 of file qtquick/views/View.cpp.
References QSize::expandedTo(), and minSize().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 339 of file qtquick/views/View.cpp.
References KDDockWidgets::Core::View::is(), and isRootView().
Referenced by KDDockWidgets::QtQuick::DockWidget::DockWidget(), KDDockWidgets::QtQuick::RubberBand::RubberBand(), hide(), setParent(), and show().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 492 of file qtquick/views/View.cpp.
Referenced by setFixedWidth().
|
override |
Definition at line 644 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 632 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 638 of file qtquick/views/View.cpp.
|
overridevirtual |
Sets the z order Not supported on all platforms.
Reimplemented from KDDockWidgets::Core::View.
Definition at line 875 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 512 of file qtquick/views/View.cpp.
References setVisible().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 670 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 664 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 658 of file qtquick/views/View.cpp.
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 527 of file qtquick/views/View.cpp.
void View::updateGeometry | ( | ) |
Definition at line 522 of file qtquick/views/View.cpp.
References geometryUpdated().
Referenced by setMaximumSize(), and setMinimumSize().
|
overridevirtual |
Implements KDDockWidgets::Core::View.
Definition at line 774 of file qtquick/views/View.cpp.
|
virtual |
Reimplemented in KDDockWidgets::QtQuick::Group.
Definition at line 880 of file qtquick/views/View.cpp.
Referenced by KDDockWidgets::QtQuick::RubberBand::RubberBand(), and KDDockWidgets::QtQuick::DockWidget::groupVisualItem().
|
overridevirtual |
Returns the window this view is inside For the Qt frontend, this wraps a QWindow. Like QWidget::window()
Implements KDDockWidgets::Core::View.
Definition at line 692 of file qtquick/views/View.cpp.
Referenced by onWindowStateChangeEvent(), parentViewFor(), and rootView().