The QChartView 是可以顯示圖錶的獨立 Widget。 更多...
| 頭: | #include <QChartView> |
| 繼承: | QGraphicsView |
| enum | RubberBand { NoRubberBand, VerticalRubberBand, HorizontalRubberBand, RectangleRubberBand } |
| flags | RubberBands |
| QChartView (QWidget * parent = nullptr) | |
| QChartView (QChart * chart , QWidget * parent = nullptr) | |
| virtual | ~QChartView () |
| QChart * | chart () const |
| QChartView::RubberBands | rubberBand () const |
| void | setChart (QChart * chart ) |
| void | setRubberBand (const QChartView::RubberBands & rubberBand ) |
| const QMetaObject | staticMetaObject |
| virtual void | mouseMoveEvent (QMouseEvent * event ) |
| virtual void | mousePressEvent (QMouseEvent * event ) |
| virtual void | mouseReleaseEvent (QMouseEvent * event ) |
| virtual void | resizeEvent (QResizeEvent * event ) |
| QScopedPointer<QChartViewPrivate> | d_ptr |
The QChartView 是可以顯示圖錶的獨立 Widget。
圖錶視圖不要求 QGraphicsScene 對象去工作。要顯示圖錶在現有 QGraphicsScene , QChart or QPolarChart 類應該被使用以取而代之。
另請參閱 QChart and QPolarChart .
This enum describes the different types of rubber band effects that can be applied to the rectangular zooming area.
| 常量 | 值 | 描述 |
|---|---|---|
QChartView::NoRubberBand
|
0x0
|
No zooming area is specified, and therefore zooming is not enabled. |
QChartView::VerticalRubberBand
|
0x1
|
The rubber band is locked to the size of the chart horizontally and can be pulled vertically to specify the zooming area. |
QChartView::HorizontalRubberBand
|
0x2
|
The rubber band is locked to the size of the chart vertically and can be pulled horizontally to specify the zooming area. |
QChartView::RectangleRubberBand
|
0x3
|
The rubber band is fixed to the point that was clicked and can be pulled both vertically and horizontally. |
RubberBands 類型是 typedef 對於 QFlags <RubberBand>. It stores an OR combination of RubberBand values.
構造圖錶視圖對象采用父級 parent .
構造圖錶視圖對象采用父級 parent to display the chart chart . The ownership of the chart is passed to the chart view.
[虛擬]
QChartView::
~QChartView
()
Deletes the chart view object and the associated chart.
返迴關聯圖錶的指針。
另請參閱 setChart ().
[virtual protected]
void
QChartView::
mouseMoveEvent
(
QMouseEvent
*
event
)
重實現自 QGraphicsView::mouseMoveEvent ().
If the rubber band rectangle is displayed in the press event specified by event , the event data is used to update the rubber band geometry. Otherwise, the default QGraphicsView::mouseMoveEvent () implementation is called.
[virtual protected]
void
QChartView::
mousePressEvent
(
QMouseEvent
*
event
)
重實現自 QGraphicsView::mousePressEvent ().
If the left mouse button is pressed and the rubber band is enabled, the event event is accepted and the rubber band is displayed on the screen. This enables the user to select the zoom area.
If some other mouse button is pressed or the rubber band is disabled, the event is passed to QGraphicsView::mousePressEvent ().
[virtual protected]
void
QChartView::
mouseReleaseEvent
(
QMouseEvent
*
event
)
重實現自 QGraphicsView::mouseReleaseEvent ().
If the left mouse button is released and the rubber band is enabled, the event event is accepted and the view is zoomed into the rectangle specified by the rubber band. If releasing the right mouse button triggered the event, the view is zoomed out.
[virtual protected]
void
QChartView::
resizeEvent
(
QResizeEvent
*
event
)
重實現自 QGraphicsView::resizeEvent ().
Resizes and updates the chart area using the data specified by event .
返迴圖錶視圖目前正使用的橡皮筋標誌。
另請參閱 setRubberBand ().
將當前圖錶設為 chart . The ownership of the new chart is passed to the chart view and the ownership of the previous chart is released.
To avoid memory leaks, the previous chart must be deleted.
另請參閱 chart ().
Sets the rubber band flags to rubberBand . The selected flags determine the way zooming is performed.
注意: Rubber band zooming is not supported for polar charts.
另請參閱 rubberBand ().