ui: Properly handle sub window stacks with QtWindowStackElement interface

This commit is contained in:
Eberhard Graether
2016-02-22 09:19:53 +01:00
parent 95b3fe9950
commit 7847d53fbb
6 changed files with 74 additions and 15 deletions
+14 -3
View File
@@ -5,6 +5,17 @@
#include <QWidget>
class QtWindowStackElement
: public QWidget
{
public:
QtWindowStackElement(QWidget* parent = nullptr);
virtual void showWindow() = 0;
virtual void hideWindow() = 0;
};
class QtWindowStack
: public QObject
{
@@ -18,15 +29,15 @@ signals:
public:
QtWindowStack(QObject* parent = nullptr);
QWidget* getTopWindow();
QtWindowStackElement* getTopWindow();
public slots:
void pushWindow(QWidget* window);
void pushWindow(QtWindowStackElement* window);
void popWindow();
void clearWindows();
private:
std::vector<QWidget*> m_stack;
std::vector<QtWindowStackElement*> m_stack;
};
#endif // QT_WINDOW_STACK