forked from seppd/qmmp-modern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container.h
64 lines (50 loc) · 1.61 KB
/
container.h
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
61
62
63
64
/*
* Copyright (C) 2016 Dmitry Morozov <dmorozov@outlook.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef CONTAINER_H
#define CONTAINER_H
#include <QWidget>
#include <QXmlStreamAttributes>
#include "object.h"
class Layout;
class Container : public QWidget
{
Q_OBJECT
M_OBJECT
Q_PROPERTY(QString name MEMBER m_name)
Q_PROPERTY(bool default_visible MEMBER m_defaultVisible READ defaultVisible)
Q_PROPERTY(int default_x READ defaultX WRITE setDefaultX)
Q_PROPERTY(int default_y READ defaultY WRITE setDefaultY)
public:
explicit Container(const QXmlStreamAttributes &attributes, QWidget *parent = 0);
~Container() {}
bool defaultVisible() const;
void setDefaultVisible(bool enable);
int defaultX() const;
void setDefaultX(int x);
int defaultY() const;
void setDefaultY(int y);
Layout *layout() const;
int setLayout(const QString &id);
//void updateMask();
protected:
//virtual void mousePressEvent(QMouseEvent *event);
//virtual void mouseMoveEvent(QMouseEvent *event);
//virtual void mouseReleaseEvent(QMouseEvent *event);
//void childEvent(QChildEvent *event);
private:
bool m_defaultVisible = false;
int m_xDefault = 0;
int m_yDefault = 0;
QString m_name;
Layout *m_layout = Q_NULLPTR;
QPoint m_oldPos;
//QMap<QString, Layout *> m_layouts;
};
//Q_DECLARE_METATYPE(Container)
#endif // CONTAINER_H