summaryrefslogtreecommitdiff
path: root/src/charts/ChartToolTip.h
blob: 88453a89f622bfb45ea71ffef3169722adbc4167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef CHART_TOOL_TIP_H
#define CHART_TOOL_TIP_H

#include <QtWidgets>

class ChartToolTip: public QGraphicsRectItem
{
public:
    ChartToolTip(const QPointF& pos, const QString& text);
    void paint(QPainter* painter,
        const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
    void adjustPos();

private:
    void drawFrame(QPainter* painter);
    void drawText(QPainter* painter);

private:
    static const QFont Font;

private:
    QString text;
    QTextDocument document;
};

#endif