chore(cpn): Upgrade to qcustomplot 2.1.1 (#4248)

This commit is contained in:
Neil Horne
2023-10-27 14:41:05 +10:00
committed by GitHub
parent 31fad8b1d4
commit b5f0ab373c
6 changed files with 23582 additions and 7350 deletions
+38 -29
View File
@@ -59,8 +59,11 @@ LogsDialog::LogsDialog(QWidget *parent) :
pen.setWidthF(1.0);
// create and prepare a plot title layout element
QCPPlotTitle *title = new QCPPlotTitle(ui->customPlot);
QCPTextElement *title = new QCPTextElement(ui->customPlot);
QFont titlefont = font();
titlefont.setBold(true);
title->setText(tr("Telemetry logs"));
title->setFont(titlefont);
// add it to the main plot layout
ui->customPlot->plotLayout()->insertRow(0);
@@ -69,11 +72,15 @@ LogsDialog::LogsDialog(QWidget *parent) :
ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables);
axisRect = ui->customPlot->axisRect();
// configure bottom axis to show time instead of number:
axisRect->axis(QCPAxis::atBottom)->setLabel(tr("Time (hh:mm:ss)"));
axisRect->axis(QCPAxis::atBottom)->setTickLabelType(QCPAxis::ltDateTime);
axisRect->axis(QCPAxis::atBottom)->setDateTimeFormat("hh:mm:ss");
QSharedPointer<QCPAxisTickerDateTime> timeTicker(new QCPAxisTickerDateTime);
timeTicker->setDateTimeFormat("hh:mm:ss");
axisRect->axis(QCPAxis::atBottom)->setTicker(timeTicker);
QDateTime now = QDateTime::currentDateTime();
axisRect->axis(QCPAxis::atBottom)->setRange(now.addSecs(-60*60*2).toTime_t(), now.toTime_t());
axisRect->axis(QCPAxis::atBottom)->setRange(now.addSecs(-60 * 60 * 2).toTime_t(), now.toTime_t());
axisRect->axis(QCPAxis::atLeft)->setTickLabels(false);
axisRect->addAxis(QCPAxis::atLeft);
axisRect->addAxis(QCPAxis::atRight);
@@ -103,22 +110,24 @@ LogsDialog::LogsDialog(QWidget *parent) :
ui->SaveSession_PB->setEnabled(false);
// connect slot that ties some axis selections together (especially opposite axes):
connect(ui->customPlot, SIGNAL(selectionChangedByUser()), this, SLOT(selectionChanged()));
connect(ui->customPlot, &QCustomPlot::selectionChangedByUser, this, &LogsDialog::selectionChanged);
// connect slots that takes care that when an axis is selected, only that direction can be dragged and zoomed:
connect(ui->customPlot, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(mousePress(QMouseEvent*)));
connect(ui->customPlot, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel()));
connect(ui->customPlot, &QCustomPlot::mousePress, this, &LogsDialog::mousePress);
connect(ui->customPlot, &QCustomPlot::mouseWheel, this, &LogsDialog::mouseWheel);
// make left axes transfer its range to right axes:
connect(axisRect->axis(QCPAxis::atLeft), SIGNAL(rangeChanged(QCPRange)), this, SLOT(yAxisChangeRanges(QCPRange)));
connect(axisRect->axis(QCPAxis::atLeft), static_cast<void(QCPAxis::*)(const QCPRange&)>(&QCPAxis::rangeChanged), this, &LogsDialog::yAxisChangeRanges);
// connect some interaction slots:
connect(ui->customPlot, SIGNAL(titleDoubleClick(QMouseEvent*, QCPPlotTitle*)), this, SLOT(titleDoubleClick(QMouseEvent*, QCPPlotTitle*)));
connect(ui->customPlot, SIGNAL(axisDoubleClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)), this, SLOT(axisLabelDoubleClick(QCPAxis*,QCPAxis::SelectablePart)));
connect(ui->customPlot, SIGNAL(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*)), this, SLOT(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*)));
connect(ui->FieldsTW, SIGNAL(itemSelectionChanged()), this, SLOT(plotLogs()));
connect(ui->logTable, SIGNAL(itemSelectionChanged()), this, SLOT(plotLogs()));
connect(ui->Reset_PB, SIGNAL(clicked()), this, SLOT(plotLogs()));
connect(ui->SaveSession_PB, SIGNAL(clicked()), this, SLOT(saveSession()));
connect(title, &QCPTextElement::doubleClicked, this, &LogsDialog::titleDoubleClicked);
connect(ui->customPlot, &QCustomPlot::axisDoubleClick, this, &LogsDialog::axisLabelDoubleClick);
connect(ui->customPlot, &QCustomPlot::legendDoubleClick, this, &LogsDialog::legendDoubleClick);
connect(ui->FieldsTW, &QTableWidget::itemSelectionChanged, this, &LogsDialog::plotLogs);
connect(ui->logTable, &QTableWidget::itemSelectionChanged, this, &LogsDialog::plotLogs);
connect(ui->Reset_PB, &QPushButton::clicked, this, &LogsDialog::plotLogs);
connect(ui->SaveSession_PB, &QPushButton::clicked, this, &LogsDialog::saveSession);
connect(ui->fileOpen_PB, &QPushButton::clicked, this, &LogsDialog::fileOpen);
connect(ui->mapsButton, &QPushButton::clicked, this, &LogsDialog::mapsButtonClicked);
connect(ui->sessions_CB, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &LogsDialog::sessionsCurrentIndexChanged);
}
LogsDialog::~LogsDialog()
@@ -126,14 +135,17 @@ LogsDialog::~LogsDialog()
delete ui;
}
void LogsDialog::titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title)
void LogsDialog::titleDoubleClicked(QMouseEvent *evt)
{
// Set the plot title by double clicking on it
bool ok;
QString newTitle = QInputDialog::getText(this, tr("Plot Title Change"), tr("New plot title:"), QLineEdit::Normal, title->text(), &ok);
if (ok) {
title->setText(newTitle);
ui->customPlot->replot();
QCPTextElement *title = qobject_cast<QCPTextElement*>(sender());
if (title) {
bool ok;
QString newTitle = QInputDialog::getText(this, tr("Plot Title Change"), tr("New plot title:"), QLineEdit::Normal, title->text(), &ok);
if (ok) {
title->setText(newTitle);
ui->customPlot->replot();
}
}
}
@@ -231,7 +243,7 @@ void LogsDialog::selectionChanged()
if (item == NULL) item = rightLegend->itemWithPlottable(graph);
if (item->selected() || graph->selected()) {
item->setSelected(true);
graph->setSelected(true);
graph->setSelection(QCPDataSelection(QCPDataRange()));
}
}
}
@@ -431,7 +443,7 @@ void LogsDialog::exportToGoogleEarth()
QProcess::startDetached(gePath, parameters);
}
void LogsDialog::on_mapsButton_clicked()
void LogsDialog::mapsButtonClicked()
{
ui->FieldsTW->setDisabled(true);
ui->logTable->setDisabled(true);
@@ -565,7 +577,7 @@ void LogsDialog::removeAllGraphs()
ui->labelCursors->setText("");
}
void LogsDialog::on_fileOpen_BT_clicked()
void LogsDialog::fileOpen()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select your log file"), g.logDir());
if (!fileName.isEmpty()) {
@@ -776,7 +788,7 @@ void LogsDialog::setFlightSessions()
}
}
void LogsDialog::on_sessions_CB_currentIndexChanged(int index)
void LogsDialog::sessionsCurrentIndexChanged(int index)
{
if (plotLock) return;
plotLock = true;
@@ -1126,7 +1138,6 @@ void LogsDialog::addMaxAltitudeMarker(const coords_t & c, QCPGraph * graph) {
// add max altitude marker
tracerMaxAlt = new QCPItemTracer(ui->customPlot);
ui->customPlot->addItem(tracerMaxAlt);
tracerMaxAlt->setGraph(graph);
tracerMaxAlt->setInterpolating(true);
tracerMaxAlt->setStyle(QCPItemTracer::tsSquare);
@@ -1153,7 +1164,6 @@ void LogsDialog::countNumberOfThrows(const coords_t & c, QCPGraph * graph)
void LogsDialog::addCursor(QCPItemTracer ** cursor, QCPGraph * graph, const QColor & color) {
QCPItemTracer * c = new QCPItemTracer(ui->customPlot);
ui->customPlot->addItem(c);
c->setGraph(graph);
c->setInterpolating(false);
c->setStyle(QCPItemTracer::tsCrosshair);
@@ -1168,7 +1178,6 @@ void LogsDialog::addCursor(QCPItemTracer ** cursor, QCPGraph * graph, const QCol
void LogsDialog::addCursorLine(QCPItemStraightLine ** line, QCPGraph * graph, const QColor & color) {
QCPItemStraightLine * l = new QCPItemStraightLine(ui->customPlot);
ui->customPlot->addItem(l);
l->point1->setParentAnchor(cursorA->position);
l->point2->setParentAnchor(cursorB->position);
QPen pen(color);
+5 -8
View File
@@ -18,8 +18,7 @@
* GNU General Public License for more details.
*/
#ifndef _LOGSDIALOG_H_
#define _LOGSDIALOG_H_
#pragma once
#include <QtCore>
#include <QDialog>
@@ -69,7 +68,7 @@ public:
~LogsDialog();
private slots:
void titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title);
void titleDoubleClicked(QMouseEvent *evt);
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
void selectionChanged();
@@ -77,10 +76,10 @@ private slots:
void mouseWheel();
void removeAllGraphs();
void plotLogs();
void on_fileOpen_BT_clicked();
void fileOpen();
void saveSession();
void on_sessions_CB_currentIndexChanged(int index);
void on_mapsButton_clicked();
void sessionsCurrentIndexChanged(int index);
void mapsButtonClicked();
void yAxisChangeRanges(QCPRange range);
private:
@@ -119,5 +118,3 @@ private:
};
#endif // _LOGSDIALOG_H_
+12 -3
View File
@@ -119,7 +119,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@@ -232,7 +241,7 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="fileOpen_BT">
<widget class="QPushButton" name="fileOpen_PB">
<property name="text">
<string>Open LogFile</string>
</property>
@@ -275,7 +284,7 @@
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderDefaultSectionSize">
<number>18</number>
<number>21</number>
</attribute>
<attribute name="verticalHeaderHighlightSections">
<bool>true</bool>
+213
View File
@@ -1,3 +1,216 @@
#### Version 2.1.1 released on 06.11.22 ####
Added features:
- Qt6.4 Compatibility
Bugfixes:
- dynamically changing device pixel ratios (e.g. when moving between different DPI screens) is handled properly
- bugfix Colormap autoscaling: recalculateDataBounds() if (0, 0) data point is NaN.
- minor bugfix in getMantissa for certain values due to rounding errors
- Graphs with line style lsImpulse properly ignore NaN data points
- fixed issue where QCP wasn't greyed out together with the rest of the UI on embedded systems when a modal dialog is shown
(QCustomPlot no longer has the Qt::WA_OpaquePaintEvent attribute enabled by default)
Other:
- in QCPAxisPainterPrivate::getTickLabelData, don't use fixed 'e', but locale aware character of parent plot locale
- Axis rescaling now ignores +/- Inf in data values
- slight performance improvements of QCPColorMap colorization and fills.
#### Version 2.1.0 released on 29.03.21 ####
Added features:
- Compatibility up to Qt 6.0
- Tech Preview: Radial Plots (see setupPolarPlotDemo in examples project)
- QCPAxisTickerDateTime can now be configured with a QTimeZone for adjusting the label display to arbitrary time zones
- QCPColorGradient (and thus also QCPColorMap) now has explicit configurable NaN handling (see QCPColorGradient::setNanHandling)
- added timing/benchmarking method QCustomPlot::replotTime(bool average) which returns the milliseconds per replot
- QCustomPlot::plottableAt has an optional output parameter dataIndex, providing the index of the data point at the probed position
- QCustomPlot::plottableAt<T> template method allows limiting the search to the specified QCPAbstractPlottable subclass T
- QCustomPlot::itemAt<T> template method allows limiting the search to the specified QCPAbstractItem subclass T
- Added Interaction flag QCP::iSelectPlottablesBeyondAxisRect, allows selection of data points very close to (and beyond of) the axes
- QCPAxisTickerDateTime::dateTimeToKey(QDate &) now also takes a TimeSpec to specify the interpretation of the start-of-day
- QCPAxisTickerLog now switches to linear ticks if zoomed in beyond where logarithmic ticks are reasonable
- Added QCustomPlot::afterLayout signal, for user code that crucially depends on layout sizes/positions, right before the draw step during a replot
Bugfixes:
- Fixed bug where QCPLayer::replot wouldn't issue full replot even though invalidated buffers existed
- Fixed QCPCurve bug causing rendering artifacts when using keys/values smaller than about 1e-12 in some constellations
- Fixed getValueRange when used with explicit keyRange, now doesn't use key range expanded by one point to each side anymore
- Fixed bug of QCPAxis tick label font size change only propagating to the layout after second call to replot
- Fixed bug of QCPTextElement not respecting the configured text alignment flag (setTextFlags)
- Various documentation typos and improvements
Other:
- QCP Now requires C++11. However, Qt4.6 compatibility is maintained in the QCP 2.x release series
- QCPColorScale is now initialized with gpCold gradient preset, which prevents color maps turning black when linking them to a default-created color scale without explicitly setting a gradient
- QCPLegend::clearItems is now faster in case of many legend items (>1000)
- Modernized expressions and thereby avoided some warnings (e.g. nullptr and casts)
- Switched to foreach (Qt macro) where possible (in preparation for switch to range-based for (C++11), soonest at next major release)
- Work around Qt bug, drawing lines with pen width 1 as slow as with pen widths > 1 (polyfill instead of line algorithm, also on Normal-DPI), by using pen width 0 in such cases.
- Added QCP::Interaction flag iNone=0x000 to allow explicitly specifying no interaction (Avoids QFlags::zero, which was deprecated in Qt5.14)
- QCP is now compatible with defines QT_USE_QSTRINGBUILDER, QT_USE_FAST_CONCATENATION (Qt<4.8), QT_USE_FAST_OPERATOR_PLUS (Qt<4.8)
#### Version 2.0.1 released on 25.06.18 ####
Bugfixes:
- Default filling order of QCPLayoutGrid is now foColumnsFirst instead of foRowsFirst, as intended and consistent with QCP1.
Note that this also changes the indexing order of e.g. QCustomPlot::axisRect(int index), compared with 2.0.0. You can change
the filling and thus indexing order yourself by calling QCPLayoutGrid::setFillOrder.
- fixed bug in QCPColorMap, when using alpha in the gradient color stops. Used to draw falsely black data points when the associated data value is exactly
on the first or last color stop.
- QCPDataSelection::enforceType(stDataRange) would erroneously add an empty data range to the selection, if the selection was already empty.
This in turn would cause isEmpty() to erroneously return false.
- fixed hypothetical crash when selectTest is called on a QCPItemCurve which has all of its points at the same position
Other:
- Various documentation improvements and clarifications
- Prevent conflict with windows.h min/max macros if user forgets to define NOMINMAX
- compiling QCP shared libraries with static Qt is now easier
- added defines QCUSTOMPLOT_VERSION and QCUSTOMPLOT_VERSION_STR (the same way Qt does) to provide the used QCP version number
- added missing Q_DECL_OVERRIDE declarations, thus preventing warnings some compiler settings
- QCPAxisTicker and subclasses are no longer copyable by value, as intended
- QCPBarsGroup constructor is now explicit, as intended
- Qt 5.11 compatibility
#### Version 2.0.0 released on 04.09.17 ####
Added major features:
- Axis tick and tick label generation was completely refactored and is now handled in the QCPAxisTicker class (also see QCPAxis::setTicker). Available ticker subclasses for special uses cases:
QCPAxisTicker, QCPAxisTickerFixed, QCPAxisTickerLog, QCPAxisTickerPi, QCPAxisTickerTime, QCPAxisTickerDateTime, QCPAxisTickerText
- Data container is now based on QCPDataContainer template for unified data interface and significantly improved memory footprint and better performance for common use-cases, especially data adding/removing.
- New data selection mechanism allows selection of single data points and data ranges for plottables. See special documentation page "data selection mechanism".
- Rubber band/selection rect for data point selection and axis zooming is now available, see documentation of QCustomPlot::setSelectionRectMode and QCPSelectionRect. For this purpose, the new default
layer "overlay" was introduced, which is now the top layer, and holds the QCustomPlot's QCPSelectionRect instance.
- Data sharing between plottables of the same type (see setData methods taking a QSharedPointer)
- OpenGL hardware acceleration is now available across all Qt versions (including Qt4) in a unified, simple interface, with QCustomPlot::setOpenGl (experimental)
- QCPStatisticalBox can now display a series of statistical boxes instead of only a single one
- New QCPErrorBars plottable allows attaching error bars to any one-dimensional plottable (QCPGraph has thus lost its own error-bar capability)
- QCPColorMap now supports transparency via alpha in its color gradient stops, and via a dedicated cell-wise alpha map (see QCPColorMapData::setAlpha)
- Layers may now be individually replotted (QCPLayer::replot), if the mode (QCPLayer::setMode) is set to lmBuffered. Mutually adjacent lmLogical layers share a single paint buffer to save resources.
By default, the new topmost "overlay" layer which contains the selection rect is an lmBuffered layer. Updating the selection rect is thus very fast, independent of the plot contents.
- QCPLayerable (and thus practically all objects in QCP) now have virtual methods to receive mouse press/move/release/doubleclick/wheel events. Before, only QCPLayoutElement provided them.
this makes it much easier to subclass e.g. items and plottables to provide custom mouse interactions that were cumbersome and awkward with the simpler signal-based interface
Added minor features:
- High-DPI support for Qt versions 5.0 and up, using device pixel ratio detected by Qt (can be changed manually via QCustomPlot::setBufferDevicePixelRatio).
- QCPGraph and QCPCurve can now be configured to only display every n'th scatter symbol, see ::setScatterSkip() method
- QCPFinancial allows to define bar width in absolute pixels and axis rect ratio, instead of only in plot key coordinates (see QCPFinancial::setWidthType)
- Range dragging/zooming can now be configured to affect more than one axis per orientation (see new overloads of QCPAxisRect::setRangeDragAxes/setRangeZoomAxes)
- Added QCPTextElement (replaces QCPPlotTitle) for general texts in layouts. Provides clicked and doubleClicked signals, as replacement for the removed QCustomPlot::titleClicked/titleDoubleClicked
- Export functions (QCustomPlot::savePng etc.) now support specifying the resolution that will be written to the image file header. This improves operability with other tools which respect metadata.
- Replots can now be queued to the next event loop iteration with replot(QCP::rpQueuedReplot). This way you can successively ask for a replot at multiple code locations without causing redundant replots
- QCPAxisRect::zoom(...) allows to zoom to a specific rectangular region given in pixel coordinates, either affecting all axes or a specified subset of axes.
- QCPRange::bounded returns a bounded range, trying to preserve its size. Works with rangeChanged signal to limit the allowed range (see rangeChanged doc)
- Plottable rescaleValueAxis method (and getValueRange) now take parameter inKeyRange, which allows rescaling of the value axis only with respect to data in the currently visible key range
- plottableClick and plottableDoubleClick signals now carry the clicked data point index as second parameter
- Added QCPAxis::scaleRange overload without "center" argument, which scales around the current axis range center
- Added QCPRange::expand/expanded overloads which take only one double parameter
- Plottables addToLegend/removeFromLegend methods now have overloads that take any QCPLegend, to make working with non-default legends easier (legends that are not QCustomPlot::legend)
- Added QCPStatisticalBox::setWhiskerAntialiased to allow controlling antialiasing state of whiskers independently of quartile box/median line
- The virtual method QCPLayoutElement::layoutChanged() now allows subclasses to react on a move of the layout element between logical positions in the parent layout, or between layouts
- QCPMarginGroup::commonMargin is now virtual, to facilitate subclassing of QCPMarginGroup
- QCPGraph::getPreparedData is now virtual, and thus allows subclasses to easily generate own plotted data, e.g. on-the-fly.
- Added QCPRange qDebug stream operator
- QCPLayoutGrid (and thus QCPLegend) can now wrap rows or columns at specified row/column counts, see setFillOrder, setWrap and the new addElement overload which doesn't have row/column index
Added minor features after beta:
- QCPGraph fill now renders separate fill segments when there are gaps in the graph data (created by inserting NaN values)
- fractional device pixel ratios are now used, if Qt version >= 5.6
- Axes may now be dragged/zoomed individually by starting the drag/zoom on top of the axis (previously, this required additional code)
- Manual minimum and maximum layout element sizes (setMinimumSize/setMaximumSize) can now affect the inner or the outer rect, see QCPLayoutElement::setSizeConstraintRect
Bugfixes [Also backported to 1.3.2]:
- Fixed possible crash when having a QCPGraph with scatters only and a non-transparent main/fill brush of the graph
- Fixed QCPItemPixmap not updating internally cached scaled pixmap if new pixmap set with same scaled dimensions
- When using log axis scale and zooming out as far as possible (~1e-280..1e280), axis doesn't end up in (via mouse) unrecoverable range with strange axis ticks anymore
- Axis tick label algorithm for beautifully typeset powers now checks whether "e" in tick label is actually part of a number before converting the exponent to superscript
- Fixed QCustomPlot::moveLayer performing incorrect move and possible crash in certain situations
- Fixed possible crash on QCustomPlot destruction due to wrong QObject-hierarchy. Only occurs if a QCPAxisRect is removed from the normal QCustomPlot destruction hierarchy by taking it out of its layout
- Fixed possible freeze when data values become infinity after coord-to-pixel transformation (e.g. maximally zoomed out log axis), and line style is not solid (e.g. dashed) or phFastPolylines is disabled
- Fixed a few missing enums in meta type system, by unifying usage of Q_ENUMS, Q_FLAGS and Q_DECLARE_METATYPE
Bugfixes [Not in 1.3.2]:
- Fixed QCPItemLine/QCPItemStraightLine not being selectable when defining coords are many orders of magnitude (>1e8) larger than currently viewed range
- Fixed/worked around crash due to bug in QPainter::drawPixmap with very large negative x/y pixel coordinates, when drawing sparse pixmap scatters
- Fixed possible (but unlikely) int overflow in adaptive sampling algorithm, that could cause plot artifacts when using extremely sparse data (with respect to current key axis range).
- Fixed QCPBarsGroup bug which caused stPlotCoords spacing to be wrong with vertical key axes
- A QCPBars axis rescale in the main window constructor (i.e. without well-defined plot size) now falls back to a datapoint-tight rescaling instead of doing nothing (because bar width can't be determined)
- Improved QCPBars stacking when using bars with very large keys and key separation at limit of double precision
Bugfixes after beta:
- fixed QCPCurve vertex optimization algorithm not handling log axes correctly
- upon removing the inner most axis, the offset of the new inner most axis (previously second axis) is now set to the value of the removed axis, instead of leaving a gap
- QCPColorMap now has a default gradient (gpCold) again, instead of an empty and thus black gradient
- doc: black QCPColorMap/QCPColorGradient documentation images fixed
- scatter styles ssDiamond, ssTriangle and ssTriangleInverted now get proper filling with the specified brush
- fixed click signals of plottable/axes/etc. not being emitted properly
- fixed uninitialized scatterSkip on QCPCurve, leading to irregular default appearance of scatter skips
- fixed device pixel ratio not being implemented correctly in cached tick labels
- QCPLayoutElement::setMaximum/setMinimum now is with respect to the inner rect as intended (and documented), instead of the outer rect (and this can now be changed via setSizeConstraintRect)
- fixed dllimport issue on template classes when compiling as shared library with MSVC
Summary of backward incompatible changes:
Plottable related:
- Removed QCustomPlot::addPlottable, not needed anymore as plottables now automatically register in their constructor
- Removed QCustomPlot::addItem, not needed anymore as items now automatically register in their constructor
- QCPAbstractPlottable::addToLegend/removeFromLegend are not virtual anymore. If your plottable requires a custom legend item, add it to the legend manually.
- setData/addData method overloads of plottables have changed to facilitate data sharing and new data container (see documentation)
- plottableClick and plottableDoubleClick signals now carry the clicked data point index as second parameter, and the QMouseEvent parameter has moved to third.
Check all your usages of those signals, because Qt's connect method only reports problems during runtime!
- setSelectable now not only limits what can be selected by the user, but limits also any programmatic selection changes via setSelected.
- enum QCPAbstractPlottable::SignDomain has changed namespace to QCP::SignDomain
Axis related:
- Removed QCPAxis::setAutoTicks, setAutoTickCount, setAutoTickLabels, setAutoTickStep, setAutoSubTicks, setTickLabelType, setDateTimeFormat, setDateTimeSpec,
setTickStep, setTickVector, setTickVectorLabels, setSubTickCount in favor of new QCPAxisTicker-based interface
- Added QCPAxis::setSubTicks to enable/disable subticks (manually controlling the subtick count needs subclassing of QCPAxisTicker, e.g. QCPAxisTickerText and QCPAxisTickerLog provide setSubTickCount)
Item related:
- Renamed QCPAbstractItem::rectSelectTest to rectDistance, to prevent confusion with new QCPAbstractPlottable1D::selectTestRect
- Renamed QCPItemAnchor::pixelPoint to QCPItemAnchor::pixelPosition (also affects subclass QCPItemPosition)
General:
- Renamed QCustomPlot::RefreshPriority enums (parameter of the replot() method): rpImmediate to rpImmediateRefresh, rpQueued to rpQueuedRefresh, rpHint to rpRefreshHint
- Renamed QCustomPlot::PlottingHint enum phForceRepaint to phImmediateRefresh
- Removed QCPPlotTitle layout element (See new QCPTextElement for almost drop-in replacement)
- Removed signals QCustomPlot::titleClicked/titleDoubleClicked, replaced by QCPTextElement signals clicked/doubleClicked.
- QCustomPlot::savePdf has changed parameters from (fileName, bool noCosmeticPen, width, height,...) to (fileName, width, height, QCP::ExportPen exportPen,...)
- Virtual methods QCPLayoutElement::mouseMoveEvent/mouseReleaseEvent (which are now introduced already in the superclass QCPLayerable) have gained an additional parameter const QPointF &startPos.
If you have reimplemented these methods, make sure to update your function signatures, otherwise your reimplementations will likely be ignored by the compiler without warning
- Creating a new QCPColorGradient without supplying a preset parameter in the constructor now creates an empty gradient, instead of loading the gpCold preset
Other:
- Replaced usage of Qt's QVector2D with own QCPVector2D which uses double precision and offers some convenience functions
- Extended relative range to which QCPItemLine/QCPItemStraightLine can be zoomed before vanishing from ~1e9 to ~1e16
- Removed QCPItemStraightLine::distToStraightLine (replaced by QCPVector2D::distanceToStraightLine)
- Removed QCPAbstractPlottable::distSqrToLine and QCPAbstractItem::distSqrToLine (replaced by QCPVector2D::distanceSquaredToLine)
- Qt5.5 compatibility (If you use PDF export, test your outputs, as output dimensions might change when switching Qt versions -- QCP does not try to emulate previous Qt version behaviour here)
- QCP now includes <QtPrintSupport/QtPrintSupport> instead of just <QtPrintSupport> because some users had problems with the latter. Please report if you now experience issues due to the new include.
- QCPGraph can now use a brush (filled polygon under the graph data) without having a graph line (line style lsNone)
- QCPFinancial is now two-colored (setTwoColored(true)) by default, and has green/red as default two-colored brushes and pens
- Plottable pixelsToCoords/coordsToPixels methods are now public, and offer transformations from pixel to plot coordinates and vice versa, using the plottable's axes
- Plottable getKeyRange/getValueRange methods are now public
- QCPBarsGroup now always places the QCPBars that was added to the group first towards lower keys, independent of axis orientation or direction (the ordering used to flip with axis orientation)
- Default focus policy for QCustomPlot is now Qt::ClickFocus, instead of Qt::NoFocus.
- tweaked QCPLegend and QCPAbstractLegendItem margins: The items have by default zero own margins, and QCPLegend row- and column spacing was increased to compensate. Legend was made slightly denser by default.
- Used doxygen version is now 1.8.12, and documentation/postprocessing-scripts were adapted accordingly. Expect minor issues and some warnings when using older doxygen.
Other after beta:
- Integrated OpenGL support (QCustomPlot::setOpenGl) is experimental for now, due the strong dependency on the system/graphics driver of the current implementation
- fixed some plot title font sizes in the example projects that were too small due to switch to QCPTextElement
- added missing override specifiers on reimplemented virtual methods
- changed to more intuitive defaults for QCPSelectionDecorator scatter style (now doesn't define an own scatter pen by default)
#### Version 1.3.2 released on 22.12.15 ####
Bugfixes [Backported from 2.0.0 branch]:
- Fixed possible crash when having a QCPGraph with scatters only and a non-transparent main/fill brush of the graph
- Fixed QCPItemPixmap not updating internally cached scaled pixmap if new pixmap set with same scaled dimensions
- When using log axis scale and zooming out as far as possible (~1e-280..1e280), axis doesn't end up in (via mouse) unrecoverable range with strange axis ticks anymore
- Axis tick label algorithm for beautifully typeset powers now checks whether "e" in tick label is actually part of a number before converting the exponent to superscript
- Fixed QCustomPlot::moveLayer performing incorrect move and possible crash in certain situations
- Fixed possible crash on QCustomPlot destruction due to wrong QObject-hierarchy. Only occurs if a QCPAxisRect is removed from the normal QCustomPlot destruction hierarchy by taking it out of its layout
- Fixed possible freeze when data values become infinity after coord-to-pixel transformation (e.g. maximally zoomed out log axis), and line style is not solid (e.g. dashed) or phFastPolylines is disabled
Other [Backported from 2.0.0 branch]:
- A few documentation fixes/improvements
- Qt5.5 compatibility (If you use PDF export, test your outputs, as output dimensions might change when switching Qt versions -- QCP does not try to emulate previous Qt version behaviour here)
- QCP now includes <QtPrintSupport/QtPrintSupport> instead of just <QtPrintSupport> because some users had problems with the latter. Please report if you now experience issues due to the new include.
#### Version 1.3.1 released on 25.04.15 ####
Bugfixes:
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff