QtCanpool 3.3.0
载入中...
搜索中...
未找到
QxTheme 命名空间参考

Copyright (C) 2026 maminjie canpo.nosp@m.ol@1.nosp@m.63.co.nosp@m.m SPDX-License-Identifier: MulanPSL-2.0 更多...

类

class  QxThemeManager
 Application-wide theme engine. 更多...
 

枚举

enum  Theme {
  LightYellow , LightOffice2013 , LightClassic , LightFancy ,
  DarkWps , DarkOfficePlus , Custom
}
 The themes understood by QxThemeManager. 更多...
 

函数

QString themeId (Theme theme)
 Stable identifier written to the configuration.
 
QString themeName (Theme theme)
 Human readable name, suitable for a settings dialog.
 
Theme themeFromId (const QString &id, Theme fallback=LightYellow)
 Resolves an id produced by themeId(); fallback is returned for unknown ids.
 
bool isDarkTheme (Theme theme)
 True for the themes that draw on a dark background.
 
QString themeStyleSheetPath (Theme theme)
 Resource path of the style sheet shipped with theme, empty for Custom.
 
QString themeStyleSheet (Theme theme)
 Content of the built-in style sheet, empty when the resource is missing.
 
QPalette lightPalette ()
 The palette that backs the light themes.
 
QPalette darkPalette ()
 The palette that backs the dark themes.
 
QPalette palette (Theme theme)
 Palette matching theme: the dark palette for DarkWps / DarkOfficePlus, the light one otherwise.
 

详细描述

Copyright (C) 2026 maminjie canpo.nosp@m.ol@1.nosp@m.63.co.nosp@m.m SPDX-License-Identifier: MulanPSL-2.0

枚举类型说明

◆ Theme

The themes understood by QxThemeManager.

The order mirrors the ThemeStyle enumeration of the ribbon theme, so the two enumerations map onto each other without a translation table. Custom means "ship your own style sheet" and keeps the built-in resources untouched.

枚举值
LightYellow 
LightOffice2013 
LightClassic 
LightFancy 
DarkWps 
DarkOfficePlus 
Custom 

在文件 qxtheme.h 第 22 行定义.

函数说明

◆ darkPalette()

QPalette QxTheme::darkPalette ( )

The palette that backs the dark themes.

在文件 qxthemepalette.cpp 第 103 行定义.

◆ isDarkTheme()

bool QxTheme::isDarkTheme ( Theme  theme)

True for the themes that draw on a dark background.

在文件 qxtheme.cpp 第 78 行定义.

◆ lightPalette()

QPalette QxTheme::lightPalette ( )

The palette that backs the light themes.

The style sheets only reach the widgets they name explicitly; menus, native dialogs, tooltips and disabled text are still painted from the application palette. These palettes keep those surfaces consistent with the style sheets instead of leaving them on the platform default.

在文件 qxthemepalette.cpp 第 98 行定义.

◆ palette()

QPalette QxTheme::palette ( Theme  theme)

Palette matching theme: the dark palette for DarkWps / DarkOfficePlus, the light one otherwise.

在文件 qxthemepalette.cpp 第 108 行定义.

◆ themeFromId()

Theme QxTheme::themeFromId ( const QString &  id,
Theme  fallback 
)

Resolves an id produced by themeId(); fallback is returned for unknown ids.

在文件 qxtheme.cpp 第 68 行定义.

◆ themeId()

QString QxTheme::themeId ( Theme  theme)

Stable identifier written to the configuration.

Never translate it.

在文件 qxtheme.cpp 第 56 行定义.

◆ themeName()

QString QxTheme::themeName ( Theme  theme)

Human readable name, suitable for a settings dialog.

在文件 qxtheme.cpp 第 62 行定义.

◆ themeStyleSheet()

QString QxTheme::themeStyleSheet ( Theme  theme)

Content of the built-in style sheet, empty when the resource is missing.

在文件 qxtheme.cpp 第 93 行定义.

◆ themeStyleSheetPath()

QString QxTheme::themeStyleSheetPath ( Theme  theme)

Resource path of the style sheet shipped with theme, empty for Custom.

The style sheets live in the qxribbon resource bundle, so the path only resolves when that library is linked into the process. Use QxThemeManager::setStyleSheetFile() to point a theme somewhere else.

在文件 qxtheme.cpp 第 84 行定义.