📄 qwt_plot.h
字号:
void setGridPen(const QPen &p); void setGridMajPen(const QPen &p); const QPen& gridMajPen() const; void setGridMinPen(const QPen &p); const QPen& gridMinPen() const; QwtPlotGrid &grid(); const QwtPlotGrid &grid() const; // Axes void setAxisAutoScale(int axis); bool axisAutoScale(int axis) const; void enableAxis(int axis, bool tf = TRUE); bool axisEnabled(int axis) const; void changeAxisOptions(int axis, int opt, bool value); void setAxisOptions(int axis, int opt); int axisOptions(int axis) const; void setAxisFont(int axis, const QFont &f); QFont axisFont(int axis) const; void setAxisMargins(int axis, double mlo, double mhi); bool axisMargins(int axis, double &mlo, double &mhi) const; void setAxisScale(int axis, double min, double max, double step = 0); void setAxisScaleDraw(int axis, QwtScaleDraw *); const QwtScaleDiv *axisScale(int axis) const; const QwtScaleDraw *axisScaleDraw(int axis) const; const QwtScale *axis(int axis) const; void setAxisLabelFormat(int axis, char f, int prec, int fieldwidth = 0); void axisLabelFormat(int axis, char &f, int &prec, int &fieldwidth) const; void setAxisLabelAlignment(int axis, int alignment); void setAxisLabelRotation(int axis, double rotation); void setAxisTitle(int axis, const QString &t); QString axisTitle(int axis) const; void setAxisTitleFont(int axis, const QFont &f); QFont axisTitleFont(int axis) const; void setAxisTitleAlignment(int axis, int align); int axisTitleAlignment(int axis) const; void setAxisMaxMinor(int axis, int maxMinor); int axisMaxMajor(int axis) const; void setAxisMaxMajor(int axis, int maxMajor); int axisMaxMinor(int axis) const; void setAxisReference(int axis, double value); double axisReference(int axis) const; // Markers long insertMarker(QwtPlotMarker *); long insertMarker(const QString &label = QString::null, int xAxis = xBottom, int yAxis = yLeft); long insertLineMarker(const QString &label, int axis); QwtPlotMarker *marker(long key); const QwtPlotMarker *marker(long key) const; bool removeMarker(long key); void removeMarkers(); long closestMarker(int xpos, int ypos, int &dist) const; QwtArray<long> markerKeys() const; bool setMarkerXAxis(long key, int axis); int markerXAxis(long key) const; bool setMarkerYAxis(long key, int axis); int markerYAxis(long key) const; bool setMarkerPos(long key, double xval, double yVal); bool setMarkerXPos(long key, double val); bool setMarkerYPos(long key, double val); void markerPos(long key, double &mx, double &my) const; bool setMarkerFont(long key, const QFont &f); QFont markerFont(long key) const; bool setMarkerPen(long key, const QPen &p); bool setMarkerLabel(long key, const QString &text, const QFont &font = QFont(), const QColor &color = QColor(), const QPen &pen = QPen(Qt::NoPen), const QBrush &brush = QBrush(Qt::NoBrush)); bool setMarkerLabelText(long key, const QString &text); const QString markerLabel(long key) const; bool setMarkerLabelAlign(long key, int align); int markerLabelAlign(long key) const; bool setMarkerLabelPen(long key, const QPen &p); QPen markerLabelPen(long key) const; bool setMarkerLinePen(long key, const QPen &p); QPen markerLinePen(long key) const; bool setMarkerLineStyle(long key, QwtMarker::LineStyle st); QwtMarker::LineStyle markerLineStyle(long key) const; bool setMarkerSymbol(long key, const QwtSymbol &s); QwtSymbol markerSymbol(long key) const; // Legend void setAutoLegend(bool enabled); bool autoLegend() const; void enableLegend(bool tf, long curveKey = -1); bool legendEnabled(long curveKey) const; void setLegendPos(int pos, double ratio = 0.0); int legendPos() const; void setLegendFont(const QFont &f); const QFont legendFont() const; void setLegendFrameStyle(int st); int legendFrameStyle() const; QwtLegend *legend(); const QwtLegend *legend() const; void setLegendDisplayPolicy( QwtLegend::LegendDisplayPolicy, int mode = -1); // Misc virtual QSize sizeHint() const; virtual QSize minimumSizeHint() const; virtual QSizePolicy sizePolicy() const; virtual bool event(QEvent *);public slots: virtual void replot();protected slots: virtual void lgdClicked();#ifndef QWT_NO_COMPATsignals: /*! A signal which is emitted when the mouse is pressed in the plot canvas. The coordinates are pixel values referring to the plot canvas. They can be translated using the canvasMaps. \param e Mouse event object \sa QwtPlot::canvasMap() */ void plotMousePressed(const QMouseEvent &e); /*! A signal which is emitted when a mouse button has been released in the plot canvas. The coordinates are pixel values referring to the plot canvas. They can be translated using the canvasMaps. \param e Mouse event object, event coordinates referring to the plot canvas \sa QwtPlot::canvasMap() */ void plotMouseReleased(const QMouseEvent &e); /*! A signal which is emitted when the mouse is moved in the plot canvas. The coordinates are pixel values referring to the plot canvas. They can be translated using the canvasMaps. \param e Mouse event object \sa QwtPlot::canvasMap() */ void plotMouseMoved(const QMouseEvent &e);#elseprivate: // needed for mocs #ifdef ignorance void plotMousePressed(const QMouseEvent &); void plotMouseReleased(const QMouseEvent &); void plotMouseMoved(const QMouseEvent &);#endif // !QWT_NO_COMPATsignals: /*! A signal which is emitted when legend()->isReadOnly() and the user has clicked on a legend item, \param key Key of the curve corresponding to the selected legend item \note To enable clicks legend()->setReadOnly(TRUE) has to be set before the items have been inserted. \sa QwtLegend::setReadOnly, QwtLegend::isReadOnly */ void legendClicked(long key);protected: void autoRefresh(); static bool axisValid(int axis); virtual void drawCanvas(QPainter *); virtual void drawCanvasItems(QPainter *, const QRect &, const QwtArray<QwtDiMap> &, const QwtPlotPrintFilter &) const; virtual void drawContents( QPainter* p ); virtual void updateTabOrder(); void updateAxes(); void updateLayout(); virtual void resizeEvent(QResizeEvent *e); virtual void insertLegendItem(long curveKey); virtual void updateLegendItem(long curveKey); virtual void printLegendItem(QPainter *, const QWidget *, const QRect &) const; void updateLegendItem(const QwtPlotCurve *, QwtLegendItem *); virtual void printTitle(QPainter *, const QRect &) const; virtual void printScale(QPainter *, int axis, int startDist, int endDist, int baseDist, const QRect &) const; virtual void printCanvas(QPainter *, const QRect &, const QwtArray<QwtDiMap> &, const QwtPlotPrintFilter &) const; virtual void printLegend(QPainter *, const QRect &) const;private: void initAxes(); long newCurveKey(); long newMarkerKey(); void initPlot(const QString &title = QString::null); QLabel *d_lblTitle; QwtPlotCanvas *d_canvas; QwtLegend *d_legend; QwtPlotLayout *d_layout; bool d_axisEnabled[axisCnt]; QwtScale *d_scale[axisCnt]; QwtAutoScale d_as[axisCnt]; QwtCurveDict *d_curves; QwtMarkerDict *d_markers; QwtPlotGrid *d_grid; bool d_autoReplot; bool d_autoLegend;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -