QPlatformTheme Class
The QPlatformTheme class allows customizing the UI based on themes. More...
Header: | #include <QPlatformTheme> |
Inherited By: | QGnomeTheme and QKdeTheme |
Public Types
flags | IconOptions |
enum | ThemeHint { CursorFlashTime, KeyboardInputInterval, MouseDoubleClickInterval, MouseDoubleClickDistance, MousePressAndHoldInterval, …, MouseCursorSize } |
Public Functions
virtual QIconEngine * | createIconEngine(const QString &iconName) const |
virtual QPlatformSystemTrayIcon * | createPlatformSystemTrayIcon() const |
virtual QIcon | fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = ...) const |
virtual QList<QKeySequence> | keyBindings(QKeySequence::StandardKey key) const |
virtual QKeySequence | standardButtonShortcut(int button) const |
virtual QString | standardButtonText(int button) const |
Detailed Description
\since
5.0 \internal
\preliminary
\ingroup
qpa
See the init_platform function in qguiapplication.cpp for the complete platform initialization process.
Member Type Documentation
enum QPlatformTheme::ThemeHint
This enum describes the available theme hints.
Constant | Value | Description |
---|---|---|
QPlatformTheme::CursorFlashTime | 0 | (int) Cursor flash time in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::KeyboardInputInterval | 1 | (int) Keyboard input interval in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::MouseDoubleClickInterval | 2 | (int) Mouse double click interval in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::MouseDoubleClickDistance | 31 | (int) The maximum distance in logical pixels which the mouse can travel between clicks in order for the click sequence to be handled as a double click. The default value is 5 logical pixels. |
QPlatformTheme::MousePressAndHoldInterval | 30 | (int) Mouse press and hold interval in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::StartDragDistance | 3 | (int) Start drag distance, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::StartDragTime | 4 | (int) Start drag time in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::WheelScrollLines | 32 | (int) The number of lines to scroll a widget, when the mouse wheel is rotated. The default value is 3. |
QPlatformTheme::KeyboardAutoRepeatRate | 5 | (int) Keyboard auto repeat rate, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::PasswordMaskDelay | 6 | (int) Pass word mask delay in ms, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::StartDragVelocity | 7 | (int) Velocity of a drag, overriding QPlatformIntegration::styleHint. |
QPlatformTheme::TextCursorWidth | 8 | (int) Determines the width of the text cursor. |
QPlatformTheme::DropShadow | 9 | (bool) Determines whether the drop shadow effect for tooltips or whatsthis is enabled. |
QPlatformTheme::MaximumScrollBarDragDistance | 10 | (int) Determines the value returned by QStyle::pixelMetric(PM_MaximumDragDistance) |
QPlatformTheme::ToolButtonStyle | 11 | (int) A value representing a Qt::ToolButtonStyle. |
QPlatformTheme::ToolBarIconSize | 12 | Icon size for tool bars. |
QPlatformTheme::SystemIconThemeName | 14 | (QString) Name of the icon theme. |
QPlatformTheme::SystemIconFallbackThemeName | 15 | (QString) Name of the fallback icon theme. |
QPlatformTheme::IconThemeSearchPaths | 16 | (QStringList) Search paths for icons. |
QPlatformTheme::ItemViewActivateItemOnSingleClick | 13 | (bool) Activate items by single click. |
QPlatformTheme::StyleNames | 17 | (QStringList) A list of preferred style names. |
QPlatformTheme::WindowAutoPlacement | 18 | (bool) A boolean value indicating whether Windows (particularly dialogs) are placed by the system (see _NET_WM_FULL_PLACEMENT in X11). |
QPlatformTheme::DialogButtonBoxLayout | 19 | (int) An integer representing a QDialogButtonBox::ButtonLayout value. |
QPlatformTheme::DialogButtonBoxButtonsHaveIcons | 20 | (bool) A boolean value indicating whether the buttons of a QDialogButtonBox should have icons. |
QPlatformTheme::UseFullScreenForPopupMenu | 21 | (bool) Pop menus can cover the full screen including task bar. |
QPlatformTheme::KeyboardScheme | 22 | (int) An integer value (enum KeyboardSchemes) specifying the keyboard scheme. |
QPlatformTheme::UiEffects | 23 | (int) A flag value consisting of UiEffect values specifying the enabled UI animations. |
QPlatformTheme::SpellCheckUnderlineStyle | 24 | (int) A QTextCharFormat::UnderlineStyle specifying the underline style used misspelled words when spell checking. |
QPlatformTheme::TabFocusBehavior | 25 | (int) A Qt::TabFocusBehavior specifying the behavior of focus change when tab key was pressed. This enum value was added in Qt 5.5. |
QPlatformTheme::DialogSnapToDefaultButton | 28 | (bool) Whether the mouse should snap to the default button when a dialog becomes visible. |
QPlatformTheme::ContextMenuOnMouseRelease | 29 | (bool) Whether the context menu should be shown on mouse release. |
QPlatformTheme::TouchDoubleTapDistance | 33 | (int) The maximum distance in logical pixels which a touchpoint can travel between taps in order for the tap sequence to be handled as a double tap. The default value is double the MouseDoubleClickDistance, or 10 logical pixels if that is not specified. |
QPlatformTheme::ShowShortcutsInContextMenus | 34 | (bool) Whether to display shortcut key sequences in context menus. |
QPlatformTheme::InteractiveResizeAcrossScreens | 37 | (bool) Whether using the whole virtual geometry of all the screens as basis for the resize. This enum value has been added in Qt 6.2. |
QPlatformTheme::ShowDirectoriesFirst | 38 | (bool) Whether directories should be shown first (before files) in file dialogs. This enum value was added in Qt 6.3. |
QPlatformTheme::PreselectFirstFileInDirectory | 39 | (bool) Whether the first file in a directory should be automatically selected when a file dialog opens. This enum value was added in Qt 6.3. |
QPlatformTheme::ButtonPressKeys | 40 | (QList<Qt::Key>) A list of keys that can be used to press buttons via keyboard input. |
QPlatformTheme::SetFocusOnTouchRelease | 41 | (bool) Whether focus objects (line edits etc) should receive input focus after a touch/mouse release. This enum value has been added in Qt 6.5. |
QPlatformTheme::MouseCursorTheme | 46 | (QString) Name of the mouse cursor theme. This enum value has been added in Qt 6.5. |
QPlatformTheme::MouseCursorSize | 47 | (QSize) Size of the mouse cursor. This enum value has been added in Qt 6.5. |
See also QApplication::wheelScrollLines(), themeHint(), and QStyle::pixelMetric().
Member Function Documentation
[virtual]
QIconEngine *QPlatformTheme::createIconEngine(const QString &iconName) const
Factory function for the QIconEngine used by QIcon::fromTheme(). By default this function returns a QIconLoaderEngine, but subclasses can reimplement it to provide their own.
It is especially useful to benefit from some platform specific facilities or optimizations like an inter-process cache in systems mostly built with Qt.
\since
5.1
[virtual]
QPlatformSystemTrayIcon *QPlatformTheme::createPlatformSystemTrayIcon() const
Factory function for QSystemTrayIcon. This function will return 0 if the platform integration does not support creating any system tray icon.
[virtual]
QIcon QPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions = ...) const
Return an icon for fileInfo, observing iconOptions.
This function is queried by QFileIconProvider and similar classes to obtain an icon for a file. If it does not return a non-null icon, fileIconPixmap() is queried for a specific size.
\since
5.8
[virtual]
QList<QKeySequence> QPlatformTheme::keyBindings(QKeySequence::StandardKey key) const
Returns the key sequence that should be used for a standard action.
\since
5.2
[virtual]
QKeySequence QPlatformTheme::standardButtonShortcut(int button) const
Returns the mnemonic that should be used for a standard button.
\since
5.9
See also QPlatformDialogHelper::StandardButton.
[virtual]
QString QPlatformTheme::standardButtonText(int button) const
Returns the text of a standard button.
\since
5.3
See also QPlatformDialogHelper::StandardButton.