This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgtkbox.h
68 lines (49 loc) · 1.46 KB
/
qgtkbox.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
65
66
67
#ifndef QGTKBOX_H
#define QGTKBOX_H
#include "qgtkwidget.h"
#include <QtQml/qqml.h>
class QGtkBoxPackAttached;
class QGtkBox : public QGtkWidget
{
Q_OBJECT
public:
QGtkBox(QGtkObject *parent = 0);
protected:
void childCreated(QGtkObject *w);
GtkBox *gtkBox() const { return GTK_BOX(gObject()); }
};
class QGtkBoxPackAttached : public QObject
{
Q_OBJECT
Q_PROPERTY(bool expand READ expand WRITE setExpand NOTIFY expandChanged)
Q_PROPERTY(bool fill READ fill WRITE setFill NOTIFY fillChanged)
Q_PROPERTY(int padding READ padding WRITE setPadding NOTIFY paddingChanged)
Q_PROPERTY(PackDirection packDirection READ packDirection WRITE setPackDirection NOTIFY packDirectionChanged)
public:
QGtkBoxPackAttached(QObject *parent);
bool expand() const;
void setExpand(bool e);
bool fill() const;
void setFill(bool f);
int padding() const;
void setPadding(int p);
enum PackDirection {
PackStart,
PackEnd
};
PackDirection packDirection() const;
void setPackDirection(const PackDirection &p);
signals:
void expandChanged();
void fillChanged();
void paddingChanged();
void packDirectionChanged();
private:
bool m_expand = 0;
bool m_fill = false;
int m_padding = 0;
// ### this seems weird... I wonder if QGtkObject is doing something funky,
// I would have expected PackEnd to be the right default
PackDirection m_packDirection = PackStart;
};
#endif