QCPItemEllipse
Public Attributes | |
QCPItemAnchor *const | bottom |
QCPItemAnchor *const | bottomLeftRim |
QCPItemPosition *const | bottomRight |
QCPItemAnchor *const | bottomRightRim |
QCPItemAnchor *const | center |
QCPItemAnchor *const | left |
QCPItemAnchor *const | right |
QCPItemAnchor *const | top |
QCPItemPosition *const | topLeft |
QCPItemAnchor *const | topLeftRim |
QCPItemAnchor *const | topRightRim |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Protected Types | |
enum | AnchorIndex { aiTopLeftRim , aiTop , aiTopRightRim , aiRight , aiBottomRightRim , aiBottom , aiBottomLeftRim , aiLeft , aiCenter } |
Protected Attributes | |
QBrush | mBrush |
QPen | mPen |
QBrush | mSelectedBrush |
QPen | mSelectedPen |
Protected Attributes inherited from QCPAbstractItem | |
QList< QCPItemAnchor * > | mAnchors |
QPointer< QCPAxisRect > | mClipAxisRect |
bool | mClipToAxisRect |
QList< QCPItemPosition * > | mPositions |
bool | mSelectable |
bool | mSelected |
Protected Attributes inherited from QCPLayerable | |
bool | mAntialiased |
QCPLayer * | mLayer |
QPointer< QCPLayerable > | mParentLayerable |
QCustomPlot * | mParentPlot |
bool | mVisible |
Detailed Description
An ellipse.
It has two positions, topLeft and bottomRight, which define the rect the ellipse will be drawn in.
Definition at line 6664 of file qcustomplot.h.
Member Enumeration Documentation
◆ AnchorIndex
|
protected |
Definition at line 6705 of file qcustomplot.h.
Constructor & Destructor Documentation
◆ QCPItemEllipse()
|
explicit |
Creates an ellipse item and sets default values.
The created item is automatically registered with parentPlot. This QCustomPlot instance takes ownership of the item, so do not delete it manually but use QCustomPlot::removeItem() instead.
Definition at line 29941 of file qcustomplot.cpp.
◆ ~QCPItemEllipse()
|
overridevirtual |
Definition at line 29964 of file qcustomplot.cpp.
Member Function Documentation
◆ anchorPixelPosition()
|
overrideprotectedvirtual |
Returns the pixel position of the anchor with Id anchorId. This function must be reimplemented in item subclasses if they want to provide anchors (QCPItemAnchor).
For example, if the item has two anchors with id 0 and 1, this function takes one of these anchor ids and returns the respective pixel points of the specified anchor.
- See also
- createAnchor
Reimplemented from QCPAbstractItem.
Definition at line 30067 of file qcustomplot.cpp.
◆ brush()
|
inline |
Definition at line 6680 of file qcustomplot.h.
◆ draw()
|
overrideprotectedvirtual |
Draws this item with the provided painter.
The cliprect of the provided painter is set to the rect returned by clipRect before this function is called. The clipRect depends on the clipping settings defined by setClipToAxisRect and setClipAxisRect.
Implements QCPAbstractItem.
Definition at line 30038 of file qcustomplot.cpp.
◆ mainBrush()
|
protected |
Returns the brush that should be used for drawing fills of the item. Returns mBrush when the item is not selected and mSelectedBrush when it is.
Definition at line 30102 of file qcustomplot.cpp.
◆ mainPen()
|
protected |
Returns the pen that should be used for drawing lines. Returns mPen when the item is not selected and mSelectedPen when it is.
Definition at line 30092 of file qcustomplot.cpp.
◆ pen()
|
inline |
Definition at line 6678 of file qcustomplot.h.
◆ selectedBrush()
|
inline |
Definition at line 6681 of file qcustomplot.h.
◆ selectedPen()
|
inline |
Definition at line 6679 of file qcustomplot.h.
◆ selectTest()
|
overridevirtual |
This function is used to decide whether a click hits a layerable object or not.
pos is a point in pixel coordinates on the QCustomPlot surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn't be determined, -1.0 is returned. Further, if onlySelectable is true and the object is not selectable, -1.0 is returned, too.
If the object is represented not by single lines but by an area like a QCPItemText or the bars of a QCPBars plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot's selection tolerance. (typically the selectionTolerance multiplied by 0.99).
Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.e. closer than 0.99*selectionTolerance).
The actual setting of the selection state is not done by this function. This is handled by the parent QCustomPlot when the mouseReleaseEvent occurs, and the finally selected object is notified via the selectEvent/ deselectEvent methods.
details is an optional output parameter. Every layerable subclass may place any information in details. This information will be passed to selectEvent when the parent QCustomPlot decides on the basis of this selectTest call, that the object was successfully selected. The subsequent call to selectEvent will carry the details. This is useful for multi-part objects (like QCPAxis). This way, a possibly complex calculation to decide which part was clicked is only done once in selectTest. The result (i.e. the actually clicked part) can then be placed in details. So in the subsequent selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation.
In the case of 1D Plottables (QCPAbstractPlottable1D, like QCPGraph or QCPBars) details will be set to a QCPDataSelection, describing the closest data point to pos.
You may pass nullptr
as details to indicate that you are not interested in those selection details.
- See also
- selectEvent, deselectEvent, mousePressEvent, wheelEvent, QCustomPlot::setInteractions, QCPAbstractPlottable1D::selectTestRect
Implements QCPAbstractItem.
Definition at line 30011 of file qcustomplot.cpp.
◆ setBrush()
Sets the brush that will be used to fill the ellipse. To disable filling, set brush to Qt::NoBrush.
- See also
- setSelectedBrush, setPen
Definition at line 29994 of file qcustomplot.cpp.
◆ setPen()
Sets the pen that will be used to draw the line of the ellipse
- See also
- setSelectedPen, setBrush
Definition at line 29973 of file qcustomplot.cpp.
◆ setSelectedBrush()
Sets the brush that will be used to fill the ellipse when selected. To disable filling, set brush to Qt::NoBrush.
- See also
- setBrush
Definition at line 30005 of file qcustomplot.cpp.
◆ setSelectedPen()
Sets the pen that will be used to draw the line of the ellipse when selected
- See also
- setPen, setSelected
Definition at line 29983 of file qcustomplot.cpp.
Member Data Documentation
◆ bottom
QCPItemAnchor* const QCPItemEllipse::bottom |
Definition at line 6699 of file qcustomplot.h.
◆ bottomLeftRim
QCPItemAnchor* const QCPItemEllipse::bottomLeftRim |
Definition at line 6700 of file qcustomplot.h.
◆ bottomRight
QCPItemPosition* const QCPItemEllipse::bottomRight |
Definition at line 6693 of file qcustomplot.h.
◆ bottomRightRim
QCPItemAnchor* const QCPItemEllipse::bottomRightRim |
Definition at line 6698 of file qcustomplot.h.
◆ center
QCPItemAnchor* const QCPItemEllipse::center |
Definition at line 6702 of file qcustomplot.h.
◆ left
QCPItemAnchor* const QCPItemEllipse::left |
Definition at line 6701 of file qcustomplot.h.
◆ mBrush
|
protected |
Definition at line 6709 of file qcustomplot.h.
◆ mPen
|
protected |
Definition at line 6708 of file qcustomplot.h.
◆ mSelectedBrush
|
protected |
Definition at line 6709 of file qcustomplot.h.
◆ mSelectedPen
|
protected |
Definition at line 6708 of file qcustomplot.h.
◆ right
QCPItemAnchor* const QCPItemEllipse::right |
Definition at line 6697 of file qcustomplot.h.
◆ top
QCPItemAnchor* const QCPItemEllipse::top |
Definition at line 6695 of file qcustomplot.h.
◆ topLeft
QCPItemPosition* const QCPItemEllipse::topLeft |
Definition at line 6692 of file qcustomplot.h.
◆ topLeftRim
QCPItemAnchor* const QCPItemEllipse::topLeftRim |
Definition at line 6694 of file qcustomplot.h.
◆ topRightRim
QCPItemAnchor* const QCPItemEllipse::topRightRim |
Definition at line 6696 of file qcustomplot.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:19:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.