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
QKdeTheme Class Reference

QKdeTheme is a theme implementation for the KDE desktop (version 4 or higher). More...

#include <qkdetheme_p.h>

Inheritance diagram for QKdeTheme:
Collaboration diagram for QKdeTheme:

Public Member Functions

 QKdeTheme (const QStringList &kdeDirs, int kdeVersion)
 ~QKdeTheme () override
QVariant themeHint (ThemeHint hint) const override
QIcon fileIcon (const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions={ }) const override
 Return an icon for fileInfo, observing iconOptions.
const QPalettepalette (Palette type=SystemPalette) const override
 Return a color palette for type type.
Qt::ColorScheme colorScheme () const override
void requestColorScheme (Qt::ColorScheme scheme) override
 QKdeTheme::requestColorScheme Programmatically request a color scheme If scheme is Dark or Light, scheme is applied to the application, independently from the current KDE theme. If scheme is Unknown, the current KDE theme's color scheme will be applied instead. This is the default behavior.
const QFontfont (Font type) const override
Public Member Functions inherited from QGenericUnixTheme
 QGenericUnixTheme ()
Public Member Functions inherited from QPlatformTheme
 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 QPixmap standardPixmap (StandardPixmap sp, const QSizeF &size) const
 Return a pixmap for standardPixmap, at the given size.
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.
virtual Qt::ContrastPreference contrastPreference () const
QString name () const

Static Public Member Functions

static QPlatformThemecreateKdeTheme ()
Static Public Member Functions inherited from QGenericUnixTheme
static QStringList xdgIconThemePaths ()
static QPlatformThemecreateUnixTheme (const QString &name)
 Creates a UNIX theme according to the given theme name.
static QStringList themeNames ()
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 = "kde"
Static Public Attributes inherited from QGenericUnixTheme
static const char * name = "generic"
static constexpr char defaultSystemFontNameC [] = "Sans Serif"
static constexpr char defaultFixedFontNameC [] = "monospace"

Additional Inherited Members

Public Types inherited from QGenericUnixTheme
enum  { defaultSystemFontSize = 9 }
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 QGenericUnixTheme
 QGenericUnixTheme (QGenericUnixThemePrivate *p)
Protected Member Functions inherited from QPlatformTheme
 QPlatformTheme (QPlatformThemePrivate *priv)
Static Protected Member Functions inherited from QGenericUnixTheme
static QStringList iconFallbackPaths ()
static bool isDBusGlobalMenuAvailable ()
static QString mouseCursorTheme ()
static QSize mouseCursorSize ()
static QList< QSizeavailableXdgFileIconSizes ()
Protected Attributes inherited from QPlatformTheme
QScopedPointer< QPlatformThemePrivated_ptr

Detailed Description

QKdeTheme is a theme implementation for the KDE desktop (version 4 or higher).

Since
5.0

Definition at line 29 of file qkdetheme_p.h.

Constructor & Destructor Documentation

◆ QKdeTheme()

QKdeTheme::QKdeTheme ( const QStringList & kdeDirs,
int kdeVersion )
explicit

Definition at line 546 of file qkdetheme.cpp.

◆ ~QKdeTheme()

QKdeTheme::~QKdeTheme ( )
overridedefault

Member Function Documentation

◆ colorScheme()

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

Reimplemented from QPlatformTheme.

Definition at line 695 of file qkdetheme.cpp.

◆ createKdeTheme()

QPlatformTheme * QKdeTheme::createKdeTheme ( )
static

Definition at line 763 of file qkdetheme.cpp.

◆ fileIcon()

QIcon QKdeTheme::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 647 of file qkdetheme.cpp.

◆ font()

const QFont * QKdeTheme::font ( Font type) const
overridevirtual

Reimplemented from QGenericUnixTheme.

Definition at line 757 of file qkdetheme.cpp.

◆ palette()

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

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 744 of file qkdetheme.cpp.

◆ requestColorScheme()

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

QKdeTheme::requestColorScheme Programmatically request a color scheme If scheme is Dark or Light, scheme is applied to the application, independently from the current KDE theme. If scheme is Unknown, the current KDE theme's color scheme will be applied instead. This is the default behavior.

\reimp

Note
A KDE theme is considered either Dark or Light. When the requested color scheme doesn't match the current KDE theme, a default Dark or Light fusion palette is used instead.
See also
QKdeThemePrivate::hasRequestedColorScheme

QKdeThemePrivate::hasRequestedColorScheme Check if fusion palette fallback is necessary. This internal helper function returns true, if \list

  • a color scheme has been programmatically requested, and
  • the requested color scheme differs from the current KDE theme's color scheme. \endlist
    See also
    QKdeTheme:requestColorScheme

Reimplemented from QPlatformTheme.

Definition at line 684 of file qkdetheme.cpp.

◆ themeHint()

QVariant QKdeTheme::themeHint ( QPlatformTheme::ThemeHint hint) const
overridevirtual

Reimplemented from QGenericUnixTheme.

Definition at line 595 of file qkdetheme.cpp.

Member Data Documentation

◆ name

const char * QKdeTheme::name = "kde"
static

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