14 #include <qcoreevent.h>
16 #include <qpainterpath.h>
17 #include <qglframebufferobject.h>
21 class QwtPlotGLCanvasFormat :
public QGLFormat
24 QwtPlotGLCanvasFormat()
25 : QGLFormat( QGLFormat::defaultFormat() )
27 setSampleBuffers(
true );
47 QGLFramebufferObject*
fbo;
57 : QGLWidget( QwtPlotGLCanvasFormat(), plot )
70 : QGLWidget(
format, plot )
87 setAttribute( Qt::WA_OpaquePaintEvent,
true );
102 QGLWidget::paintEvent(
event );
112 const bool ok = QGLWidget::event(
event );
114 if (
event->type() == QEvent::PolishRequest ||
115 event->type() == QEvent::StyleChange )
120 setAttribute( Qt::WA_StyledBackground,
121 testAttribute( Qt::WA_StyleSheet ) );
170 const bool hasFocusIndicator =
178 const QRect rect( 0, 0, width() * pixelRatio, height() * pixelRatio );
180 if ( hasFocusIndicator )
181 painter.begin(
this );
185 if (
m_data->
fbo->size() != rect.size() )
194 QGLFramebufferObjectFormat
format;
196 format.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
205 fboPainter.scale( pixelRatio, pixelRatio );
219 QGLFramebufferObject::blitFramebuffer( NULL,
220 rect.translated( 0, height() - rect.height() ),
m_data->
fbo, rect );
224 painter.begin(
this );
228 if ( hasFocusIndicator )
239 #include "moc_qwt_plot_glcanvas.cpp"