QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_styling.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_PLOT_STYLING_H
11#define QWT_PLOT_STYLING_H
12
13#include "qwt_global.h"
14#include "qwt_symbol.h"
15
16#include <qbrush.h>
17#include <qcolor.h>
18#include <qpen.h>
19#include <qsize.h>
20
21class QwtPlot;
22class QwtPlotItem;
23class QwtPlotCurve;
24
49class QWT_EXPORT QwtPlotStyling
50{
51public:
52 // ---- Color ----
53
54 // Get the representative color of a plot item
55 static QColor color(const QwtPlotItem* item, const QColor& defaultColor = QColor());
56
57 // Set the color of a plot item (dispatches to pen or brush)
58 static bool setColor(QwtPlotItem* item, const QColor& color);
59
60 // ---- Pen ----
61
62 // Get the pen of a plot item
63 static QPen pen(const QwtPlotItem* item);
64
65 // Set the pen of a plot item
66 static bool setPen(QwtPlotItem* item, const QPen& pen);
67
68 // ---- Brush ----
69
70 // Get the brush of a plot item
71 static QBrush brush(const QwtPlotItem* item);
72
73 // Set the brush of a plot item
74 static bool setBrush(QwtPlotItem* item, const QBrush& brush);
75
76 // ---- Curve symbol ----
77
78 // Set a symbol on a curve with style and size
79 static void setSymbol(QwtPlotCurve* curve, QwtSymbol::Style style, const QSize& size = QSize(8, 8));
80
81 // Set a symbol on a curve with style, color and size
82 static void setSymbol(QwtPlotCurve* curve, QwtSymbol::Style style, const QColor& color, const QSize& size = QSize(8, 8));
83
84 // ---- Curve line style ----
85
86 // Set curve line pen style and width
87 static void setLineStyle(QwtPlotCurve* curve, Qt::PenStyle style, qreal width = 0.0);
88
89 // ---- Recommended values ----
90
91 // Recommend a pen width based on the number of data points
92 static qreal recommendPenWidth(int pointCount);
93
94 // ---- Force replot ----
95
96 // Force an immediate replot even when autoReplot is disabled
97 static void forceReplot(QwtPlot* plot);
98};
99
100#endif // QWT_PLOT_STYLING_H
A plot item, that represents a series of points
Definition qwt_plot_curve.h:75
Base class for items on the plot canvas
Definition qwt_plot_item.h:85
Utility class for reading and writing visual style properties of QwtPlotItem
Definition qwt_plot_styling.h:50
A 2-D plotting widget
Definition qwt_plot.h:99
Style
Symbol Style
Definition qwt_symbol.h:58