! Constructs a QCustomPlot and sets reasonable default values. */
| 12846 | Constructs a QCustomPlot and sets reasonable default values. |
| 12847 | */ |
| 12848 | QCustomPlot::QCustomPlot(QWidget *parent) : |
| 12849 | QWidget(parent), |
| 12850 | xAxis(0), |
| 12851 | yAxis(0), |
| 12852 | xAxis2(0), |
| 12853 | yAxis2(0), |
| 12854 | legend(0), |
| 12855 | mBufferDevicePixelRatio(1.0), // will be adapted to primary screen below |
| 12856 | mPlotLayout(0), |
| 12857 | mAutoAddPlottableToLegend(true), |
| 12858 | mAntialiasedElements(QCP::aeNone), |
| 12859 | mNotAntialiasedElements(QCP::aeNone), |
| 12860 | mInteractions(0), |
| 12861 | mSelectionTolerance(8), |
| 12862 | mNoAntialiasingOnDrag(false), |
| 12863 | mBackgroundBrush(Qt::white, Qt::SolidPattern), |
| 12864 | mBackgroundScaled(true), |
| 12865 | mBackgroundScaledMode(Qt::KeepAspectRatioByExpanding), |
| 12866 | mCurrentLayer(0), |
| 12867 | mPlottingHints(QCP::phCacheLabels|QCP::phImmediateRefresh), |
| 12868 | mMultiSelectModifier(Qt::ControlModifier), |
| 12869 | mSelectionRectMode(QCP::srmNone), |
| 12870 | mSelectionRect(0), |
| 12871 | mOpenGl(false), |
| 12872 | mMouseHasMoved(false), |
| 12873 | mMouseEventLayerable(0), |
| 12874 | mMouseSignalLayerable(0), |
| 12875 | mReplotting(false), |
| 12876 | mReplotQueued(false), |
| 12877 | mOpenGlMultisamples(16), |
| 12878 | mOpenGlAntialiasedElementsBackup(QCP::aeNone), |
| 12879 | mOpenGlCacheLabelsBackup(true) |
| 12880 | { |
| 12881 | setAttribute(Qt::WA_NoMousePropagation); |
| 12882 | setAttribute(Qt::WA_OpaquePaintEvent); |
| 12883 | setFocusPolicy(Qt::ClickFocus); |
| 12884 | setMouseTracking(true); |
| 12885 | QLocale currentLocale = locale(); |
| 12886 | currentLocale.setNumberOptions(QLocale::OmitGroupSeparator); |
| 12887 | setLocale(currentLocale); |
| 12888 | #ifdef QCP_DEVICEPIXELRATIO_SUPPORTED |
| 12889 | # ifdef QCP_DEVICEPIXELRATIO_FLOAT |
| 12890 | setBufferDevicePixelRatio(QWidget::devicePixelRatioF()); |
| 12891 | # else |
| 12892 | setBufferDevicePixelRatio(QWidget::devicePixelRatio()); |
| 12893 | # endif |
| 12894 | #endif |
| 12895 | |
| 12896 | mOpenGlAntialiasedElementsBackup = mAntialiasedElements; |
| 12897 | mOpenGlCacheLabelsBackup = mPlottingHints.testFlag(QCP::phCacheLabels); |
| 12898 | // create initial layers: |
| 12899 | mLayers.append(new QCPLayer(this, QLatin1String("background"))); |
| 12900 | mLayers.append(new QCPLayer(this, QLatin1String("grid"))); |
| 12901 | mLayers.append(new QCPLayer(this, QLatin1String("main"))); |
| 12902 | mLayers.append(new QCPLayer(this, QLatin1String("axes"))); |
| 12903 | mLayers.append(new QCPLayer(this, QLatin1String("legend"))); |
| 12904 | mLayers.append(new QCPLayer(this, QLatin1String("overlay"))); |
| 12905 | updateLayerIndices(); |
nothing calls this directly
no test coverage detected