Q3DTheme¶
Q3DTheme
class provides a visual style for graphs. More…
Synopsis¶
Functions¶
def
ambientLightStrength
()def
backgroundColor
()def
baseColors
()def
baseGradients
()def
colorStyle
()def
font
()def
gridLineColor
()def
highlightLightStrength
()def
isBackgroundEnabled
()def
isGridEnabled
()def
isLabelBackgroundEnabled
()def
isLabelBorderEnabled
()def
labelBackgroundColor
()def
labelTextColor
()def
lightColor
()def
lightStrength
()def
multiHighlightColor
()def
multiHighlightGradient
()def
setAmbientLightStrength
(strength)def
setBackgroundColor
(color)def
setBackgroundEnabled
(enabled)def
setBaseColors
(colors)def
setBaseGradients
(gradients)def
setColorStyle
(style)def
setFont
(font)def
setGridEnabled
(enabled)def
setGridLineColor
(color)def
setHighlightLightStrength
(strength)def
setLabelBackgroundColor
(color)def
setLabelBackgroundEnabled
(enabled)def
setLabelBorderEnabled
(enabled)def
setLabelTextColor
(color)def
setLightColor
(color)def
setLightStrength
(strength)def
setMultiHighlightColor
(color)def
setMultiHighlightGradient
(gradient)def
setSingleHighlightColor
(color)def
setSingleHighlightGradient
(gradient)def
setType
(themeType)def
setWindowColor
(color)def
singleHighlightColor
()def
singleHighlightGradient
()def
type
()def
windowColor
()
Signals¶
def
ambientLightStrengthChanged
(strength)def
backgroundColorChanged
(color)def
backgroundEnabledChanged
(enabled)def
baseColorsChanged
(colors)def
baseGradientsChanged
(gradients)def
colorStyleChanged
(style)def
fontChanged
(font)def
gridEnabledChanged
(enabled)def
gridLineColorChanged
(color)def
highlightLightStrengthChanged
(strength)def
labelBackgroundColorChanged
(color)def
labelBackgroundEnabledChanged
(enabled)def
labelBorderEnabledChanged
(enabled)def
labelTextColorChanged
(color)def
lightColorChanged
(color)def
lightStrengthChanged
(strength)def
multiHighlightColorChanged
(color)def
multiHighlightGradientChanged
(gradient)def
singleHighlightColorChanged
(color)def
singleHighlightGradientChanged
(gradient)def
typeChanged
(themeType)def
windowColorChanged
(color)
Detailed Description¶
Specifies visual properties that affect the whole graph. There are several built-in themes that can be used as is or modified freely.
The following properties can be overridden by using QAbstract3DSeries
properties to set them explicitly in the series: baseColors
, baseGradients
, and colorStyle
.
Themes can be created from scratch using the ThemeUserDefined
enum value. Creating a theme using the default constructor produces a new user-defined theme.
Default Theme¶
The following table lists the properties controlled by themes and the default values for ThemeUserDefined
.
Property
Default Value
0.25
black
backgroundEnabled
true
black
QLinearGradient
. Essentially fully black.
ColorStyleUniform
QFont
gridEnabled
true
white
7.5
gray
labelBackgroundEnabled
true
labelBorderEnabled
true
white
white
5.0
blue
QLinearGradient
. Essentially fully black.
red
QLinearGradient
. Essentially fully black.
black
Usage Examples¶
Creating a built-in theme without any modifications:
theme = Q3DTheme(Q3DTheme.ThemeQt)
Creating a built-in theme and modifying some properties:
theme = Q3DTheme(Q3DTheme.ThemeQt) theme.setBackgroundEnabled(False) theme.setLabelBackgroundEnabled(False)
Creating a user-defined theme:
theme = Q3DTheme() theme.setAmbientLightStrength(0.3f) theme.setBackgroundColor(QColor(QRgb(0x99ca53))) theme.setBackgroundEnabled(True) theme.setBaseColor(QColor(QRgb(0x209fdf))) theme.setColorStyle(Q3DTheme.ColorStyleUniform) theme.setFont(QFont(QStringLiteral("Impact"), 35)) theme.setGridEnabled(True) theme.setGridLineColor(QColor(QRgb(0x99ca53))) theme.setHighlightLightStrength(7.0f) theme.setLabelBackgroundColor(QColor(0xf6, 0xa6, 0x25, 0xa0)) theme.setLabelBackgroundEnabled(True) theme.setLabelBorderEnabled(True) theme.setLabelTextColor(QColor(QRgb(0x404044))) theme.setLightColor(Qt.white) theme.setLightStrength(6.0f) theme.setMultiHighlightColor(QColor(QRgb(0x6d5fd5))) theme.setSingleHighlightColor(QColor(QRgb(0xf6a625))) theme.setWindowColor(QColor(QRgb(0xffffff)))
Creating a built-in theme and modifying some properties after it has been set:
graph = Q3DBars() graph.activeTheme().setType(Q3DTheme.ThemePrimaryColors) graph.activeTheme().setBaseColor(Qt.red) graph.activeTheme().setSingleHighlightColor(Qt.yellow)
- class PySide6.QtDataVisualization.Q3DTheme(themeType[, parent=None])¶
PySide6.QtDataVisualization.Q3DTheme([parent=None])
- Parameters
themeType –
Theme
parent –
PySide6.QtCore.QObject
Constructs a new theme with themeType
, which can be one of the built-in themes from Theme
. An optional parent
parameter can be given and is then passed to QObject
constructor.
Constructs a new theme of type ThemeUserDefined
. An optional parent
parameter can be given and is then passed to QObject
constructor.
- PySide6.QtDataVisualization.Q3DTheme.ColorStyle¶
Color styles.
Constant
Description
Q3DTheme.ColorStyleUniform
Objects are rendered in a single color. The color used is specified in
baseColors
,singleHighlightColor
andmultiHighlightColor
properties.Q3DTheme.ColorStyleObjectGradient
Objects are colored using a full gradient for each object regardless of object height. The gradient used is specified in
baseGradients
,singleHighlightGradient
andmultiHighlightGradient
properties.Q3DTheme.ColorStyleRangeGradient
Objects are colored using a portion of the full gradient determined by the object’s height and its position on the Y-axis. The gradient used is specified in
baseGradients
,singleHighlightGradient
andmultiHighlightGradient
properties.
- PySide6.QtDataVisualization.Q3DTheme.Theme¶
Built-in themes.
Constant
Description
Q3DTheme.ThemeQt
A light theme with green as the base color.
Q3DTheme.ThemePrimaryColors
A light theme with yellow as the base color.
Q3DTheme.ThemeDigia
A light theme with gray as the base color.
Q3DTheme.ThemeStoneMoss
A medium dark theme with yellow as the base color.
Q3DTheme.ThemeArmyBlue
A medium light theme with blue as the base color.
Q3DTheme.ThemeRetro
A medium light theme with brown as the base color.
Q3DTheme.ThemeEbony
A dark theme with white as the base color.
Q3DTheme.ThemeIsabelle
A dark theme with yellow as the base color.
Q3DTheme.ThemeUserDefined
A user-defined theme. For more information, see Default Theme .
- PySide6.QtDataVisualization.Q3DTheme.ambientLightStrength()¶
- Return type
float
This property holds The ambient light strength for the whole graph..
This value determines how evenly and brightly the colors are shown throughout the graph regardless of the light position.
The value must be between 0.0f
and 1.0f
.
- PySide6.QtDataVisualization.Q3DTheme.ambientLightStrengthChanged(strength)¶
- Parameters
strength – float
- PySide6.QtDataVisualization.Q3DTheme.backgroundColor()¶
- Return type
This property holds The color of the graph background..
- PySide6.QtDataVisualization.Q3DTheme.backgroundColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.backgroundEnabledChanged(enabled)¶
- Parameters
enabled – bool
- PySide6.QtDataVisualization.Q3DTheme.baseColors()¶
- Return type
This property holds The list of base colors to be used for all the objects in the graph, series by series..
If there are more series than colors, the color list wraps and starts again with the first color in the list.
Has no immediate effect if colorStyle
is not ColorStyleUniform
.
This value can be overridden by setting the baseColor
explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.baseColorsChanged(colors)¶
- Parameters
colors –
- PySide6.QtDataVisualization.Q3DTheme.baseGradients()¶
- Return type
This property holds The list of base gradients to be used for all the objects in the graph, series by series..
If there are more series than gradients, the gradient list wraps and starts again with the first gradient in the list
Has no immediate effect if colorStyle
is ColorStyleUniform
.
This value can be overridden by setting the baseGradient
explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.baseGradientsChanged(gradients)¶
- Parameters
gradients –
- PySide6.QtDataVisualization.Q3DTheme.colorStyle()¶
- Return type
This property holds The style of the graph colors..
One of the ColorStyle
enum values.
This value can be overridden by setting colorStyle explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.colorStyleChanged(style)¶
- Parameters
style –
ColorStyle
- PySide6.QtDataVisualization.Q3DTheme.font()¶
- Return type
This property holds The font to be used for labels..
- PySide6.QtDataVisualization.Q3DTheme.fontChanged(font)¶
- Parameters
font –
PySide6.QtGui.QFont
- PySide6.QtDataVisualization.Q3DTheme.gridEnabledChanged(enabled)¶
- Parameters
enabled – bool
- PySide6.QtDataVisualization.Q3DTheme.gridLineColor()¶
- Return type
This property holds The color of the grid lines..
- PySide6.QtDataVisualization.Q3DTheme.gridLineColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.highlightLightStrength()¶
- Return type
float
This property holds The specular light strength for selected objects..
The value must be between 0.0f
and 10.0f
.
- PySide6.QtDataVisualization.Q3DTheme.highlightLightStrengthChanged(strength)¶
- Parameters
strength – float
- PySide6.QtDataVisualization.Q3DTheme.isBackgroundEnabled()¶
- Return type
bool
This property holds Whether the background is visible..
The background is drawn by using the value of backgroundColor
.
- PySide6.QtDataVisualization.Q3DTheme.isGridEnabled()¶
- Return type
bool
This property holds Whether the grid lines are drawn..
This value affects all grid lines.
- PySide6.QtDataVisualization.Q3DTheme.isLabelBackgroundEnabled()¶
- Return type
bool
This property holds Whether the label is drawn with a color background or with a fully transparent background..
The labelBackgroundColor
value (including alpha) is used for drawing the background.
Labels with a background are drawn to equal sizes per axis based on the longest label, and the text is centered in them. Labels without a background are drawn as is and are left or right aligned based on their position in the graph.
- PySide6.QtDataVisualization.Q3DTheme.isLabelBorderEnabled()¶
- Return type
bool
This property holds Whether label borders are drawn for labels that have a background..
Has no effect if labelBackgroundEnabled
is false
.
- PySide6.QtDataVisualization.Q3DTheme.labelBackgroundColor()¶
- Return type
This property holds The color of the label backgrounds..
Has no effect if labelBackgroundEnabled
is false
.
- PySide6.QtDataVisualization.Q3DTheme.labelBackgroundColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.labelBackgroundEnabledChanged(enabled)¶
- Parameters
enabled – bool
- PySide6.QtDataVisualization.Q3DTheme.labelBorderEnabledChanged(enabled)¶
- Parameters
enabled – bool
- PySide6.QtDataVisualization.Q3DTheme.labelTextColor()¶
- Return type
This property holds The color of the font used for labels..
- PySide6.QtDataVisualization.Q3DTheme.labelTextColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.lightColor()¶
- Return type
This property holds The color for the ambient and specular light..
This value affects the light specified in Q3DScene
.
- PySide6.QtDataVisualization.Q3DTheme.lightColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.lightStrength()¶
- Return type
float
This property holds The specular light strength for the whole graph..
The value must be between 0.0f
and 10.0f
.
This value affects the light specified in Q3DScene
.
- PySide6.QtDataVisualization.Q3DTheme.lightStrengthChanged(strength)¶
- Parameters
strength – float
- PySide6.QtDataVisualization.Q3DTheme.multiHighlightColor()¶
- Return type
This property holds The highlight color for selected objects..
Used if selectionMode
has the QAbstract3DGraph::SelectionRow
or QAbstract3DGraph::SelectionColumn
flag set.
- PySide6.QtDataVisualization.Q3DTheme.multiHighlightColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.multiHighlightGradient()¶
- Return type
This property holds The highlight gradient for selected objects..
Used if selectionMode
has the QAbstract3DGraph::SelectionRow
or QAbstract3DGraph::SelectionColumn
flag set.
- PySide6.QtDataVisualization.Q3DTheme.multiHighlightGradientChanged(gradient)¶
- Parameters
gradient –
PySide6.QtGui.QLinearGradient
- PySide6.QtDataVisualization.Q3DTheme.setAmbientLightStrength(strength)¶
- Parameters
strength – float
This property holds The ambient light strength for the whole graph..
This value determines how evenly and brightly the colors are shown throughout the graph regardless of the light position.
The value must be between 0.0f
and 1.0f
.
- PySide6.QtDataVisualization.Q3DTheme.setBackgroundColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color of the graph background..
- PySide6.QtDataVisualization.Q3DTheme.setBackgroundEnabled(enabled)¶
- Parameters
enabled – bool
This property holds Whether the background is visible..
The background is drawn by using the value of backgroundColor
.
- PySide6.QtDataVisualization.Q3DTheme.setBaseColors(colors)¶
- Parameters
colors –
This property holds The list of base colors to be used for all the objects in the graph, series by series..
If there are more series than colors, the color list wraps and starts again with the first color in the list.
Has no immediate effect if colorStyle
is not ColorStyleUniform
.
This value can be overridden by setting the baseColor
explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.setBaseGradients(gradients)¶
- Parameters
gradients –
This property holds The list of base gradients to be used for all the objects in the graph, series by series..
If there are more series than gradients, the gradient list wraps and starts again with the first gradient in the list
Has no immediate effect if colorStyle
is ColorStyleUniform
.
This value can be overridden by setting the baseGradient
explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.setColorStyle(style)¶
- Parameters
style –
ColorStyle
This property holds The style of the graph colors..
One of the ColorStyle
enum values.
This value can be overridden by setting colorStyle explicitly in the series.
- PySide6.QtDataVisualization.Q3DTheme.setFont(font)¶
- Parameters
font –
PySide6.QtGui.QFont
This property holds The font to be used for labels..
- PySide6.QtDataVisualization.Q3DTheme.setGridEnabled(enabled)¶
- Parameters
enabled – bool
This property holds Whether the grid lines are drawn..
This value affects all grid lines.
- PySide6.QtDataVisualization.Q3DTheme.setGridLineColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color of the grid lines..
- PySide6.QtDataVisualization.Q3DTheme.setHighlightLightStrength(strength)¶
- Parameters
strength – float
This property holds The specular light strength for selected objects..
The value must be between 0.0f
and 10.0f
.
- PySide6.QtDataVisualization.Q3DTheme.setLabelBackgroundColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color of the label backgrounds..
Has no effect if labelBackgroundEnabled
is false
.
- PySide6.QtDataVisualization.Q3DTheme.setLabelBackgroundEnabled(enabled)¶
- Parameters
enabled – bool
This property holds Whether the label is drawn with a color background or with a fully transparent background..
The labelBackgroundColor
value (including alpha) is used for drawing the background.
Labels with a background are drawn to equal sizes per axis based on the longest label, and the text is centered in them. Labels without a background are drawn as is and are left or right aligned based on their position in the graph.
- PySide6.QtDataVisualization.Q3DTheme.setLabelBorderEnabled(enabled)¶
- Parameters
enabled – bool
This property holds Whether label borders are drawn for labels that have a background..
Has no effect if labelBackgroundEnabled
is false
.
- PySide6.QtDataVisualization.Q3DTheme.setLabelTextColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color of the font used for labels..
- PySide6.QtDataVisualization.Q3DTheme.setLightColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color for the ambient and specular light..
This value affects the light specified in Q3DScene
.
- PySide6.QtDataVisualization.Q3DTheme.setLightStrength(strength)¶
- Parameters
strength – float
This property holds The specular light strength for the whole graph..
The value must be between 0.0f
and 10.0f
.
This value affects the light specified in Q3DScene
.
- PySide6.QtDataVisualization.Q3DTheme.setMultiHighlightColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The highlight color for selected objects..
Used if selectionMode
has the QAbstract3DGraph::SelectionRow
or QAbstract3DGraph::SelectionColumn
flag set.
- PySide6.QtDataVisualization.Q3DTheme.setMultiHighlightGradient(gradient)¶
- Parameters
gradient –
PySide6.QtGui.QLinearGradient
This property holds The highlight gradient for selected objects..
Used if selectionMode
has the QAbstract3DGraph::SelectionRow
or QAbstract3DGraph::SelectionColumn
flag set.
- PySide6.QtDataVisualization.Q3DTheme.setSingleHighlightColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The highlight color for a selected object..
Used if selectionMode
has the QAbstract3DGraph::SelectionItem
flag set.
- PySide6.QtDataVisualization.Q3DTheme.setSingleHighlightGradient(gradient)¶
- Parameters
gradient –
PySide6.QtGui.QLinearGradient
This property holds The highlight gradient for a selected object..
Used if selectionMode
has the QAbstract3DGraph::SelectionItem
flag set.
This property holds The type of the theme..
The type is automatically set when constructing a theme, but can also be changed later. Changing the theme type will change all other properties of the theme to what the predefined theme specifies. Changing the theme type of the active theme of the graph will also reset all attached series to use the new theme.
- PySide6.QtDataVisualization.Q3DTheme.setWindowColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color of the application window the graph is drawn into..
- PySide6.QtDataVisualization.Q3DTheme.singleHighlightColor()¶
- Return type
This property holds The highlight color for a selected object..
Used if selectionMode
has the QAbstract3DGraph::SelectionItem
flag set.
- PySide6.QtDataVisualization.Q3DTheme.singleHighlightColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
- PySide6.QtDataVisualization.Q3DTheme.singleHighlightGradient()¶
- Return type
This property holds The highlight gradient for a selected object..
Used if selectionMode
has the QAbstract3DGraph::SelectionItem
flag set.
- PySide6.QtDataVisualization.Q3DTheme.singleHighlightGradientChanged(gradient)¶
- Parameters
gradient –
PySide6.QtGui.QLinearGradient
This property holds The type of the theme..
The type is automatically set when constructing a theme, but can also be changed later. Changing the theme type will change all other properties of the theme to what the predefined theme specifies. Changing the theme type of the active theme of the graph will also reset all attached series to use the new theme.
- PySide6.QtDataVisualization.Q3DTheme.windowColor()¶
- Return type
This property holds The color of the application window the graph is drawn into..
- PySide6.QtDataVisualization.Q3DTheme.windowColorChanged(color)¶
- Parameters
color –
PySide6.QtGui.QColor
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.