a9e5a27e55
- add class to handle top-level windows - remove requirement to use custom graphics-window - order alongside PUI UI
40 lines
832 B
C++
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
|