| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
| 3 |
|
| 4 |
#ifndef MAINWINDOW_H |
| 5 |
#define MAINWINDOW_H |
| 6 |
|
| 7 |
#include <QMainWindow> |
| 8 |
#include <QTimer> |
| 9 |
#include <QGridLayout> |
| 10 |
|
| 11 |
QT_FORWARD_DECLARE_CLASS(QOpenGLWidget) |
| 12 |
|
| 13 |
class MainWindow : public QMainWindow |
| 14 |
{ |
| 15 |
Q_OBJECT |
| 16 |
|
| 17 |
public: |
| 18 |
MainWindow(); |
| 19 |
void addNew(); |
| 20 |
bool timerEnabled() const { return m_timer->isActive(); } |
| 21 |
|
| 22 |
void resizeEvent(QResizeEvent *); |
| 23 |
|
| 24 |
public slots: |
| 25 |
void showNewWindow(); |
| 26 |
|
| 27 |
private slots: |
| 28 |
void updateIntervalChanged(int value); |
| 29 |
void timerUsageChanged(bool enabled); |
| 30 |
|
| 31 |
private: |
| 32 |
QTimer *m_timer; |
| 33 |
QGridLayout *m_layout; |
| 34 |
int m_nextX; |
| 35 |
int m_nextY; |
| 36 |
QList<QOpenGLWidget *> m_glWidgets; |
| 37 |
}; |
| 38 |
|
| 39 |
#endif |