@@ -1,4 +1,5 | |||
|
1 | 1 | #include "chartbackground_p.h" |
|
2 | #include "qchartversion_p.h" | |
|
2 | 3 | #include <QPen> |
|
3 | 4 | #include <QBrush> |
|
4 | 5 | #include <QPainter> |
@@ -8,7 +9,10 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||
|
8 | 9 | ChartBackground::ChartBackground(QGraphicsItem* parent):QGraphicsRectItem(parent), |
|
9 | 10 | m_diameter(15) |
|
10 | 11 | { |
|
11 | ||
|
12 | #ifndef QT_NO_DEBUG | |
|
13 | qDebug()<<"buildTime" <<buildTime; | |
|
14 | qDebug()<<"gitHead" << gitHead; | |
|
15 | #endif | |
|
12 | 16 | } |
|
13 | 17 | |
|
14 | 18 | ChartBackground::~ChartBackground() |
@@ -20,9 +24,19 void ChartBackground::paint(QPainter *painter, const QStyleOptionGraphicsItem *o | |||
|
20 | 24 | { |
|
21 | 25 | Q_UNUSED(option); |
|
22 | 26 | Q_UNUSED(widget); |
|
27 | painter->save(); | |
|
23 | 28 | painter->setPen(pen()); |
|
24 | 29 | painter->setBrush(brush()); |
|
25 | 30 | painter->drawRoundRect(rect(),roundness(rect().width()),roundness(rect().height())); |
|
31 | #ifndef QT_NO_DEBUG | |
|
32 | painter->setPen(Qt::black); | |
|
33 | QFont font; | |
|
34 | QString build("build %1"); | |
|
35 | font.setPointSize(6); | |
|
36 | painter->setFont(font); | |
|
37 | painter->drawText(rect().bottomLeft(),build.arg(buildTime)); | |
|
38 | #endif | |
|
39 | painter->restore(); | |
|
26 | 40 | } |
|
27 | 41 | |
|
28 | 42 | int ChartBackground::roundness(qreal size) const |
@@ -6,7 +6,6 | |||
|
6 | 6 | #include "chartbackground_p.h" |
|
7 | 7 | #include <QGraphicsScene> |
|
8 | 8 | #include <QGraphicsSceneResizeEvent> |
|
9 | #include <QDebug> | |
|
10 | 9 | |
|
11 | 10 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
12 | 11 |
@@ -121,11 +121,21 install_build_private_headers.CONFIG += target_predeps \ | |||
|
121 | 121 | QMAKE_EXTRA_COMPILERS += install_build_public_headers \ |
|
122 | 122 | install_build_private_headers \ |
|
123 | 123 | |
|
124 | ||
|
124 | 125 | chartversion.target = qchartversion_p.h |
|
125 | chartversion.commands = @echo \ | |
|
126 | "build_time" \ | |
|
127 | > \ | |
|
128 | $$chartversion.target; | |
|
126 | unix:{ | |
|
127 | chartversion.commands = @echo \ | |
|
128 | "const char *buildTime = \\\"`date +'%y%m%d%H%M'`\\\" \\; \ | |
|
129 | const char *gitHead = \\\"`git rev-parse HEAD`\\\" \\; " \ | |
|
130 | > \ | |
|
131 | $$chartversion.target; | |
|
132 | }else{ | |
|
133 | chartversion.commands = @echo \ | |
|
134 | "const char *buildTime = \"%date%_%time%\" ; \ | |
|
135 | const char *gitHead = \"unknown\" ; " \ | |
|
136 | > \ | |
|
137 | $$chartversion.target | |
|
138 | } | |
|
129 | 139 | chartversion.depends = $$HEADERS \ |
|
130 | 140 | $$SOURCES |
|
131 | 141 | PRE_TARGETDEPS += qchartversion_p.h |
General Comments 0
You need to be logged in to leave comments.
Login now