KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDDockWidgets::QtWidgets::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::QtWidgets::Platform:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::QtWidgets::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 hasActivePopup () const override
 Returns whether a popup is open Usually not needed to override. Investigate further in case side bars aren't auto hiding.
 
bool inDisallowedDragView (QPoint globalPos) const override
 
const char * name () const override
 Returns the name of the platform, only "qtwidgets" and "qtquick".
 
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.
 
int startDragDistance_impl () const override
 
void ungrabMouse () override
 Releases the mouse grab, if any.
 
bool usesFallbackMouseGrabber () const override
 Return whether we use the global event filter based mouse grabber.
 
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 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.
 

Protected Member Functions

void init ()
 
- 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
 

Protected Attributes

GlobalEventFilter *const m_globalEventFilter
 

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...
 
- 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.
 
- Public Attributes inherited from KDDockWidgets::Core::Platform
Private *const d
 

Detailed Description

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

Definition at line 28 of file qtwidgets/Platform.h.

Constructor & Destructor Documentation

◆ Platform()

Platform::Platform ( )

Definition at line 83 of file qtwidgets/Platform.cpp.

References init().

◆ ~Platform()

Platform::~Platform ( )
overridevirtual

Reimplemented from KDDockWidgets::Core::Platform.

Definition at line 107 of file qtwidgets/Platform.cpp.

References m_globalEventFilter.

Member Function Documentation

◆ createDefaultViewFactory()

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

Creates and returns the default ViewFactory.

Implements KDDockWidgets::Core::Platform.

Definition at line 133 of file qtwidgets/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 174 of file qtwidgets/Platform.cpp.

References KDDockWidgets::Core::None.

◆ hasActivePopup()

bool Platform::hasActivePopup ( ) const
overridevirtual

Returns whether a popup is open Usually not needed to override. Investigate further in case side bars aren't auto hiding.

Reimplemented from KDDockWidgets::Core::Platform.

Definition at line 117 of file qtwidgets/Platform.cpp.

◆ inDisallowedDragView()

bool Platform::inDisallowedDragView ( QPoint  globalPos) const
override

Definition at line 186 of file qtwidgets/Platform.cpp.

◆ init()

void Platform::init ( )
protected

◆ name()

const char * Platform::name ( ) const
overridevirtual

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

Implements KDDockWidgets::Core::Platform.

Definition at line 112 of file qtwidgets/Platform.cpp.

◆ 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 122 of file qtwidgets/Platform.cpp.

◆ 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 148 of file qtwidgets/Platform.cpp.

References 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 158 of file qtwidgets/Platform.cpp.

◆ startDragDistance_impl()

int Platform::startDragDistance_impl ( ) const
overridevirtual

Reimplemented from KDDockWidgets::Core::Platform.

Definition at line 169 of file qtwidgets/Platform.cpp.

References QApplication::startDragDistance.

◆ ungrabMouse()

void Platform::ungrabMouse ( )
overridevirtual

Releases the mouse grab, if any.

Implements KDDockWidgets::Core::Platform.

Definition at line 197 of file qtwidgets/Platform.cpp.

References QWidget::mouseGrabber().

◆ usesFallbackMouseGrabber()

bool Platform::usesFallbackMouseGrabber ( ) const
overridevirtual

Return whether we use the global event filter based mouse grabber.

Implements KDDockWidgets::Core::Platform.

Definition at line 180 of file qtwidgets/Platform.cpp.

◆ windowAt()

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

Definition at line 138 of file qtwidgets/Platform.cpp.

◆ windowFromQWindow()

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

Implements KDDockWidgets::QtCommon::Platform_qt.

Definition at line 127 of file qtwidgets/Platform.cpp.

Member Data Documentation

◆ m_globalEventFilter

GlobalEventFilter* const KDDockWidgets::QtWidgets::Platform::m_globalEventFilter
protected

Definition at line 65 of file qtwidgets/Platform.h.

Referenced by ~Platform().


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