KDDockWidgets API Documentation 2.0
|
implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc. More...
#include <Platform.h>
Public Member Functions | |
Platform () | |
~Platform () override | |
Core::ViewFactory * | createDefaultViewFactory () override |
Creates and returns the default ViewFactory. | |
Core::View * | createView (Core::Controller *controller, Core::View *parent=nullptr) const override |
Create an empty view For Qt this would just returns a empty QWidget or QQuickItem other frontends can return something as basic. | |
bool | inDisallowedDragView (QPoint globalPos) const override |
const char * | name () const override |
Returns the name of the platform, only "qtwidgets" and "qtquick". | |
QQmlEngine * | qmlEngine () const |
std::shared_ptr< Core::View > | qobjectAsView (QObject *) const override |
Returns the specified QObject casted to View Nullptr if it's not a view. | |
int | screenNumberFor (Core::View *) const override |
Returns the screen index for the specified view or window. It's up to the platform to decide how screens are ordered, kddw won't care. | |
QSize | screenSizeFor (Core::View *) const override |
Returns the size of the screen where this view is in. | |
void | setQmlEngine (QQmlEngine *) |
void | ungrabMouse () override |
Releases the mouse grab, if any. | |
bool | usesFallbackMouseGrabber () const override |
Return whether we use the global event filter based mouse grabber. | |
QtQuick::ViewFactory * | viewFactory () const |
std::shared_ptr< Core::Window > | windowAt (QPoint globalPos) const override |
std::shared_ptr< Core::Window > | windowFromQWindow (QWindow *) const override |
Public Member Functions inherited from KDDockWidgets::QtCommon::Platform_qt | |
Platform_qt () | |
~Platform_qt () override | |
QString | applicationName () const override |
Returns the application name This name will be used as title of floating dock widgets which contain more than 1 group. | |
QPoint | cursorPos () const override |
Returns the mouse cursor position in screen coordinates. | |
DisplayType | displayType () const override |
Returns the type of graphics stack being used. | |
std::shared_ptr< Core::View > | focusedView () const override |
Returns the focused view, if any. | |
bool | isLeftMouseButtonPressed () const override |
Returns whether the left mouse button is pressed. | |
bool | isProcessingAppQuitEvent () const override |
Returns whether we're processing a Event::Quit. | |
std::shared_ptr< Core::Screen > | primaryScreen () const override |
std::shared_ptr< Core::Window > | qobjectAsWindow (QObject *) const |
QByteArray | readFile (const QString &fileName, bool &ok) const override |
void | restoreMouseCursor () override |
Undoes the call to setMouseCursor() | |
void | runDelayed (int ms, Core::DelayedCall *) override |
int | screenNumberFor (std::shared_ptr< Core::Window >) const override |
QVector< std::shared_ptr< Core::Screen > > | screens () const override |
Returns all available screens. | |
void | sendEvent (Core::View *, QEvent *) const override |
void | setCursorPos (QPoint) override |
void | setMouseCursor (Qt::CursorShape, bool discardLast=false) override |
Sets the mouse cursor to the specified shape, this has an application-wide effect Call restoreMouseCursor() to set the previous cursor shape. | |
bool | supportsAeroSnap () const override |
Only supported on Qt, for windows. | |
QVector< std::shared_ptr< Core::Window > > | windows () const override |
Returns all windows. | |
Public Member Functions inherited from KDDockWidgets::Core::Platform | |
virtual void | dumpManagedBacktrace () |
For non-C++, managed languages (having a VM) prints a non-native back-trace For example, the flutter frontend implements this to get a dart backtrace Used for debugging only. Can be called by gdb. | |
virtual bool | hasActivePopup () const |
Returns whether a popup is open Usually not needed to override. Investigate further in case side bars aren't auto hiding. | |
virtual bool | inDisallowedDragView (Point globalPos) const =0 |
Returns whether the specified global position is on top of a view that isn't draggable. This is needed since not the entire title bar is draggable. For example, clicking on the close button shouldn't start a drag. | |
void | installGlobalEventFilter (EventFilterInterface *) |
Installs a global event filter Events will be forwarded to the specified EventFilterInterface. | |
bool | isQt () const |
Returns whether this platform is Qt based. | |
bool | isQtQuick () const |
Returns whether this platform is QtQuick. | |
bool | isQtWidgets () const |
Returns whether this platform is QtWidgets. | |
virtual void | onFloatingWindowCreated (Core::FloatingWindow *) |
Called when a floating window is created. Overridden by flutter, so it can create a window. | |
virtual void | onFloatingWindowDestroyed (Core::FloatingWindow *) |
Called when a floating window is created. Overridden by flutter, so it can destroy the window. | |
virtual void | onMainWindowCreated (Core::MainWindow *) |
Called when a main window is created. Overridden by flutter, so it can create a window Used by tests only. In real life users will instantiate a MainWindow in dart directly. | |
virtual void | onMainWindowDestroyed (Core::MainWindow *) |
Called when a main window is created. Overridden by flutter, so it can destroy the window. | |
void | removeGlobalEventFilter (EventFilterInterface *) |
Removes a global event filter. | |
virtual void | sendEvent (View *, Event *) const =0 |
Sends the specified event to the specified view. | |
virtual void | setCursorPos (Point)=0 |
Sets the mouse cursor position in screen coordinates. | |
int | startDragDistance () const |
Returns how many pixels the mouse must move for a drag to start This is usually 4 by default (QApplication::startDragDistance() for QtWidgets) You can override by calling Config::setStartDragDistance(), so you don't need to create a new Platform class. | |
virtual std::shared_ptr< Core::Window > | windowAt (Point globalPos) const =0 |
Returns the window at the specified global coordinates. | |
Static Public Member Functions | |
static Core::DockWidget * | dockWidgetForItem (QQuickItem *) |
static Platform * | instance () |
Static Public Member Functions inherited from KDDockWidgets::QtCommon::Platform_qt | |
static Platform_qt * | instance () |
Static Public Member Functions inherited from KDDockWidgets::Core::Platform | |
static std::vector< KDDockWidgets::FrontendType > | frontendTypes () |
list the list of frontend types supported by this build | |
static Platform * | instance () |
Returns the platform singleton. | |
Additional Inherited Members | |
Public Types inherited from KDDockWidgets::Core::Platform | |
enum class | DisplayType { Other = 0 , X11 = 1 , Wayland = 2 , QtOffscreen = 3 , QtEGLFS = 4 , Windows = 5 } |
Enum describing the graphics stack type. More... | |
Public Attributes inherited from KDDockWidgets::Core::Platform | |
Private *const | d |
Protected Member Functions inherited from KDDockWidgets::QtCommon::Platform_qt | |
int | screenNumberForQWindow (QWindow *) const |
Protected Member Functions inherited from KDDockWidgets::Core::Platform | |
Platform () | |
Platform (const Platform &)=delete | |
Platform & | operator= (const Platform &)=delete |
virtual int | startDragDistance_impl () const |
implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc.
Definition at line 38 of file qtquick/Platform.h.
Platform::Platform | ( | ) |
Definition at line 74 of file qtquick/Platform.cpp.
|
overridevirtual |
Reimplemented from KDDockWidgets::Core::Platform.
Definition at line 94 of file qtquick/Platform.cpp.
|
overridevirtual |
Creates and returns the default ViewFactory.
Implements KDDockWidgets::Core::Platform.
Definition at line 123 of file qtquick/Platform.cpp.
|
overridevirtual |
Create an empty view For Qt this would just returns a empty QWidget or QQuickItem other frontends can return something as basic.
Implements KDDockWidgets::Core::Platform.
Definition at line 194 of file qtquick/Platform.cpp.
References KDDockWidgets::QtQuick::asQQuickItem(), and KDDockWidgets::Core::None.
|
static |
Definition at line 239 of file qtquick/Platform.cpp.
Referenced by KDDockWidgets::MainWindowInstantiator::addDockWidget(), KDDockWidgets::MainWindowMDIInstantiator::addDockWidget(), KDDockWidgets::MainWindowInstantiator::addDockWidgetAsTab(), KDDockWidgets::DockWidgetInstantiator::addDockWidgetAsTab(), KDDockWidgets::DockWidgetInstantiator::addDockWidgetToContainingWindow(), KDDockWidgets::MainWindowInstantiator::layoutParentContainerEqually(), KDDockWidgets::MainWindowInstantiator::moveToSideBar(), KDDockWidgets::MainWindowInstantiator::moveToSideBar(), KDDockWidgets::MainWindowInstantiator::overlayOnSideBar(), KDDockWidgets::MainWindowInstantiator::restoreFromSideBar(), and KDDockWidgets::MainWindowInstantiator::toggleOverlayOnSideBar().
|
override |
Definition at line 216 of file qtquick/Platform.cpp.
References mouseAreaForPos().
|
static |
static
Definition at line 200 of file qtquick/Platform.cpp.
References KDDockWidgets::Core::Platform::instance().
Referenced by KDDockWidgets::QtQuick::View::createItem().
|
overridevirtual |
Returns the name of the platform, only "qtwidgets" and "qtquick".
Implements KDDockWidgets::Core::Platform.
Definition at line 99 of file qtquick/Platform.cpp.
QQmlEngine * Platform::qmlEngine | ( | ) | const |
Definition at line 159 of file qtquick/Platform.cpp.
Referenced by KDDockWidgets::QtQuick::View::createItem(), and setQmlEngine().
|
overridevirtual |
Returns the specified QObject casted to View Nullptr if it's not a view.
Implements KDDockWidgets::QtCommon::Platform_qt.
Definition at line 104 of file qtquick/Platform.cpp.
References QObject::property(), and QVariant::value().
|
overridevirtual |
Returns the screen index for the specified view or window. It's up to the platform to decide how screens are ordered, kddw won't care.
Implements KDDockWidgets::Core::Platform.
Definition at line 138 of file qtquick/Platform.cpp.
References KDDockWidgets::QtCommon::View_qt::asQObject(), and KDDockWidgets::QtCommon::Platform_qt::screenNumberForQWindow().
|
overridevirtual |
Returns the size of the screen where this view is in.
Implements KDDockWidgets::Core::Platform.
Definition at line 148 of file qtquick/Platform.cpp.
References KDDockWidgets::QtCommon::View_qt::asQObject().
void Platform::setQmlEngine | ( | QQmlEngine * | qmlEngine | ) |
Definition at line 167 of file qtquick/Platform.cpp.
References qmlEngine(), KDDockWidgets::Config::self(), KDDockWidgets::DockRegistry::self(), and viewFactory().
|
overridevirtual |
Releases the mouse grab, if any.
Implements KDDockWidgets::Core::Platform.
Definition at line 228 of file qtquick/Platform.cpp.
References KDDockWidgets::QtCommon::Platform_qt::windows().
|
overridevirtual |
Return whether we use the global event filter based mouse grabber.
Implements KDDockWidgets::Core::Platform.
Definition at line 208 of file qtquick/Platform.cpp.
ViewFactory * Platform::viewFactory | ( | ) | const |
Definition at line 189 of file qtquick/Platform.cpp.
References KDDockWidgets::Config::self(), and KDDockWidgets::Config::viewFactory().
Referenced by setQmlEngine().
|
override |
Definition at line 128 of file qtquick/Platform.cpp.
|
overridevirtual |
Implements KDDockWidgets::QtCommon::Platform_qt.
Definition at line 118 of file qtquick/Platform.cpp.