Classes | Public Types | Public Slots | Public Member Functions | Protected Member Functions | Properties | Private Attributes
QwtPlotGLCanvas Class Reference

An alternative canvas for a QwtPlot derived from QGLWidget. More...

#include <qwt_plot_glcanvas.h>

List of all members.

Classes

class  PrivateData

Public Types

enum  Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken }
 Frame shadow. More...
enum  Shape { NoFrame = QFrame::NoFrame, Box = QFrame::Box, Panel = QFrame::Panel }
 Frame shape. More...

Public Slots

void replot ()
 Calls repaint()

Public Member Functions

Q_INVOKABLE QPainterPath borderPath (const QRect &) const
virtual bool event (QEvent *)
QRect frameRect () const
Shadow frameShadow () const
Shape frameShape () const
int frameStyle () const
int frameWidth () const
int lineWidth () const
int midLineWidth () const
 QwtPlotGLCanvas (QwtPlot *=NULL)
 Constructor.
void setFrameShadow (Shadow)
void setFrameShape (Shape)
void setFrameStyle (int style)
void setLineWidth (int)
void setMidLineWidth (int)
virtual ~QwtPlotGLCanvas ()
 Destructor.

Protected Member Functions

virtual void drawBackground (QPainter *)
virtual void drawBorder (QPainter *)
virtual void drawItems (QPainter *)
virtual void paintEvent (QPaintEvent *)

Properties

QRect frameRect
Shadow frameShadow
Shape frameShape
int frameWidth
int lineWidth
int midLineWidth

Private Attributes

PrivateDatad_data

Detailed Description

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.

See also:
QwtPlot::setCanvas(), QwtPlotCanvas
Note:
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.

Definition at line 37 of file qwt_plot_glcanvas.h.


Member Enumeration Documentation

Frame shadow.

Unfortunately it is not possible to use QFrame::Shadow as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.

Enumerator:
Plain 

QFrame::Plain.

Raised 

QFrame::Raised.

Sunken 

QFrame::Sunken.

Definition at line 59 of file qwt_plot_glcanvas.h.

Frame shape.

Unfortunately it is not possible to use QFrame::Shape as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.

Note:
QFrame::StyledPanel and QFrame::WinPanel are unsuported and will be displayed as QFrame::Panel.
Enumerator:
NoFrame 
Box 
Panel 

Definition at line 82 of file qwt_plot_glcanvas.h.


Constructor & Destructor Documentation

QwtPlotGLCanvas::QwtPlotGLCanvas ( QwtPlot plot = NULL) [explicit]

Constructor.

Parameters:
plotParent plot widget
See also:
QwtPlot::setCanvas()

Definition at line 74 of file qwt_plot_glcanvas.cpp.

Destructor.

Definition at line 88 of file qwt_plot_glcanvas.cpp.


Member Function Documentation

QPainterPath QwtPlotGLCanvas::borderPath ( const QRect &  rect) const
Returns:
Empty path

Definition at line 366 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::drawBackground ( QPainter *  painter) [protected, virtual]

Draw the background of the canvas

Parameters:
painterPainter

Definition at line 299 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::drawBorder ( QPainter *  painter) [protected, virtual]

Draw the border of the canvas

Parameters:
painterPainter

Definition at line 331 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::drawItems ( QPainter *  painter) [protected, virtual]

Draw the plot items

Parameters:
painterPainter
See also:
QwtPlot::drawCanvas()

Definition at line 282 of file qwt_plot_glcanvas.cpp.

bool QwtPlotGLCanvas::event ( QEvent *  event) [virtual]

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

Parameters:
eventQt Event
Returns:
See QGLWidget::event()

Definition at line 259 of file qwt_plot_glcanvas.cpp.

QRect QwtPlotGLCanvas::frameRect ( ) const
Returns:
The bitwise OR between a frameShape() and a frameShadow()
See also:
setFrameStyle(), QFrame::frameStyle()

Definition at line 116 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::paintEvent ( QPaintEvent *  event) [protected, virtual]

Paint event

Parameters:
eventPaint event
See also:
QwtPlot::drawCanvas()

Definition at line 231 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::replot ( ) [slot]

Calls repaint()

Definition at line 358 of file qwt_plot_glcanvas.cpp.

Set the frame shadow

Parameters:
shadowFrame shadow
See also:
frameShadow(), setFrameShape(), QFrame::setFrameShadow()

Definition at line 127 of file qwt_plot_glcanvas.cpp.

Set the frame shape

Parameters:
shapeFrame shape
See also:
frameShape(), setFrameShadow(), QFrame::frameShape()

Definition at line 147 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::setFrameStyle ( int  style)

Set the frame style

Parameters:
styleThe bitwise OR between a shape and a shadow.
See also:
frameStyle(), QFrame::setFrameStyle(), setFrameShadow(), setFrameShape()

Definition at line 101 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::setLineWidth ( int  width)

Set the frame line width

The default line width is 2 pixels.

Parameters:
widthLine width of the frame
See also:
lineWidth(), setMidLineWidth()

Definition at line 169 of file qwt_plot_glcanvas.cpp.

void QwtPlotGLCanvas::setMidLineWidth ( int  width)

Set the frame mid line width

The default midline width is 0 pixels.

Parameters:
widthMidline width of the frame
See also:
midLineWidth(), setLineWidth()

Definition at line 197 of file qwt_plot_glcanvas.cpp.


Member Data Documentation

Definition at line 126 of file qwt_plot_glcanvas.h.


Property Documentation

Returns:
The rectangle where the frame is drawn in.

Definition at line 48 of file qwt_plot_glcanvas.h.

Returns:
Frame shadow
See also:
setFrameShadow(), QFrame::setFrameShadow()

Definition at line 43 of file qwt_plot_glcanvas.h.

Returns:
Frame shape
See also:
setFrameShape(), QFrame::frameShape()

Definition at line 44 of file qwt_plot_glcanvas.h.

Returns:
Frame width depending on the style, line width and midline width.

Definition at line 47 of file qwt_plot_glcanvas.h.

int QwtPlotGLCanvas::lineWidth [read, write]
Returns:
Line width of the frame
See also:
setLineWidth(), midLineWidth()

Definition at line 45 of file qwt_plot_glcanvas.h.

int QwtPlotGLCanvas::midLineWidth [read, write]
Returns:
Midline width of the frame
See also:
setMidLineWidth(), lineWidth()

Definition at line 46 of file qwt_plot_glcanvas.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:58