summaryrefslogtreecommitdiff
path: root/platform/qt/test/qmapboxgl.test.hpp
blob: 04d63610ca1f934dda5ec66ce5ac2bd31f491916 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <mbgl/test/util.hpp>

#include <QApplication>
#include <QMapboxGL>

// We're using QGLFramebufferObject, which is only available in Qt 5 and up.
#if QT_VERSION >= 0x050000

#include <QGLWidget>
#include <QGLFramebufferObject>

class QMapboxGLTest : public QObject, public ::testing::Test {
    Q_OBJECT

public:
    QMapboxGLTest();

    void runUntil(QMapboxGL::MapChange);

private:
    QGLWidget widget;
    const QSize size;
    QGLFramebufferObject fbo;

protected:
    QMapboxGLSettings settings;
    QMapboxGL map;

    std::function<void(QMapboxGL::MapChange)> changeCallback;

private slots:
    void onMapChanged(QMapboxGL::MapChange);
    void onNeedsRendering();
};

#endif