KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
KDDockWidgets::QtQuick::Platform Class Reference

implements functions specific to a particular platform A platform can be for example qtwidgets, qtquick, etc. More...

#include <Platform.h>

Inheritance diagram for KDDockWidgets::QtQuick::Platform:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::QtQuick::Platform:
Collaboration graph
[legend]

Public Member Functions

 Platform ()
 
 ~Platform () override
 
Core::ViewFactorycreateDefaultViewFactory () override
 Creates and returns the default ViewFactory.
 
Core::ViewcreateView (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::ViewqobjectAsView (QObject *) const override
 Returns the specified QObject casted to View Nullptr if it's not a view.
 
int screenNumberForView (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::ViewFactoryviewFactory () 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::ViewfocusedView () 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 screenNumberForWindow (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::DockWidgetdockWidgetForItem (QQuickItem *)
 
static Platforminstance ()
 
- Static Public Member Functions inherited from KDDockWidgets::QtCommon::Platform_qt
static Platform_qtinstance ()
 
- Static Public Member Functions inherited from KDDockWidgets::Core::Platform
static std::vector< KDDockWidgets::FrontendTypefrontendTypes ()
 list the list of frontend types supported by this build
 
static bool hasInstance ()
 Returns whether a Platform instance exists.
 
static Platforminstance ()
 Returns the platform singleton.
 
static bool isInitialized ()
 Returns whether the Platform was already initialized.
 

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
 
Platformoperator= (const Platform &)=delete
 
virtual int startDragDistance_impl () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Platform()

Platform::Platform ( )

Definition at line 74 of file qtquick/Platform.cpp.

◆ ~Platform()

Platform::~Platform ( )
overridevirtual

Reimplemented from KDDockWidgets::Core::Platform.

Definition at line 94 of file qtquick/Platform.cpp.

Member Function Documentation

◆ createDefaultViewFactory()

Core::ViewFactory * Platform::createDefaultViewFactory ( )
overridevirtual

Creates and returns the default ViewFactory.

Implements KDDockWidgets::Core::Platform.

Definition at line 123 of file qtquick/Platform.cpp.

◆ createView()

Core::View * Platform::createView ( Core::Controller ,
Core::View parent = nullptr 
) const
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.

◆ dockWidgetForItem()

Core::DockWidget * Platform::dockWidgetForItem ( QQuickItem *  item)
static

◆ inDisallowedDragView()

bool Platform::inDisallowedDragView ( QPoint  globalPos) const
override

Definition at line 216 of file qtquick/Platform.cpp.

References mouseAreaForPos().

◆ instance()

Platform * Platform::instance ( )
static

◆ name()

const char * Platform::name ( ) const
overridevirtual

Returns the name of the platform, only "qtwidgets" and "qtquick".

Implements KDDockWidgets::Core::Platform.

Definition at line 99 of file qtquick/Platform.cpp.

◆ qmlEngine()

QQmlEngine * Platform::qmlEngine ( ) const

Definition at line 159 of file qtquick/Platform.cpp.

Referenced by KDDockWidgets::QtQuick::View::createItem(), and setQmlEngine().

◆ qobjectAsView()

std::shared_ptr< Core::View > Platform::qobjectAsView ( QObject ) const
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().

◆ screenNumberForView()

int Platform::screenNumberForView ( Core::View ) const
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().

◆ screenSizeFor()

QSize Platform::screenSizeFor ( Core::View ) const
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().

◆ setQmlEngine()

void Platform::setQmlEngine ( QQmlEngine *  qmlEngine)

◆ ungrabMouse()

void Platform::ungrabMouse ( )
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().

◆ usesFallbackMouseGrabber()

bool Platform::usesFallbackMouseGrabber ( ) const
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()

ViewFactory * Platform::viewFactory ( ) const

◆ windowAt()

Core::Window::Ptr Platform::windowAt ( QPoint  globalPos) const
override

Definition at line 128 of file qtquick/Platform.cpp.

◆ windowFromQWindow()

std::shared_ptr< Core::Window > Platform::windowFromQWindow ( QWindow qwindow) const
overridevirtual

Implements KDDockWidgets::QtCommon::Platform_qt.

Definition at line 118 of file qtquick/Platform.cpp.


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