File indexing completed on 2024-05-12 15:26:42

0001 /***************************************************************************
0002     File                 : DatapickerPointPrivate.h
0003     Project              : LabPlot
0004     Description          : Graphic Item for coordinate points of Datapicker
0005     --------------------------------------------------------------------
0006     Copyright            : (C) 2015 by Ankit Wagadre (wagadre.ankit@gmail.com)
0007  ***************************************************************************/
0008 /***************************************************************************
0009  *                                                                         *
0010  *  This program is free software; you can redistribute it and/or modify   *
0011  *  it under the terms of the GNU General Public License as published by   *
0012  *  the Free Software Foundation; either version 2 of the License, or      *
0013  *  (at your option) any later version.                                    *
0014  *                                                                         *
0015  *  This program is distributed in the hope that it will be useful,        *
0016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0018  *  GNU General Public License for more details.                           *
0019  *                                                                         *
0020  *   You should have received a copy of the GNU General Public License     *
0021  *   along with this program; if not, write to the Free Software           *
0022  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0023  *   Boston, MA  02110-1301  USA                                           *
0024  *                                                                         *
0025  ***************************************************************************/
0026 
0027 
0028 #ifndef DATAPICKERPOINTPRIVATE_H
0029 #define DATAPICKERPOINTPRIVATE_H
0030 
0031 class QGraphicsItem;
0032 
0033 class DatapickerPointPrivate: public QGraphicsItem {
0034 public:
0035     explicit DatapickerPointPrivate(DatapickerPoint*);
0036 
0037     QString name() const;
0038     void retransform();
0039     virtual void recalcShapeAndBoundingRect();
0040     void updatePoint();
0041     void updatePropeties();
0042     void retransformErrorBar();
0043 
0044     bool m_printing{false};
0045     qreal rotationAngle;
0046     QPointF position;
0047     QRectF boundingRectangle;
0048     QRectF transformedBoundingRectangle;
0049     Symbol::Style pointStyle;
0050     QBrush brush;
0051     QPen pen;
0052     qreal opacity;
0053     qreal size;
0054     QPainterPath itemShape;
0055 
0056     QPointF plusDeltaXPos;
0057     QPointF minusDeltaXPos;
0058     QPointF plusDeltaYPos;
0059     QPointF minusDeltaYPos;
0060     QBrush errorBarBrush;
0061     QPen errorBarPen;
0062     qreal errorBarSize;
0063 
0064     //reimplemented from QGraphicsItem
0065     QRectF boundingRect() const override;
0066     QPainterPath shape() const override;
0067     void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* widget = nullptr) override;
0068 
0069     DatapickerPoint* const q;
0070 
0071 private:
0072     void contextMenuEvent(QGraphicsSceneContextMenuEvent*) override;
0073     void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
0074     void hoverEnterEvent(QGraphicsSceneHoverEvent*) override;
0075     void hoverLeaveEvent(QGraphicsSceneHoverEvent*) override;
0076 };
0077 
0078 #endif