MCPcopy Create free account
hub / github.com/ZhuYanzhen1/miniFOC / QCustomPlot

Method QCustomPlot

tools/qcustomplot.cpp:13593–13690  ·  view source on GitHub ↗

! Constructs a QCustomPlot and sets reasonable default values. */

Source from the content-addressed store, hash-verified

13591 Constructs a QCustomPlot and sets reasonable default values.
13592*/
13593QCustomPlot::QCustomPlot(QWidget *parent) :
13594 QWidget(parent),
13595 xAxis(nullptr),
13596 yAxis(nullptr),
13597 xAxis2(nullptr),
13598 yAxis2(nullptr),
13599 legend(nullptr),
13600 mBufferDevicePixelRatio(1.0), // will be adapted to primary screen below
13601 mPlotLayout(nullptr),
13602 mAutoAddPlottableToLegend(true),
13603 mAntialiasedElements(QCP::aeNone),
13604 mNotAntialiasedElements(QCP::aeNone),
13605 mInteractions(QCP::iNone),
13606 mSelectionTolerance(8),
13607 mNoAntialiasingOnDrag(false),
13608 mBackgroundBrush(Qt::white, Qt::SolidPattern),
13609 mBackgroundScaled(true),
13610 mBackgroundScaledMode(Qt::KeepAspectRatioByExpanding),
13611 mCurrentLayer(nullptr),
13612 mPlottingHints(QCP::phCacheLabels|QCP::phImmediateRefresh),
13613 mMultiSelectModifier(Qt::ControlModifier),
13614 mSelectionRectMode(QCP::srmNone),
13615 mSelectionRect(nullptr),
13616 mOpenGl(false),
13617 mMouseHasMoved(false),
13618 mMouseEventLayerable(nullptr),
13619 mMouseSignalLayerable(nullptr),
13620 mReplotting(false),
13621 mReplotQueued(false),
13622 mReplotTime(0),
13623 mReplotTimeAverage(0),
13624 mOpenGlMultisamples(16),
13625 mOpenGlAntialiasedElementsBackup(QCP::aeNone),
13626 mOpenGlCacheLabelsBackup(true)
13627{
13628 setAttribute(Qt::WA_NoMousePropagation);
13629 setAttribute(Qt::WA_OpaquePaintEvent);
13630 setFocusPolicy(Qt::ClickFocus);
13631 setMouseTracking(true);
13632 QLocale currentLocale = locale();
13633 currentLocale.setNumberOptions(QLocale::OmitGroupSeparator);
13634 setLocale(currentLocale);
13635#ifdef QCP_DEVICEPIXELRATIO_SUPPORTED
13636# ifdef QCP_DEVICEPIXELRATIO_FLOAT
13637 setBufferDevicePixelRatio(QWidget::devicePixelRatioF());
13638# else
13639 setBufferDevicePixelRatio(QWidget::devicePixelRatio());
13640# endif
13641#endif
13642
13643 mOpenGlAntialiasedElementsBackup = mAntialiasedElements;
13644 mOpenGlCacheLabelsBackup = mPlottingHints.testFlag(QCP::phCacheLabels);
13645 // create initial layers:
13646 mLayers.append(new QCPLayer(this, QLatin1String("background")));
13647 mLayers.append(new QCPLayer(this, QLatin1String("grid")));
13648 mLayers.append(new QCPLayer(this, QLatin1String("main")));
13649 mLayers.append(new QCPLayer(this, QLatin1String("axes")));
13650 mLayers.append(new QCPLayer(this, QLatin1String("legend")));

Callers

nothing calls this directly

Calls 10

devicePixelRatioFunction · 0.85
rectFunction · 0.85
appendMethod · 0.80
setModeMethod · 0.80
initializeParentPlotMethod · 0.80
setLayerMethod · 0.80
addElementMethod · 0.80
axisMethod · 0.80
setVisibleMethod · 0.80
setMarginsMethod · 0.80

Tested by

no test coverage detected