Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QCocoaTheme Class Reference

#include <qcocoatheme.h>

+ Inheritance diagram for QCocoaTheme:
+ Collaboration diagram for QCocoaTheme:

Public Member Functions

 QCocoaTheme ()
 
 ~QCocoaTheme ()
 
void reset ()
 
QPlatformMenuItemcreatePlatformMenuItem () const override
 
QPlatformMenucreatePlatformMenu () const override
 
QPlatformMenuBarcreatePlatformMenuBar () const override
 
QPlatformSystemTrayIconcreatePlatformSystemTrayIcon () const override
 Factory function for QSystemTrayIcon.
 
bool usePlatformNativeDialog (DialogType dialogType) const override
 
QPlatformDialogHelpercreatePlatformDialogHelper (DialogType dialogType) 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 options={}) const override
 Return an icon for fileInfo, observing iconOptions.
 
QVariant themeHint (ThemeHint hint) const override
 
Qt::ColorScheme colorScheme () const override
 
QString standardButtonText (int button) const override
 Returns the text of a standard button.
 
QKeySequence standardButtonShortcut (int button) const override
 
void handleSystemThemeChange ()
 
QList< QKeySequencekeyBindings (QKeySequence::StandardKey key) const override
 
- Public Member Functions inherited from QPlatformTheme
 Q_ENUM (DialogType)
 
 QPlatformTheme ()
 
virtual ~QPlatformTheme ()
 
virtual QPlatformMenuItemcreatePlatformMenuItem () const
 
virtual QPlatformMenucreatePlatformMenu () const
 
virtual QPlatformMenuBarcreatePlatformMenuBar () const
 
virtual void showPlatformMenuBar ()
 
virtual bool usePlatformNativeDialog (DialogType type) const
 
virtual QPlatformDialogHelpercreatePlatformDialogHelper (DialogType type) const
 
virtual QPlatformSystemTrayIconcreatePlatformSystemTrayIcon () const
 Factory function for QSystemTrayIcon.
 
virtual Qt::ColorScheme colorScheme () const
 
virtual const QPalettepalette (Palette type=SystemPalette) const
 
virtual const QFontfont (Font type=SystemFont) const
 
virtual QVariant themeHint (ThemeHint hint) const
 
virtual QPixmap standardPixmap (StandardPixmap sp, const QSizeF &size) const
 
virtual QIcon fileIcon (const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions={ }) const
 Return an icon for fileInfo, observing iconOptions.
 
virtual QIconEnginecreateIconEngine (const QString &iconName) const
 Factory function for the QIconEngine used by QIcon::fromTheme().
 
virtual QString standardButtonText (int button) const
 Returns the text of a standard button.
 
QString name () const
 

Static Public Attributes

static const char * name = "cocoa"
 

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 }
 
- Static Public Member Functions inherited from QPlatformTheme
static QVariant defaultThemeHint (ThemeHint hint)
 
static QString defaultStandardButtonText (int button)
 
static QString removeMnemonics (const QString &original)
 
- Protected Member Functions inherited from QPlatformTheme
 QPlatformTheme (QPlatformThemePrivate *priv)
 
- Protected Attributes inherited from QPlatformTheme
QScopedPointer< QPlatformThemePrivated_ptr
 

Detailed Description

Definition at line 15 of file qcocoatheme.h.

Constructor & Destructor Documentation

◆ QCocoaTheme()

QCocoaTheme::QCocoaTheme ( )

Definition at line 213 of file qcocoatheme.mm.

References QOperatingSystemVersion::current(), handleSystemThemeChange(), and QOperatingSystemVersion::MacOSMojave.

+ Here is the call graph for this function:

◆ ~QCocoaTheme()

QCocoaTheme::~QCocoaTheme ( )

Definition at line 229 of file qcocoatheme.mm.

References reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ colorScheme()

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

Reimplemented from QPlatformTheme.

Definition at line 476 of file qcocoatheme.mm.

References Qt::Dark, and Qt::Light.

◆ createPlatformDialogHelper()

QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper ( DialogType  dialogType) const
overridevirtual

◆ createPlatformMenu()

QPlatformMenu * QCocoaTheme::createPlatformMenu ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 499 of file qcocoatheme.mm.

◆ createPlatformMenuBar()

QPlatformMenuBar * QCocoaTheme::createPlatformMenuBar ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 504 of file qcocoatheme.mm.

References QObject::connect(), QGuiApplicationPrivate::platformIntegration(), qGuiApp, SIGNAL, and SLOT.

+ Here is the call graph for this function:

◆ createPlatformMenuItem()

QPlatformMenuItem * QCocoaTheme::createPlatformMenuItem ( ) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 494 of file qcocoatheme.mm.

◆ createPlatformSystemTrayIcon()

QPlatformSystemTrayIcon * QCocoaTheme::createPlatformSystemTrayIcon ( ) const
overridevirtual

Factory function for QSystemTrayIcon.

This function will return 0 if the platform integration does not support creating any system tray icon.

Reimplemented from QPlatformTheme.

Definition at line 286 of file qcocoatheme.mm.

◆ fileIcon()

QIcon QCocoaTheme::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 433 of file qcocoatheme.mm.

◆ font()

const QFont * QCocoaTheme::font ( Font  type = SystemFont) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 306 of file qcocoatheme.mm.

References QGuiApplicationPrivate::platformIntegration(), and QCoreTextFontDatabase::themeFont().

+ Here is the call graph for this function:

◆ handleSystemThemeChange()

void QCocoaTheme::handleSystemThemeChange ( )

Definition at line 242 of file qcocoatheme.mm.

References QFontCache::clear(), QCoreTextFontEngine::fontSmoothing(), QCoreTextFontEngine::Grayscale, QFontCache::instance(), qt_mac_createRolePalettes(), qt_mac_createSystemPalette(), and reset().

Referenced by QCocoaTheme().

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

◆ keyBindings()

QList< QKeySequence > QCocoaTheme::keyBindings ( QKeySequence::StandardKey  key) const
override

Definition at line 518 of file qcocoatheme.mm.

References Qt::AA_MacDontSwapCtrlAndMeta, QList< T >::append(), Qt::ControlModifier, Qt::MetaModifier, Q_ASSERT, and qApp.

+ Here is the call graph for this function:

◆ palette()

const QPalette * QCocoaTheme::palette ( Palette  type = SystemPalette) const
overridevirtual

Reimplemented from QPlatformTheme.

Definition at line 292 of file qcocoatheme.mm.

References QHash< Key, T >::isEmpty(), qt_mac_createRolePalettes(), qt_mac_createSystemPalette(), QPlatformTheme::SystemPalette, and QHash< Key, T >::value().

+ Here is the call graph for this function:

◆ reset()

void QCocoaTheme::reset ( )

Definition at line 234 of file qcocoatheme.mm.

References QHash< Key, T >::clear(), and qDeleteAll().

Referenced by ~QCocoaTheme(), and handleSystemThemeChange().

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

◆ standardButtonShortcut()

QKeySequence QCocoaTheme::standardButtonShortcut ( int  button) const
override

Definition at line 488 of file qcocoatheme.mm.

References button, Qt::CTRL, QPlatformDialogHelper::Discard, and Qt::Key_Delete.

◆ standardButtonText()

QString QCocoaTheme::standardButtonText ( int  button) const
overridevirtual

Returns the text of a standard button.

Since
5.3
See also
QPlatformDialogHelper::StandardButton

Reimplemented from QPlatformTheme.

Definition at line 481 of file qcocoatheme.mm.

References button, QPlatformDialogHelper::Discard, QPlatformTheme::standardButtonText(), and QCoreApplication::translate().

+ Here is the call graph for this function:

◆ standardPixmap()

◆ themeHint()

◆ usePlatformNativeDialog()

bool QCocoaTheme::usePlatformNativeDialog ( DialogType  dialogType) const
overridevirtual

Member Data Documentation

◆ name

const char * QCocoaTheme::name = "cocoa"
static

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