Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
 
const QPalettepalette (Palette type=SystemPalette) const override
 
const QFontfont (Font type=SystemFont) const override
 
QPixmap standardPixmap (StandardPixmap sp, const QSizeF &size) const override
 
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 windowsThemeChanged (QWindow *window)
 
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
 Q_ENUM (DialogType)
 
 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 handleSettingsChanged ()
 
static bool useNativeMenus ()
 
static QPalette systemPalette (Qt::ColorScheme)
 
- 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"
 

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
}
 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 452 of file qwindowstheme.cpp.

References QPlatformTheme::NFonts, QPlatformTheme::NPalettes, and refresh().

+ Here is the call graph for this function:

◆ ~QWindowsTheme()

QWindowsTheme::~QWindowsTheme ( )
override

Definition at line 462 of file qwindowstheme.cpp.

Member Function Documentation

◆ availableFileIconSizes()

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

Definition at line 51 of file qwindowstheme.h.

◆ colorScheme()

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

Reimplemented from QPlatformTheme.

Definition at line 543 of file qwindowstheme.cpp.

Referenced by systemPalette().

+ Here is the caller graph for this function:

◆ 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 1089 of file qwindowstheme.cpp.

◆ createPlatformDialogHelper()

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

Reimplemented from QPlatformTheme.

Definition at line 722 of file qwindowstheme.cpp.

References QWindowsDialogs::createHelper().

+ Here is the call graph for this function:

◆ createPlatformMenu()

QPlatformMenu * QWindowsTheme::createPlatformMenu ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1143 of file qwindowstheme.cpp.

References qCDebug, and useNativeMenus().

+ Here is the call graph for this function:

◆ createPlatformMenuBar()

QPlatformMenuBar * QWindowsTheme::createPlatformMenuBar ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1153 of file qwindowstheme.cpp.

References qCDebug, and useNativeMenus().

+ Here is the call graph for this function:

◆ createPlatformMenuItem()

QPlatformMenuItem * QWindowsTheme::createPlatformMenuItem ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1137 of file qwindowstheme.cpp.

References qCDebug, and useNativeMenus().

+ Here is the call graph for this function:

◆ displayChanged()

void QWindowsTheme::displayChanged ( )
inline

Definition at line 49 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 1084 of file qwindowstheme.cpp.

◆ font()

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

Reimplemented from QPlatformTheme.

Definition at line 40 of file qwindowstheme.h.

◆ handleSettingsChanged()

void QWindowsTheme::handleSettingsChanged ( )
static

Definition at line 555 of file qwindowstheme.cpp.

References Qt::Dark, QWindowsContext::instance(), QWindowsIntegration::instance(), and instance().

Referenced by QWindowsContext::windowsProc().

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

◆ instance()

static QWindowsTheme * QWindowsTheme::instance ( )
inlinestatic

Definition at line 25 of file qwindowstheme.h.

Referenced by QWindowsFileIconEngine::availableSizes(), WindowCreationData::create(), QWindowsScreenManager::handleScreenChanges(), handleSettingsChanged(), qDisplayChangeObserverWndProc(), QWindowsIntegration::setApplicationBadge(), QWindowsWindow::windowEvent(), and QWindowsContext::windowsProc().

+ Here is the caller graph for this function:

◆ palette()

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

Reimplemented from QPlatformTheme.

Definition at line 38 of file qwindowstheme.h.

◆ refresh()

void QWindowsTheme::refresh ( )

Definition at line 646 of file qwindowstheme.cpp.

References refreshFonts().

Referenced by QWindowsTheme(), and windowsThemeChanged().

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

◆ refreshFonts()

void QWindowsTheme::refreshFonts ( )

Definition at line 674 of file qwindowstheme.cpp.

References QGuiApplication::desktopSettingsAware(), QPlatformTheme::DockWidgetTitleFont, QPlatformTheme::FixedFont, QPlatformTheme::ItemViewFont, QWindowsFontDatabaseBase::LOGFONT_to_QFont(), QPlatformTheme::MdiSubWindowTitleFont, QPlatformTheme::MenuBarFont, QPlatformTheme::MenuFont, QPlatformTheme::MessageBoxFont, QWindowsContext::nonClientMetrics(), qCDebug, QStringLiteral, QFont::setStyleHint(), QPlatformTheme::StatusBarFont, QWindowsFontDatabaseBase::systemDefaultFont(), QPlatformTheme::SystemFont, QPlatformTheme::TipLabelFont, and QFont::TypeWriter.

Referenced by refresh().

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

◆ showPlatformMenuBar()

void QWindowsTheme::showPlatformMenuBar ( )
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 1159 of file qwindowstheme.cpp.

References qCDebug.

◆ standardPixmap()

◆ systemPalette()

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

Definition at line 599 of file qwindowstheme.cpp.

References QPalette::Accent, QPalette::Base, QPalette::ButtonText, colorScheme(), Qt::Dark, QPalette::Disabled, disabled, QPalette::Highlight, QPalette::HighlightedText, QPalette::Inactive, Qt::Light, mixColors(), Q_FALLTHROUGH, QPalette::Text, Qt::Unknown, QPalette::Window, and QPalette::WindowText.

Referenced by QWindowsApplication::populateLightSystemPalette().

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

◆ themeHint()

◆ useNativeMenus()

bool QWindowsTheme::useNativeMenus ( )
static

Definition at line 1112 of file qwindowstheme.cpp.

References doUseNativeMenus().

Referenced by QWindowsSystemTrayIcon::createMenu(), 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 717 of file qwindowstheme.cpp.

References QWindowsDialogs::useHelper().

+ Here is the call graph for this function:

◆ windowsThemeChanged()

void QWindowsTheme::windowsThemeChanged ( QWindow * window)

Definition at line 734 of file qwindowstheme.cpp.

References QWindowSystemInterface::handleThemeChange(), refresh(), and window().

+ Here is the call graph for this function:

Member Data Documentation

◆ name

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

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