The QBarSet class represents one set of bars in a bar graph. 更多...
| 頭: |
#include <QBarSet>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
|
| qmake: |
QT += graphs
|
| 在 QML: | BarSet |
| 繼承: | QObject |
|
|
| QBarSet (const QString & label , QObject * parent = nullptr) | |
| virtual | ~QBarSet () override |
| void | append (const QList<qreal> & values ) |
| void | append (qreal value ) |
| qreal | at (qsizetype index ) const |
| QColor | borderColor () const |
| qreal | borderWidth () const |
| void | clear () |
| QColor | color () const |
| qsizetype | count () const |
| void | deselectAllBars () |
| void | deselectBar (qsizetype index ) |
| void | deselectBars (const QList<qsizetype> & indexes ) |
| void | insert (qsizetype index , qreal value ) |
| bool | isBarSelected (qsizetype index ) const |
| QString | label () const |
| QColor | labelColor () const |
| void | remove (qsizetype index , qsizetype count = 1) |
| void | replace (qsizetype index , qreal value ) |
| void | selectAllBars () |
| void | selectBar (qsizetype index ) |
| void | selectBars (const QList<qsizetype> & indexes ) |
| QList<qsizetype> | selectedBars () const |
| QColor | selectedColor () const |
| void | setBarSelected (qsizetype index , bool selected ) |
| void | setBorderColor (QColor color ) |
| void | setBorderWidth (qreal borderWidth ) |
| void | setColor (QColor color ) |
| void | setLabel (const QString & label ) |
| void | setLabelColor (QColor color ) |
| void | setSelectedColor (QColor color ) |
| void | setValues (const QVariantList & values ) |
| qreal | sum () const |
| void | toggleSelection (const QList<qsizetype> & indexes ) |
| QVariantList | 值 () const |
| QBarSet & | operator<< (qreal value ) |
| qreal | operator[] (qsizetype index ) const |
| void | borderColorChanged (QColor color ) |
| void | borderWidthChanged (qreal width ) |
| void | colorChanged (QColor color ) |
| void | countChanged () |
| void | labelChanged () |
| void | labelColorChanged (QColor color ) |
| void | selectedBarsChanged (const QList<qsizetype> & indexes ) |
| void | selectedColorChanged (QColor color ) |
| void | update () |
| void | updatedBars () |
| void | valueAdded (qsizetype index , qsizetype count ) |
| void | valueChanged (qsizetype index ) |
| void | valueRemoved (qsizetype index , qsizetype count ) |
| void | valuesAdded (qsizetype index , qsizetype count ) |
| void | valuesChanged () |
| void | valuesRemoved (qsizetype index , qsizetype count ) |
條形集包含每個類彆的一個數據值。假定集的第 1 個值屬於第 1 個類彆,第 2 個值屬於第 2 個類彆,依此類推。若集擁有的值少於類彆,假定缺少值位於集末尾。對於集中間的缺少值,使用數值 0。0 值集標簽不展示。
另請參閱 QBarSeries .
This property holds the border color of the bar set.
訪問函數:
| QColor | borderColor () const |
| void | setBorderColor (QColor color ) |
通知程序信號:
| void | borderColorChanged (QColor color ) |
This property holds the width of the border line. By default, the width is -1, meaning the border width is defined by the theme.
訪問函數:
| qreal | borderWidth () const |
| void | setBorderWidth (qreal borderWidth ) |
通知程序信號:
| void | borderWidthChanged (qreal width ) |
This property holds the fill color of the bar set.
訪問函數:
| QColor | color () const |
| void | setColor (QColor color ) |
通知程序信號:
| void | colorChanged (QColor color ) |
[read-only]
count
: const
qsizetype
This property holds the number of values in the bar set.
訪問函數:
| qsizetype | count () const | [見下文注意事項] |
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
通知程序信號:
| void | countChanged () |
此特性保持條形集的標簽。
訪問函數:
| QString | label () const |
| void | setLabel (const QString & label ) |
通知程序信號:
| void | labelChanged () |
This property holds the text (label) color of the bar set.
訪問函數:
| QColor | labelColor () const |
| void | setLabelColor (QColor color ) |
通知程序信號:
| void | labelColorChanged (QColor color ) |
[read-only]
selectedBars
: const
QList
<
qsizetype
>
This property holds the indexes of the bars which are currently selected.
訪問函數:
| QList<qsizetype> | selectedBars () const |
通知程序信號:
| void | selectedBarsChanged (const QList<qsizetype> & indexes ) |
This property holds the fill color of the selected set.
訪問函數:
| QColor | selectedColor () const |
| void | setSelectedColor (QColor color ) |
通知程序信號:
| void | selectedColorChanged (QColor color ) |
This property holds the values of the bar set.
You can set a list of either real or point types as values.
If you set a list of real types as values, they directly define the bar set values.
If you set a list of point types as values, the x-coordinate of the point specifies its zero-based index in the bar set. The size of the bar set is the highest x-coordinate value + 1. If a point is missing for any x-coordinate between zero and the highest value, it gets the value zero.
訪問函數:
| QVariantList | 值 () const |
| void | setValues (const QVariantList & values ) |
通知程序信號:
| void | valuesChanged () |
[explicit]
QBarSet::
QBarSet
(const
QString
&
label
,
QObject
*
parent
= nullptr)
構造條形集采用標簽 label and the parent parent .
[override virtual noexcept]
QBarSet::
~QBarSet
()
Removes the bar set.
[invokable]
void
QBarSet::
append
(const
QList
<
qreal
> &
values
)
Appends the list of real values specified by values to the end of the bar set.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 append().
[invokable]
void
QBarSet::
append
(
qreal
value
)
Appends the new value specified by value to the end of the bar set.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
qreal
QBarSet::
at
(
qsizetype
index
) const
Returns the value specified by index from the bar set. If the index is out of bounds, 0.0 is returned.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
Returns the line color for the bar set.
注意: getter 函數對於特性 borderColor。
另請參閱 setBorderColor ().
[invokable]
void
QBarSet::
clear
()
Removes all values from the set.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
Returns the fill color for the bar set.
注意: getter 函數對於特性 color。
另請參閱 setColor ().
[invokable]
qsizetype
QBarSet::
count
() const
Returns the number of values in a bar set.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
注意: getter 函數對於特性 count。
[invokable]
void
QBarSet::
deselectAllBars
()
Deselects all bars in the set.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[invokable]
void
QBarSet::
deselectBar
(
qsizetype
index
)
Deselects the bar at index .
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[invokable]
void
QBarSet::
deselectBars
(const
QList
<
qsizetype
> &
indexes
)
Marks multiple bars passed in an indexes list as deselected.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[invokable]
void
QBarSet::
insert
(
qsizetype
index
,
qreal
value
)
插入 value in the position specified by index . The values following the inserted value are moved up one position.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 remove ().
[invokable]
bool
QBarSet::
isBarSelected
(
qsizetype
index
) const
返迴
true
if the bar at the given
index
is among selected bars and
false
否則。
注意: Selected bars are drawn using the selected color if it was specified using QBarSet::setSelectedColor .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 selectedBars (), setBarSelected (),和 setSelectedColor ().
Returns the label of the bar set.
注意: Getter function for property label.
另請參閱 setLabel ().
Returns the text color for the bar set.
注意: Getter function for property labelColor.
另請參閱 setLabelColor ().
[invokable]
void
QBarSet::
remove
(
qsizetype
index
,
qsizetype
count
= 1)
Removes the number of values specified by count from the bar set starting with the value specified by index .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 insert ().
[invokable]
void
QBarSet::
replace
(
qsizetype
index
,
qreal
value
)
Adds the value specified by value to the bar set at the position specified by index .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
void
QBarSet::
selectAllBars
()
Marks all bars in the set as selected.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[invokable]
void
QBarSet::
selectBar
(
qsizetype
index
)
Marks the bar at index as selected.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[invokable]
void
QBarSet::
selectBars
(const
QList
<
qsizetype
> &
indexes
)
Marks multiple bars passed in an indexes list as selected.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
Returns a list of bars marked as selected.
注意: Getter function for property selectedBars.
另請參閱 setBarSelected ().
[signal]
void
QBarSet::
selectedBarsChanged
(const
QList
<
qsizetype
> &
indexes
)
This signal is emitted when the selected bar changes. indexes is a list selected bar indexes.
注意: 通知程序信號對於特性 selectedBars .
Returns the color of the selected bars.
This is the fill (brush) color of bars marked as selected. If not specified, value of QBarSet::color is used as default.
注意: Getter function for property selectedColor.
另請參閱 setSelectedColor () 和 color .
[invokable]
void
QBarSet::
setBarSelected
(
qsizetype
index
,
bool
selected
)
Marks the bar at index as either selected or deselected as specified by selected .
注意: Selected bars are drawn using the selected color if it was specified. Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 isBarSelected () 和 setSelectedColor ().
將條形集的綫顔色設為 color .
注意: setter 函數對於特性 borderColor .
另請參閱 borderColor ().
將條形集的填充顔色設為 color .
注意: setter 函數對於特性 color .
另請參閱 color ().
設置 label as the new label for the bar set.
注意: setter 函數對於特性 label .
另請參閱 label ().
Sets the text color for the bar set to color .
注意: setter 函數對於特性 labelColor .
另請參閱 labelColor ().
設置 color of the selected bars.
注意: setter 函數對於特性 selectedColor .
另請參閱 selectedColor .
[invokable]
qreal
QBarSet::
sum
() const
Returns the sum of all values in the bar set.
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
[invokable]
void
QBarSet::
toggleSelection
(const
QList
<
qsizetype
> &
indexes
)
Changes the selection state of bars at the given indexes to the opposite one.
注意: Emits QBarSet::selectedBarsChanged .
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .
另請參閱 setBarSelected ().
[signal]
void
QBarSet::
update
()
This signal is emitted when the barset is updated.
[signal]
void
QBarSet::
updatedBars
()
This signal is emitted when the bars in this set are updated.
[signal]
void
QBarSet::
valueAdded
(
qsizetype
index
,
qsizetype
count
)
This signal is emitted when new values are added to the bar set. index indicates the position of the first inserted value, and count is the number of inserted values.
[signal]
void
QBarSet::
valueChanged
(
qsizetype
index
)
This signal is emitted when the value at the position specified by index 被修改。
另請參閱 at ().
[signal]
void
QBarSet::
valueRemoved
(
qsizetype
index
,
qsizetype
count
)
This signal is emitted when values are removed from the bar set. index indicates the position of the first removed value, and count is the number of removed values.
[signal]
void
QBarSet::
valuesAdded
(
qsizetype
index
,
qsizetype
count
)
This signal is emitted when new values are added to the bar set. index indicates the position of the first inserted value, and count is the number of inserted values.
[signal]
void
QBarSet::
valuesRemoved
(
qsizetype
index
,
qsizetype
count
)
This signal is emitted when values are removed from the bar set. index indicates the position of the first removed value, and count is the number of removed values.
另請參閱 remove ().
A convenience operator for appending the real value specified by value to the end of the bar set.
另請參閱 append ().
Returns the value of the bar set specified by index . If the index is out of bounds, 0.0 is returned.