Qt 4.8
qt-4.8.6
src
declarative
graphicsitems
qdeclarativeanchors_p.h
Go to the documentation of this file.
1
/****************************************************************************
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
5
**
6
** This file is part of the QtDeclarative module of the Qt Toolkit.
7
**
8
** $QT_BEGIN_LICENSE:LGPL$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
16
**
17
** GNU Lesser General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
** General Public License version 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
**
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
**
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
36
**
37
**
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
#ifndef QDECLARATIVEANCHORS_H
43
#define QDECLARATIVEANCHORS_H
44
45
#include "
qdeclarativeitem.h
"
46
47
#include <
qdeclarative.h
>
48
49
#include <QtCore/QObject>
50
51
#include <private/qdeclarativeglobal_p.h>
52
53
QT_BEGIN_HEADER
54
55
QT_BEGIN_NAMESPACE
56
57
QT_MODULE
(Declarative)
58
59
class
QDeclarativeAnchorsPrivate
;
60
class
QDeclarativeAnchorLine
;
61
class
Q_DECLARATIVE_PRIVATE_EXPORT
QDeclarativeAnchors
:
public
QObject
62
{
63
Q_OBJECT
64
65
QDeclarativeAnchorLine
left
;
66
QDeclarativeAnchorLine
right
;
67
QDeclarativeAnchorLine
horizontalCenter
;
68
QDeclarativeAnchorLine
top
;
69
QDeclarativeAnchorLine
bottom
;
70
QDeclarativeAnchorLine
verticalCenter
;
71
QDeclarativeAnchorLine
baseline
;
72
qreal
margins
;
73
qreal
leftMargin
;
74
qreal
rightMargin
;
75
qreal
horizontalCenterOffset
;
76
qreal
topMargin
;
77
qreal
bottomMargin
;
78
qreal
verticalCenterOffset
;
79
qreal
baselineOffset
;
80
QGraphicsObject
*
fill
;
81
QGraphicsObject
*
centerIn
;
82
83
public
:
84
QDeclarativeAnchors
(
QObject
*parent=0);
85
QDeclarativeAnchors
(
QGraphicsObject
*item,
QObject
*parent=0);
86
virtual
~
QDeclarativeAnchors
();
87
88
enum
Anchor
{
89
LeftAnchor = 0x01,
90
RightAnchor = 0x02,
91
TopAnchor = 0x04,
92
BottomAnchor = 0x08,
93
HCenterAnchor = 0x10,
94
VCenterAnchor = 0x20,
95
BaselineAnchor = 0x40,
96
Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
97
Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
98
};
99
Q_DECLARE_FLAGS
(Anchors,
Anchor
)
100
101
QDeclarativeAnchorLine
left
()
const
;
102
void
setLeft(
const
QDeclarativeAnchorLine
&edge);
103
void
resetLeft();
104
105
QDeclarativeAnchorLine
right
()
const
;
106
void
setRight(
const
QDeclarativeAnchorLine
&edge);
107
void
resetRight();
108
109
QDeclarativeAnchorLine
horizontalCenter()
const
;
110
void
setHorizontalCenter(
const
QDeclarativeAnchorLine
&edge);
111
void
resetHorizontalCenter();
112
113
QDeclarativeAnchorLine
top()
const
;
114
void
setTop(
const
QDeclarativeAnchorLine
&edge);
115
void
resetTop();
116
117
QDeclarativeAnchorLine
bottom()
const
;
118
void
setBottom(
const
QDeclarativeAnchorLine
&edge);
119
void
resetBottom();
120
121
QDeclarativeAnchorLine
verticalCenter()
const
;
122
void
setVerticalCenter(
const
QDeclarativeAnchorLine
&edge);
123
void
resetVerticalCenter();
124
125
QDeclarativeAnchorLine
baseline()
const
;
126
void
setBaseline(
const
QDeclarativeAnchorLine
&edge);
127
void
resetBaseline();
128
129
qreal
leftMargin()
const
;
130
void
setLeftMargin(
qreal
);
131
132
qreal
rightMargin()
const
;
133
void
setRightMargin(
qreal
);
134
135
qreal
horizontalCenterOffset()
const
;
136
void
setHorizontalCenterOffset(
qreal
);
137
138
qreal
topMargin()
const
;
139
void
setTopMargin(
qreal
);
140
141
qreal
bottomMargin()
const
;
142
void
setBottomMargin(
qreal
);
143
144
qreal
margins()
const
;
145
void
setMargins(
qreal
);
146
147
qreal
verticalCenterOffset()
const
;
148
void
setVerticalCenterOffset(
qreal
);
149
150
qreal
baselineOffset()
const
;
151
void
setBaselineOffset(
qreal
);
152
153
QGraphicsObject
*fill()
const
;
154
void
setFill(
QGraphicsObject
*);
155
void
resetFill();
156
157
QGraphicsObject
*centerIn()
const
;
158
void
setCenterIn(
QGraphicsObject
*);
159
void
resetCenterIn();
160
161
Anchors usedAnchors()
const
;
162
163
void
classBegin();
164
void
componentComplete();
165
166
bool
mirrored();
167
168
Q_SIGNALS
:
169
void
leftChanged();
170
void
rightChanged();
171
void
topChanged();
172
void
bottomChanged();
173
void
verticalCenterChanged();
174
void
horizontalCenterChanged();
175
void
baselineChanged();
176
void
fillChanged();
177
void
centerInChanged();
178
void
leftMarginChanged();
179
void
rightMarginChanged();
180
void
topMarginChanged();
181
void
bottomMarginChanged();
182
void
marginsChanged();
183
void
verticalCenterOffsetChanged();
184
void
horizontalCenterOffsetChanged();
185
void
baselineOffsetChanged();
186
187
private
:
188
friend
class
QDeclarativeItem
;
189
friend
class
QDeclarativeItemPrivate
;
190
friend
class
QDeclarativeGraphicsWidget
;
191
Q_DISABLE_COPY
(
QDeclarativeAnchors
)
192
Q_DECLARE_PRIVATE
(
QDeclarativeAnchors
)
193
Q_PRIVATE_SLOT
(d_func(),
void
_q_widgetGeometryChanged())
194
Q_PRIVATE_SLOT
(d_func(),
void
_q_widgetDestroyed(
QObject
*obj))
195
};
196
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QDeclarativeAnchors
::Anchors)
197
198
QT_END_NAMESPACE
199
200
QML_DECLARE_TYPE
(
QDeclarativeAnchors
)
201
202
QT_END_HEADER
203
204
#endif
QDeclarativeAnchors::rightMargin
qreal rightMargin
Definition:
qdeclarativeanchors_p.h:74
QDeclarativeAnchors::leftMargin
qreal leftMargin
Definition:
qdeclarativeanchors_p.h:73
qreal
double qreal
Definition:
qglobal.h:1193
QDeclarativeAnchors::verticalCenterOffset
qreal verticalCenterOffset
Definition:
qdeclarativeanchors_p.h:78
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
QT_MODULE
#define QT_MODULE(x)
Definition:
qglobal.h:2783
QDeclarativeAnchors::top
QDeclarativeAnchorLine top
Definition:
qdeclarativeanchors_p.h:68
QML_DECLARE_TYPE
#define QML_DECLARE_TYPE(TYPE)
Definition:
qdeclarative.h:56
QT_BEGIN_HEADER
#define QT_BEGIN_HEADER
Definition:
qglobal.h:136
Q_DECLARE_FLAGS
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Definition:
qglobal.h:2348
qdeclarative.h
QDeclarativeAnchors::Anchor
Anchor
Definition:
qdeclarativeanchors_p.h:88
Q_DISABLE_COPY
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition:
qglobal.h:2523
Q_PRIVATE_SLOT
#define Q_PRIVATE_SLOT(d, signature)
Definition:
qobjectdefs.h:73
QDeclarativeAnchors::horizontalCenterOffset
qreal horizontalCenterOffset
Definition:
qdeclarativeanchors_p.h:75
QObject
The QObject class is the base class of all Qt objects.
Definition:
qobject.h:111
QDeclarativeAnchors::baseline
QDeclarativeAnchorLine baseline
Definition:
qdeclarativeanchors_p.h:71
Q_SIGNALS
#define Q_SIGNALS
Definition:
qobjectdefs.h:72
QDeclarativeAnchors::fill
QGraphicsObject * fill
Definition:
qdeclarativeanchors_p.h:80
right
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QDeclarativeAnchors::margins
qreal margins
Definition:
qdeclarativeanchors_p.h:72
QDeclarativeGraphicsWidget
Definition:
qdeclarativegraphicswidget_p.h:60
QDeclarativeAnchors::horizontalCenter
QDeclarativeAnchorLine horizontalCenter
Definition:
qdeclarativeanchors_p.h:67
QDeclarativeAnchors::verticalCenter
QDeclarativeAnchorLine verticalCenter
Definition:
qdeclarativeanchors_p.h:70
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
QDeclarativeAnchorsPrivate
Definition:
qdeclarativeanchors_p_p.h:89
QDeclarativeAnchors::bottomMargin
qreal bottomMargin
Definition:
qdeclarativeanchors_p.h:77
Q_DECLARE_OPERATORS_FOR_FLAGS
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
Definition:
qglobal.h:2355
QDeclarativeAnchors::centerIn
QGraphicsObject * centerIn
Definition:
qdeclarativeanchors_p.h:81
QDeclarativeItemPrivate
Definition:
qdeclarativeitem_p.h:117
QDeclarativeItem
The QDeclarativeItem class provides the most basic of all visual items in QML.
Definition:
qdeclarativeitem.h:67
Q_DECLARATIVE_PRIVATE_EXPORT
#define Q_DECLARATIVE_PRIVATE_EXPORT
Definition:
qdeclarativeglobal_p.h:70
Q_OBJECT
#define Q_OBJECT
Definition:
qobjectdefs.h:157
QDeclarativeAnchors::baselineOffset
qreal baselineOffset
Definition:
qdeclarativeanchors_p.h:79
QDeclarativeAnchors::topMargin
qreal topMargin
Definition:
qdeclarativeanchors_p.h:76
QDeclarativeAnchors
Definition:
qdeclarativeanchors_p.h:61
QDeclarativeAnchors::left
QDeclarativeAnchorLine left
Definition:
qdeclarativeanchors_p.h:65
qdeclarativeitem.h
QDeclarativeAnchors::bottom
QDeclarativeAnchorLine bottom
Definition:
qdeclarativeanchors_p.h:69
QDeclarativeAnchorLine
Definition:
qdeclarativeanchors_p_p.h:62
Q_DECLARE_PRIVATE
#define Q_DECLARE_PRIVATE(Class)
Definition:
qglobal.h:2467
QGraphicsObject
The QGraphicsObject class provides a base class for all graphics items that require signals...
Definition:
qgraphicsitem.h:547
left
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QT_END_HEADER
#define QT_END_HEADER
Definition:
qglobal.h:137
QDeclarativeAnchors::right
QDeclarativeAnchorLine right
Definition:
qdeclarativeanchors_p.h:66
Qt 4.8 Source Code Browser