code format
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#ifndef UGLWIDGET_H
|
||||
#define UGLWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
#include <QWidget>
|
||||
#if QT_VERSION >= 0x050400
|
||||
# include <QOpenGLWidget>
|
||||
typedef QOpenGLWidget __GLWidget__;
|
||||
@@ -10,32 +10,37 @@ typedef QOpenGLWidget __GLWidget__;
|
||||
# include <QGLWidget>
|
||||
typedef QGLWidget __GLWidget__;
|
||||
# ifndef GL_MULTISAMPLE
|
||||
# define GL_MULTISAMPLE 0x809D
|
||||
# define GL_MULTISAMPLE 0x809D
|
||||
# endif
|
||||
#endif
|
||||
#include "qad_graphic_export.h"
|
||||
|
||||
|
||||
class QAD_GRAPHIC_EXPORT UGLWidget: public __GLWidget__
|
||||
{
|
||||
class QAD_GRAPHIC_EXPORT UGLWidget: public __GLWidget__ {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
#if QT_VERSION >= 0x050400
|
||||
UGLWidget(QWidget * parent = 0): __GLWidget__(parent) {QSurfaceFormat sf = format(); sf.setSamples(8); setFormat(sf);}
|
||||
UGLWidget(QWidget * parent = 0): __GLWidget__(parent) {
|
||||
QSurfaceFormat sf = format();
|
||||
sf.setSamples(8);
|
||||
setFormat(sf);
|
||||
}
|
||||
#else
|
||||
UGLWidget(QWidget * parent = 0): __GLWidget__(QGLFormat(QGL::DoubleBuffer | QGL::AlphaChannel | QGL::DirectRendering | QGL::SampleBuffers), parent) {}
|
||||
UGLWidget(QWidget * parent = 0)
|
||||
: __GLWidget__(QGLFormat(QGL::DoubleBuffer | QGL::AlphaChannel | QGL::DirectRendering | QGL::SampleBuffers), parent) {}
|
||||
#endif
|
||||
//UGLWidget(QGLContext * context, QWidget * parent = 0): __GLWidget__(context, parent) {}
|
||||
// UGLWidget(QGLContext * context, QWidget * parent = 0): __GLWidget__(context, parent) {}
|
||||
|
||||
#if QT_VERSION >= 0x050400
|
||||
QImage grabFrameBuffer() {return grabFramebuffer();}
|
||||
QImage grabFrameBuffer() { return grabFramebuffer(); }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
#if QT_VERSION >= 0x050400
|
||||
virtual void paintGL() {emit paintSignal();}
|
||||
virtual void paintGL() { emit paintSignal(); }
|
||||
#else
|
||||
virtual void paintEvent(QPaintEvent * ) {emit paintSignal();}
|
||||
virtual void paintEvent(QPaintEvent *) { emit paintSignal(); }
|
||||
#endif
|
||||
virtual void resizeEvent(QResizeEvent * e) {
|
||||
__GLWidget__::resizeEvent(e);
|
||||
@@ -63,7 +68,6 @@ signals:
|
||||
void wheelEvent(QWheelEvent * e);
|
||||
void resizeSignal();
|
||||
void paintSignal();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user