1
0
Fork 0
flightgear/src/GUI/FGQQWindowManager.hxx
James Turner a9e5a27e55 UI handling tweaks
- add class to handle top-level windows
- remove requirement to use custom graphics-window
- order alongside PUI UI
2020-06-05 17:54:27 +01:00

40 lines
832 B
C++

#ifndef FGQQWINDOWMANAGER_HXX
#define FGQQWINDOWMANAGER_HXX
#include <QObject>
#include <memory>
// forward decls
class QAbstractItemModel;
class QQmlEngine;
class FGQQWindowManager : public QObject
{
Q_OBJECT
public:
explicit FGQQWindowManager(QQmlEngine* engine, QObject* parent = nullptr);
~FGQQWindowManager();
Q_PROPERTY(QAbstractItemModel* windows READ windows CONSTANT)
QAbstractItemModel* windows() const;
Q_INVOKABLE bool show(QString windowId);
Q_INVOKABLE bool requestPopout(QString windowId);
Q_INVOKABLE bool requestClose(QString windowId);
Q_INVOKABLE bool requestPopin(QString windowId);
signals:
public slots:
private:
class WindowManagerPrivate;
std::unique_ptr<WindowManagerPrivate> _d;
QQmlEngine* _engine = nullptr;
};
#endif // FGQQWINDOWMANAGER_HXX