Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowsTheme Class Reference

#include <qwindowstheme.h>

Inheritance diagram for QWindowsTheme:
Collaboration diagram for QWindowsTheme:

Public Member Functions

 QWindowsTheme ()
 ~QWindowsTheme () override
bool usePlatformNativeDialog (DialogType type) const override
QPlatformDialogHelpercreatePlatformDialogHelper (DialogType type) const override
QVariant themeHint (ThemeHint) const override
Qt::ColorScheme colorScheme () const override
void requestColorScheme (Qt::ColorScheme scheme) override
Qt::ContrastPreference contrastPreference () const override
const QPalettepalette (Palette type=SystemPalette) const override
 Return a color palette for type type.
const QFontfont (Font type=SystemFont) const override
QPixmap standardPixmap (StandardPixmap sp, const QSizeF &size) const override
 Return a pixmap for standardPixmap, at the given size.
QIcon fileIcon (const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions={}) const override
 Return an icon for fileInfo, observing iconOptions.
QIconEnginecreateIconEngine (const QString &iconName) const override
 Factory function for the QIconEngine used by QIcon::fromTheme().
void displayChanged ()
QList< QSizeavailableFileIconSizes () const
QPlatformMenuItemcreatePlatformMenuItem () const override
QPlatformMenucreatePlatformMenu () const override
QPlatformMenuBarcreatePlatformMenuBar () const override
void showPlatformMenuBar () override
void refreshFonts ()
void refresh ()
Public Member Functions inherited from QPlatformTheme
 QPlatformTheme ()
virtual ~QPlatformTheme ()
virtual QPlatformSystemTrayIconcreatePlatformSystemTrayIcon () const
 Factory function for QSystemTrayIcon.
virtual QString standardButtonText (int button) const
 Returns the text of a standard button.
QString name () const

Static Public Member Functions

static QWindowsThemeinstance ()
static void handleThemeChange ()
static bool useNativeMenus ()
static QPalette systemPalette (Qt::ColorScheme)
static bool queryHighContrast ()
Static Public Member Functions inherited from QPlatformTheme
static QVariant defaultThemeHint (ThemeHint hint)
static QString defaultStandardButtonText (int button)
static QString removeMnemonics (const QString &original)

Static Public Attributes

static const char * name = "windows"

Friends

class QWindowsContext

Additional Inherited Members

Public Types inherited from QPlatformTheme
enum  ThemeHint {
  CursorFlashTime , KeyboardInputInterval , MouseDoubleClickInterval , StartDragDistance ,
  StartDragTime , KeyboardAutoRepeatRate , PasswordMaskDelay , StartDragVelocity ,
  TextCursorWidth , DropShadow , MaximumScrollBarDragDistance , ToolButtonStyle ,
  ToolBarIconSize , ItemViewActivateItemOnSingleClick , SystemIconThemeName , SystemIconFallbackThemeName ,
  IconThemeSearchPaths , StyleNames , WindowAutoPlacement , DialogButtonBoxLayout ,
  DialogButtonBoxButtonsHaveIcons , UseFullScreenForPopupMenu , KeyboardScheme , UiEffects ,
  SpellCheckUnderlineStyle , TabFocusBehavior , IconPixmapSizes , PasswordMaskCharacter ,
  DialogSnapToDefaultButton , ContextMenuOnMouseRelease , MousePressAndHoldInterval , MouseDoubleClickDistance ,
  WheelScrollLines , TouchDoubleTapDistance , ShowShortcutsInContextMenus , IconFallbackSearchPaths ,
  MouseQuickSelectionThreshold , InteractiveResizeAcrossScreens , ShowDirectoriesFirst , PreselectFirstFileInDirectory ,
  ButtonPressKeys , SetFocusOnTouchRelease , FlickStartDistance , FlickMaximumVelocity ,
  FlickDeceleration , MenuBarFocusOnAltPressRelease , MouseCursorTheme , MouseCursorSize ,
  UnderlineShortcut , ShowIconsInMenus , PreferFileIconFromTheme , MenuSelectionWraps ,
  ScrollSingleStepDistance
}
 This enum describes the available theme hints. More...
enum  DialogType { FileDialog , ColorDialog , FontDialog , MessageDialog }
enum  Palette {
  SystemPalette , ToolTipPalette , ToolButtonPalette , ButtonPalette ,
  CheckBoxPalette , RadioButtonPalette , HeaderPalette , ComboBoxPalette ,
  ItemViewPalette , MessageBoxLabelPelette , MessageBoxLabelPalette = MessageBoxLabelPelette , TabBarPalette ,
  LabelPalette , GroupBoxPalette , MenuPalette , MenuBarPalette ,
  TextEditPalette , TextLineEditPalette , NPalettes
}
enum  Font {
  SystemFont , MenuFont , MenuBarFont , MenuItemFont ,
  MessageBoxFont , LabelFont , TipLabelFont , StatusBarFont ,
  TitleBarFont , MdiSubWindowTitleFont , DockWidgetTitleFont , PushButtonFont ,
  CheckBoxFont , RadioButtonFont , ToolButtonFont , ItemViewFont ,
  ListViewFont , HeaderViewFont , ListBoxFont , ComboMenuItemFont ,
  ComboLineEditFont , SmallFont , MiniFont , FixedFont ,
  GroupBoxTitleFont , TabButtonFont , EditorFont , NFonts
}
enum  StandardPixmap {
  TitleBarMenuButton , TitleBarMinButton , TitleBarMaxButton , TitleBarCloseButton ,
  TitleBarNormalButton , TitleBarShadeButton , TitleBarUnshadeButton , TitleBarContextHelpButton ,
  DockWidgetCloseButton , MessageBoxInformation , MessageBoxWarning , MessageBoxCritical ,
  MessageBoxQuestion , DesktopIcon , TrashIcon , ComputerIcon ,
  DriveFDIcon , DriveHDIcon , DriveCDIcon , DriveDVDIcon ,
  DriveNetIcon , DirOpenIcon , DirClosedIcon , DirLinkIcon ,
  DirLinkOpenIcon , FileIcon , FileLinkIcon , ToolBarHorizontalExtensionButton ,
  ToolBarVerticalExtensionButton , FileDialogStart , FileDialogEnd , FileDialogToParent ,
  FileDialogNewFolder , FileDialogDetailedView , FileDialogInfoView , FileDialogContentsView ,
  FileDialogListView , FileDialogBack , DirIcon , DialogOkButton ,
  DialogCancelButton , DialogHelpButton , DialogOpenButton , DialogSaveButton ,
  DialogCloseButton , DialogApplyButton , DialogResetButton , DialogDiscardButton ,
  DialogYesButton , DialogNoButton , ArrowUp , ArrowDown ,
  ArrowLeft , ArrowRight , ArrowBack , ArrowForward ,
  DirHomeIcon , CommandLink , VistaShield , BrowserReload ,
  BrowserStop , MediaPlay , MediaStop , MediaPause ,
  MediaSkipForward , MediaSkipBackward , MediaSeekForward , MediaSeekBackward ,
  MediaVolume , MediaVolumeMuted , LineEditClearButton , DialogYesToAllButton ,
  DialogNoToAllButton , DialogSaveAllButton , DialogAbortButton , DialogRetryButton ,
  DialogIgnoreButton , RestoreDefaultsButton , TabCloseButton , NStandardPixmap ,
  CustomBase = 0xf0000000
}
enum  KeyboardSchemes {
  WindowsKeyboardScheme , MacKeyboardScheme , X11KeyboardScheme , KdeKeyboardScheme ,
  GnomeKeyboardScheme , CdeKeyboardScheme
}
enum  UiEffect {
  GeneralUiEffect = 0x1 , AnimateMenuUiEffect = 0x2 , FadeMenuUiEffect = 0x4 , AnimateComboUiEffect = 0x8 ,
  AnimateTooltipUiEffect = 0x10 , FadeTooltipUiEffect = 0x20 , AnimateToolBoxUiEffect = 0x40 , HoverEffect = 0x80
}
enum  IconOption { DontUseCustomDirectoryIcons = 0x01 }
Protected Member Functions inherited from QPlatformTheme
 QPlatformTheme (QPlatformThemePrivate *priv)
Protected Attributes inherited from QPlatformTheme
QScopedPointer< QPlatformThemePrivated_ptr

Detailed Description

Definition at line 18 of file qwindowstheme.h.

Constructor & Destructor Documentation

◆ QWindowsTheme()

QWindowsTheme::QWindowsTheme ( )

Definition at line 540 of file qwindowstheme.cpp.

References refresh().

Here is the call graph for this function:

◆ ~QWindowsTheme()

QWindowsTheme::~QWindowsTheme ( )
override

Definition at line 561 of file qwindowstheme.cpp.

Member Function Documentation

◆ availableFileIconSizes()

QList< QSize > QWindowsTheme::availableFileIconSizes ( ) const
inline

Definition at line 52 of file qwindowstheme.h.

◆ colorScheme()

Qt::ColorScheme QWindowsTheme::colorScheme ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 649 of file qwindowstheme.cpp.

◆ contrastPreference()

Qt::ContrastPreference QWindowsTheme::contrastPreference ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 674 of file qwindowstheme.cpp.

◆ createIconEngine()

QIconEngine * QWindowsTheme::createIconEngine ( const QString & iconName) const
overridevirtual

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

Reimplemented from QPlatformTheme.

Definition at line 1228 of file qwindowstheme.cpp.

◆ createPlatformDialogHelper()

QPlatformDialogHelper * QWindowsTheme::createPlatformDialogHelper ( DialogType type) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 859 of file qwindowstheme.cpp.

◆ createPlatformMenu()

QPlatformMenu * QWindowsTheme::createPlatformMenu ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1284 of file qwindowstheme.cpp.

References useNativeMenus().

Here is the call graph for this function:

◆ createPlatformMenuBar()

QPlatformMenuBar * QWindowsTheme::createPlatformMenuBar ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1294 of file qwindowstheme.cpp.

References useNativeMenus().

Here is the call graph for this function:

◆ createPlatformMenuItem()

QPlatformMenuItem * QWindowsTheme::createPlatformMenuItem ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1278 of file qwindowstheme.cpp.

References useNativeMenus().

Here is the call graph for this function:

◆ displayChanged()

void QWindowsTheme::displayChanged ( )
inline

Definition at line 50 of file qwindowstheme.h.

◆ fileIcon()

QIcon QWindowsTheme::fileIcon ( const QFileInfo & fileInfo,
QPlatformTheme::IconOptions iconOptions = {} ) const
overridevirtual

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

Reimplemented from QPlatformTheme.

Definition at line 1223 of file qwindowstheme.cpp.

◆ font()

const QFont * QWindowsTheme::font ( Font type = SystemFont) const
inlineoverridevirtual

Reimplemented from QPlatformTheme.

Definition at line 42 of file qwindowstheme.h.

◆ handleThemeChange()

void QWindowsTheme::handleThemeChange ( )
static

Definition at line 680 of file qwindowstheme.cpp.

References QWindowsIntegration::instance(), instance(), refresh(), and QWindowsIntegration::updateApplicationBadge().

Referenced by requestColorScheme().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

QWindowsTheme * QWindowsTheme::instance ( )
inlinestatic

Definition at line 25 of file qwindowstheme.h.

Referenced by QWindowsContext::~QWindowsContext(), QWindowsFileIconEngine::availableSizes(), QWindowsScreenManager::handleScreenChanges(), and handleThemeChange().

Here is the caller graph for this function:

◆ palette()

const QPalette * QWindowsTheme::palette ( Palette type = SystemPalette) const
inlineoverridevirtual

Return a color palette for type type.

When relying on system color palette keep in mind that it is lazily initialized and cached. If it needs to be updated (i.e. due to ColorScheme changes), it's up to the caller to take care of it. See requestColorScheme.

Reimplemented from QPlatformTheme.

Definition at line 40 of file qwindowstheme.h.

◆ queryHighContrast()

bool QWindowsTheme::queryHighContrast ( )
static

Definition at line 1269 of file qwindowstheme.cpp.

◆ refresh()

void QWindowsTheme::refresh ( )

Definition at line 783 of file qwindowstheme.cpp.

References refreshFonts().

Referenced by QWindowsTheme(), and handleThemeChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refreshFonts()

void QWindowsTheme::refreshFonts ( )

Definition at line 811 of file qwindowstheme.cpp.

Referenced by QWindowsScreenManager::handleScreenChanges(), and refresh().

Here is the caller graph for this function:

◆ requestColorScheme()

void QWindowsTheme::requestColorScheme ( Qt::ColorScheme scheme)
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 668 of file qwindowstheme.cpp.

References handleThemeChange().

Here is the call graph for this function:

◆ showPlatformMenuBar()

void QWindowsTheme::showPlatformMenuBar ( )
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1300 of file qwindowstheme.cpp.

◆ standardPixmap()

QPixmap QWindowsTheme::standardPixmap ( StandardPixmap standardPixmap,
const QSizeF & size ) const
overridevirtual

Return a pixmap for standardPixmap, at the given size.

The implementation should not take system DPR into account, and always return a pixmap with a DPR of 1. It's up to the consumer to account for DPR and request a pixmap of the right size.

Reimplemented from QPlatformTheme.

Definition at line 905 of file qwindowstheme.cpp.

◆ systemPalette()

QPalette QWindowsTheme::systemPalette ( Qt::ColorScheme colorScheme)
static

Definition at line 730 of file qwindowstheme.cpp.

◆ themeHint()

QVariant QWindowsTheme::themeHint ( ThemeHint hint) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 605 of file qwindowstheme.cpp.

References QWindowsContext::defaultDPI(), QWindowsContext::instance(), and uiEffects().

Here is the call graph for this function:

◆ useNativeMenus()

bool QWindowsTheme::useNativeMenus ( )
static

Definition at line 1251 of file qwindowstheme.cpp.

References doUseNativeMenus().

Referenced by createPlatformMenu(), createPlatformMenuBar(), and createPlatformMenuItem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ usePlatformNativeDialog()

bool QWindowsTheme::usePlatformNativeDialog ( DialogType type) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 854 of file qwindowstheme.cpp.

◆ QWindowsContext

friend class QWindowsContext
friend

Definition at line 84 of file qwindowstheme.h.

Member Data Documentation

◆ name

const char * QWindowsTheme::name = "windows"
static

The documentation for this class was generated from the following files: