42 #ifndef ARTHURWIDGETS_H
43 #define ARTHURWIDGETS_H
47 #include <QPushButton>
50 #if defined(QT_OPENGL_SUPPORT)
57 : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
59 setAttribute(Qt::WA_AcceptTouchEvents);
61 void disableAutoBufferSwap() { setAutoBufferSwap(
false); }
62 void paintEvent(QPaintEvent *) { parentWidget()->update(); }
64 bool event(QEvent *event)
66 switch (event->type()) {
67 case QEvent::TouchBegin:
68 case QEvent::TouchUpdate:
69 case QEvent::TouchEnd:
76 return QGLWidget::event(event);
81 QT_FORWARD_DECLARE_CLASS(QTextDocument)
82 QT_FORWARD_DECLARE_CLASS(QTextEdit)
83 QT_FORWARD_DECLARE_CLASS(QVBoxLayout)
90 virtual void paint(QPainter *) {}
93 void paintDescription(QPainter *p);
95 void loadDescription(
const QString &filename);
96 void setDescription(
const QString &htmlDesc);
98 void loadSourceFile(
const QString &fileName);
102 #if defined(QT_OPENGL_SUPPORT)
103 QGLWidget *glWidget()
const {
return glw; }
108 void setDescriptionEnabled(
bool enabled);
111 #if defined(QT_OPENGL_SUPPORT)
112 void enableOpenGL(
bool use_opengl);
113 bool usesOpenGL() {
return m_use_opengl; }
117 void descriptionEnabledChanged(
bool);
120 void paintEvent(QPaintEvent *);
121 void resizeEvent(QResizeEvent *);
123 #if defined(QT_OPENGL_SUPPORT)