QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 槽 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
QwtPlotGLCanvas类 参考

An alternative canvas for a QwtPlot derived from QGLWidget 更多...

#include <qwt_plot_glcanvas.h>

类 QwtPlotGLCanvas 继承关系图:
QwtPlotAbstractGLCanvas QwtPlotAbstractCanvas

class  PrivateData
 

Public 槽

void replot ()
 Replot the canvas
 

Public 成员函数

 QwtPlotGLCanvas (QwtPlot *=nullptr)
 Constructor
 
 QwtPlotGLCanvas (const QGLFormat &, QwtPlot *=nullptr)
 Constructor with QGLFormat
 
 ~QwtPlotGLCanvas () override
 Destructor
 
virtual Q_INVOKABLE void invalidateBackingStore () override
 Invalidate the backing store
 
Q_INVOKABLE QPainterPath borderPath (const QRect &) const
 Get the border path
 
virtual bool event (QEvent *) override
 Handle events
 
- Public 成员函数 继承自 QwtPlotAbstractGLCanvas
 QwtPlotAbstractGLCanvas (QWidget *canvasWidget)
 Paint attributes
 
void setPaintAttribute (PaintAttribute, bool on=true)
 Changing the paint attributes
 
bool testPaintAttribute (PaintAttribute) const
 Test whether a paint attribute is enabled
 
void setFrameStyle (int style)
 Set the frame style
 
int frameStyle () const
 Get the frame style
 
void setFrameShadow (QFrame::Shadow)
 Set the frame shadow
 
QFrame::Shadow frameShadow () const
 Get the frame shadow
 
void setFrameShape (QFrame::Shape)
 Set the frame shape
 
QFrame::Shape frameShape () const
 Get the frame shape
 
void setLineWidth (int)
 Set the frame line width
 
int lineWidth () const
 Get the line width of the frame
 
void setMidLineWidth (int)
 Set the frame mid line width
 
int midLineWidth () const
 Get the midline width of the frame
 
int frameWidth () const
 Get the frame width depending on the style, line width and midline width
 
QRect frameRect () const
 Get the rectangle where the frame is drawn in
 
- Public 成员函数 继承自 QwtPlotAbstractCanvas
 QwtPlotAbstractCanvas (QWidget *canvasWidget)
 Constructor
 
QwtPlotplot ()
 Return parent plot widget
 
const QwtPlotplot () const
 Return parent plot widget
 
void setFocusIndicator (FocusIndicator)
 Set the focus indicator
 
FocusIndicator focusIndicator () const
 Get the focus indicator
 
void setBorderRadius (double)
 Set the radius for the corners of the border frame
 
double borderRadius () const
 Get the radius for the corners of the border frame
 

Protected 成员函数

virtual void paintEvent (QPaintEvent *) override
 Paint event handler
 
virtual void initializeGL () override
 Initialize OpenGL
 
virtual void paintGL () override
 Paint OpenGL scene
 
virtual void resizeGL (int width, int height) override
 Resize OpenGL view
 
- Protected 成员函数 继承自 QwtPlotAbstractGLCanvas
void replot ()
 Invalidate the paint cache and repaint the canvas
 
void draw (QPainter *)
 Helper function for the derived plot canvas
 
- Protected 成员函数 继承自 QwtPlotAbstractCanvas
QWidget * canvasWidget ()
 
const QWidget * canvasWidget () const
 
virtual void drawFocusIndicator (QPainter *)
 Draw the focus indication
 
virtual void drawBorder (QPainter *)
 Draw the border of the canvas
 
virtual void drawBackground (QPainter *)
 Helper function for the derived plot canvas
 
void fillBackground (QPainter *)
 Helper function for the derived plot canvas
 
void drawCanvas (QPainter *)
 Draw the plot to the canvas
 
void drawStyled (QPainter *, bool)
 Helper function for the derived plot canvas
 
void drawUnstyled (QPainter *)
 Helper function for the derived plot canvas
 
QPainterPath canvasBorderPath (const QRect &rect) const
 
void updateStyleSheetInfo ()
 Update the cached information about the current style sheet
 

属性

QFrame::Shadow frameShadow
 
QFrame::Shape frameShape
 
int lineWidth
 
int midLineWidth
 
int frameWidth
 
QRect frameRect
 
double borderRadius
 

额外继承的成员函数

- Public 类型 继承自 QwtPlotAbstractGLCanvas
enum  PaintAttribute { BackingStore = 1 , ImmediatePaint = 8 }
 Paint attributes 更多...
 
- Public 类型 继承自 QwtPlotAbstractCanvas
enum  FocusIndicator { NoFocusIndicator , CanvasFocusIndicator , ItemFocusIndicator }
 Focus indicator 更多...
 

详细描述

An alternative canvas for a QwtPlot derived from QGLWidget

QwtPlotGLCanvas implements the very basics to act as canvas inside of a QwtPlot widget. It might be extended to a full featured alternative to QwtPlotCanvas in a future version of Qwt.

Even if QwtPlotGLCanvas is not derived from QFrame it imitates its API. When using style sheets it supports the box model - beside backgrounds with rounded borders.

Since Qt 5.4 QOpenGLWidget is available, that is used by QwtPlotOpenGLCanvas.

参见
QwtPlot::setCanvas(), QwtPlotCanvas, QwtPlotOpenGLCanvas
注解
With Qt4 you might want to use the QPaintEngine::OpenGL paint engine ( see QGL::setPreferredPaintEngine() ). On a Linux test system QPaintEngine::OpenGL2 shows very basic problems like translated geometries.
Another way for getting hardware accelerated graphics is using an OpenGL offscreen buffer ( QwtPlotCanvas::OpenGLBuffer ) with QwtPlotCanvas. Performance is worse, than rendering straight to a QGLWidget, but is usually better integrated into a desktop application.

构造及析构函数说明

◆ QwtPlotGLCanvas()

QwtPlotGLCanvas::QwtPlotGLCanvas ( QwtPlot plot = nullptr)
explicit

Constructor

参数
[in]plotParent plot widget
参见
QwtPlot::setCanvas()

Constructor

参数
[in]formatOpenGL rendering options
[in]plotParent plot widget
参见
QwtPlot::setCanvas()

Destructor

成员函数说明

◆ borderPath()

QPainterPath QwtPlotGLCanvas::borderPath ( const QRect &  rect) const

Get the border path

Calculate the painter path for a styled or rounded border

When the canvas has no styled background or rounded borders the painter path is empty.

参数
[in]rectBounding rectangle of the canvas
返回
Painter path, that can be used for clipping

◆ event()

bool QwtPlotGLCanvas::event ( QEvent *  event)
overridevirtual

Handle events

Qt event handler for QEvent::PolishRequest and QEvent::StyleChange

参数
[in]eventQt Event
返回
See QGLWidget::event()

◆ initializeGL()

void QwtPlotGLCanvas::initializeGL ( )
overrideprotectedvirtual

Initialize OpenGL

No operation - reserved for some potential use in the future

◆ invalidateBackingStore()

void QwtPlotGLCanvas::invalidateBackingStore ( )
overridevirtual

Invalidate the backing store

Invalidate the internal backing store

实现了 QwtPlotAbstractGLCanvas.

◆ paintEvent()

void QwtPlotGLCanvas::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Paint event handler

Paint event

参数
eventPaint event
参见
QwtPlot::drawCanvas()

◆ paintGL()

void QwtPlotGLCanvas::paintGL ( )
overrideprotectedvirtual

Paint OpenGL scene

Paint the plot

◆ replot

void QwtPlotGLCanvas::replot ( )
slot

Replot the canvas

Invalidate the paint cache and repaint the canvas

参见
invalidatePaintCache()

◆ resizeGL()

void QwtPlotGLCanvas::resizeGL ( int  width,
int  height 
)
overrideprotectedvirtual

Resize OpenGL view

No operation - reserved for some potential use in the future


该类的文档由以下文件生成: