Union::PlatformPlugin Class
class Union::PlatformPluginAbstract base class for plugins providing platform integration. More...
| Header: | #include <PlatformPlugin.h> |
| CMake: | find_package(Union REQUIRED)target_link_libraries(mytarget PRIVATE Union::Union) |
| Inherits: | Union::Plugin |
Public Functions
| virtual qreal | animationSpeedMultiplier() |
| virtual QString | defaultStyleName() = 0 |
| virtual QIcon | platformIcon(const QString &name, const QColor &color) |
| virtual bool | smoothScroll() |
| virtual std::filesystem::path | stylePackageInstallPath() |
| virtual QList<std::filesystem::path> | stylePackagePaths() |
Signals
| void | animationSpeedMultiplierChanged() |
| void | smoothScrollChanged() |
Detailed Description
Member Function Documentation
[virtual] qreal PlatformPlugin::animationSpeedMultiplier()
Returns a multiplier to globally change the animation speed.
This value should be used with animation speeds to ensure a platform's preferences with regards to animation speed is respected.
By default this will return 1.0.
[signal] void PlatformPlugin::animationSpeedMultiplierChanged()
Emitted whenever animationSpeedMultiplier changes.
[pure virtual] QString PlatformPlugin::defaultStyleName()
Returns the platform's default style name.
[virtual] QIcon PlatformPlugin::platformIcon(const QString &name, const QColor &color)
Returns an icon from the platform.
This should return an icon matching name using color to recolor the icon, if recoloring is supported. The default implementation will return the result of QIcon::fromTheme() and does not support recoloring.
[virtual] bool PlatformPlugin::smoothScroll()
Returns whether smooth scrolling is enabled on this platform.
Enables/disables tweened scrollbars and inertial scrolling. Defaults to true
[signal] void PlatformPlugin::smoothScrollChanged()
Emitted whenever smoothScroll changes.
[virtual] std::filesystem::path PlatformPlugin::stylePackageInstallPath()
Returns the path where new styles should be installed to.
By default this will use QStandardPaths and return the writable path for GenericDataLocation with "union/styles" appended. This can be overridden by a platform if styles should be written to a different location.
[virtual] QList<std::filesystem::path> PlatformPlugin::stylePackagePaths()
Returns the list of directories that should be searched for style packages.
By default this will use QStandardPaths and search for the directory "union/styles" in GenericDataLocation. However, this can be overridden should the platform have a location that is not handled by QStandardPaths.