fixed some compile errors in example

This commit is contained in:
Jan W. Krieger 2019-04-27 22:53:01 +02:00
parent 3dc56510e9
commit fcc8122d75
3 changed files with 13 additions and 6 deletions

View File

@ -63,7 +63,7 @@ This texture-filled graph is overlayn by a graph filled with a color gradient th
linearGrad.setColorAt(0.3, c2);
linearGrad.setColorAt(0.7, c3);
linearGrad.setColorAt(1, c4);
linearGrad.setCoordinateMode(QGradient::ObjectMode);
linearGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
// use this CoordinateMode, so the gradient fills the whole graph area
graphF2->setFillGradient(linearGrad);
```
@ -85,7 +85,7 @@ Finally two vertical barcharts with different filling options are added:
cl12.setAlphaF(0.5);
linearG.setColorAt(0, cl11);
linearG.setColorAt(1, cl12);
linearG.setCoordinateMode(QGradient::ObjectMode);
linearG.setCoordinateMode(QGradient::ObjectBoundingMode);
graphBF->setFillGradient(linearG);
graphBF->setLineColor(Qt::transparent);
```
@ -97,7 +97,7 @@ In addition to the graph background properties, also the plot/widget/key backgro
QLinearGradient backGrad(QPointF(0, 0), QPointF(1, 1));
backGrad.setColorAt(0, QColor("salmon"));
backGrad.setColorAt(1, QColor("white"));
backGrad.setCoordinateMode(QGradient::ObjectMode);
backGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
plot.getPlotter()->setPlotBackgroundGradient(backGrad);
```

View File

@ -109,7 +109,7 @@ int main(int argc, char* argv[])
linearGrad.setColorAt(0.3, c2);
linearGrad.setColorAt(0.7, c3);
linearGrad.setColorAt(1, c4);
linearGrad.setCoordinateMode(QGradient::ObjectMode);
linearGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
// use this CoordinateMode, so the gradient fills the whole graph area
graphF2->setFillGradient(linearGrad);
@ -124,7 +124,7 @@ int main(int argc, char* argv[])
cl12.setAlphaF(0.5);
linearG.setColorAt(0, cl11);
linearG.setColorAt(1, cl12);
linearG.setCoordinateMode(QGradient::ObjectMode);
linearG.setCoordinateMode(QGradient::ObjectBoundingMode);
graphBF->setFillGradient(linearG);
graphBF->setLineColor(Qt::transparent);
@ -142,7 +142,7 @@ int main(int argc, char* argv[])
QLinearGradient backGrad(QPointF(0, 0), QPointF(1, 1));
backGrad.setColorAt(0, QColor("salmon"));
backGrad.setColorAt(1, QColor("white"));
backGrad.setCoordinateMode(QGradient::ObjectMode);
backGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
plot.getPlotter()->setPlotBackgroundGradient(backGrad);
// 8. set axis labels

View File

@ -23,6 +23,13 @@ CONFIG (debug, debug|release) {
message("LIBS = $$LIBS")
win32-msvc* {
# To enable M_PI, M_E,...
DEFINES += _USE_MATH_DEFINES
# To fix error: C2338: va_start argument must not
# have reference type and must not be parenthesized
DEFINES += _CRT_NO_VA_START_VALIDATION
}