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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#pragma once
#include <QMainWindow>
#include <QScopedPointer>
class Ui_Viewer;
class QLabel;
class QSurfaceFormat;
class QShortcut;
class Canvas;
class Viewer : public QMainWindow
{
Q_OBJECT
public:
Viewer(
const QSurfaceFormat & format
, QWidget * parent = nullptr
, Qt::WindowFlags flags = NULL);
virtual ~Viewer();
public slots:
void fpsChanged(float fps);
void numCubesChanged(int numCubes);
protected slots:
void on_toggleFullScreenAction_triggered(bool checked);
void toggleFullScreen();
void on_toggleSwapIntervalAction_triggered(bool checked);
void toggleSwapInterval();
void on_quitAction_triggered(bool checked);
protected:
void setup();
void setupCanvas(const QSurfaceFormat & format);
void store();
void restore();
void updateAfterFullScreenToggle();
protected:
const QScopedPointer<Ui_Viewer> m_ui;
Canvas * m_canvas;
QLabel * m_fpsLabel;
QLabel * m_numLabel;
QScopedPointer<QShortcut> m_fullscreenShortcut;
QScopedPointer<QShortcut> m_swapIntervalShortcut;
};
|