13 #include <qopenglframebufferobject.h> 14 #include <qopenglpaintdevice.h> 35 QOpenGLFramebufferObject*
fbo;
46 QOpenGLWidget( plot ),
49 QSurfaceFormat fmt =
format();
56 QOpenGLWidget( plot ),
70 setAttribute( Qt::WA_OpaquePaintEvent,
true );
89 QOpenGLWidget::paintEvent( event );
99 const bool ok = QOpenGLWidget::event( event );
101 if ( event->type() == QEvent::PolishRequest )
110 if ( event->type() == QEvent::PolishRequest ||
111 event->type() == QEvent::StyleChange )
116 setAttribute( Qt::WA_StyledBackground,
117 testAttribute( Qt::WA_StyleSheet ) );
150 const bool hasFocusIndicator =
156 QOpenGLFramebufferObject::hasOpenGLFramebufferBlit() )
158 if ( hasFocusIndicator )
159 painter.begin(
this );
179 QOpenGLFramebufferObjectFormat fboFormat;
181 fboFormat.setAttachment( QOpenGLFramebufferObject::CombinedDepthStencil );
183 d_data->
fbo =
new QOpenGLFramebufferObject(
size(), fboFormat );
191 QOpenGLPaintDevice pd(
size() );
193 QPainter fboPainter( &pd );
200 QOpenGLFramebufferObject::blitFramebuffer( NULL,
d_data->
fbo );
204 painter.begin(
this );
208 if ( hasFocusIndicator )
Q_INVOKABLE QPainterPath borderPath(const QRect &) const
Paint double buffered reusing the content of the pixmap buffer when possible.
void init(const QSurfaceFormat &)
bool testPaintAttribute(PaintAttribute) const
FocusIndicator focusIndicator() const
virtual ~QwtPlotOpenGLCanvas()
Destructor.
virtual Q_INVOKABLE void invalidateBackingStore()
virtual void initializeGL()
virtual bool event(QEvent *)
std::string format(const std::string &, const time_point< seconds > &, const femtoseconds &, const time_zone &)
QPainterPath borderPath2(const QRect &rect) const
virtual void paintEvent(QPaintEvent *)
virtual void clearBackingStore()
QwtPlot * plot()
Return parent plot widget.
QOpenGLFramebufferObject * fbo
virtual void drawFocusIndicator(QPainter *)
QwtPlotOpenGLCanvas(QwtPlot *=NULL)
Constructor.
virtual void resizeGL(int width, int height)