Qt 4.8
qt-4.8.6
src
declarative
qml
qdeclarativescriptstring.cpp
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
#include "
qdeclarativescriptstring.h
"
43
44
QT_BEGIN_NAMESPACE
45
46
class
QDeclarativeScriptStringPrivate
:
public
QSharedData
47
{
48
public
:
49
QDeclarativeScriptStringPrivate
() :
context
(0),
scope
(0) {}
50
51
QDeclarativeContext
*
context
;
52
QObject
*
scope
;
53
QString
script
;
54
};
55
91
QDeclarativeScriptString::QDeclarativeScriptString
()
92
:
d
(new
QDeclarativeScriptStringPrivate
)
93
{
94
}
95
99
QDeclarativeScriptString::QDeclarativeScriptString
(
const
QDeclarativeScriptString
&other)
100
:
d
(other.
d
)
101
{
102
}
103
107
QDeclarativeScriptString::~QDeclarativeScriptString
()
108
{
109
}
110
114
QDeclarativeScriptString
&
QDeclarativeScriptString::operator=
(
const
QDeclarativeScriptString
&other)
115
{
116
d
= other.
d
;
117
return
*
this
;
118
}
119
123
QDeclarativeContext
*
QDeclarativeScriptString::context
()
const
124
{
125
return
d
->
context
;
126
}
127
131
void
QDeclarativeScriptString::setContext
(
QDeclarativeContext
*
context
)
132
{
133
d
->
context
=
context
;
134
}
135
139
QObject
*
QDeclarativeScriptString::scopeObject
()
const
140
{
141
return
d
->
scope
;
142
}
143
147
void
QDeclarativeScriptString::setScopeObject
(
QObject
*
object
)
148
{
149
d
->
scope
= object;
150
}
151
155
QString
QDeclarativeScriptString::script
()
const
156
{
157
return
d
->
script
;
158
}
159
163
void
QDeclarativeScriptString::setScript
(
const
QString
&
script
)
164
{
165
d
->
script
=
script
;
166
}
167
168
QT_END_NAMESPACE
169
QDeclarativeScriptStringPrivate::QDeclarativeScriptStringPrivate
QDeclarativeScriptStringPrivate()
Definition:
qdeclarativescriptstring.cpp:49
d
double d
Definition:
qnumeric_p.h:62
QDeclarativeScriptString::context
QDeclarativeContext * context() const
Returns the context for the script.
Definition:
qdeclarativescriptstring.cpp:123
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
QDeclarativeScriptString::operator=
QDeclarativeScriptString & operator=(const QDeclarativeScriptString &)
Assigns other to this.
Definition:
qdeclarativescriptstring.cpp:114
QString
The QString class provides a Unicode character string.
Definition:
qstring.h:83
QDeclarativeScriptStringPrivate::script
QString script
Definition:
qdeclarativescriptstring.cpp:53
QObject
The QObject class is the base class of all Qt objects.
Definition:
qobject.h:111
QDeclarativeScriptString::QDeclarativeScriptString
QDeclarativeScriptString()
Constructs an empty instance.
Definition:
qdeclarativescriptstring.cpp:91
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
QDeclarativeScriptString
The QDeclarativeScriptString class encapsulates a script and its context.
Definition:
qdeclarativescriptstring.h:58
QDeclarativeScriptString::setScopeObject
void setScopeObject(QObject *)
Sets the scope object for the script.
Definition:
qdeclarativescriptstring.cpp:147
QDeclarativeScriptString::setContext
void setContext(QDeclarativeContext *)
Sets the context for the script.
Definition:
qdeclarativescriptstring.cpp:131
QDeclarativeScriptString::d
QSharedDataPointer< QDeclarativeScriptStringPrivate > d
Definition:
qdeclarativescriptstring.h:77
QDeclarativeScriptStringPrivate
Definition:
qdeclarativescriptstring.cpp:46
QSharedData
The QSharedData class is a base class for shared data objects.
Definition:
qshareddata.h:56
QDeclarativeScriptString::scopeObject
QObject * scopeObject() const
Returns the scope object for the script.
Definition:
qdeclarativescriptstring.cpp:139
QDeclarativeContext
The QDeclarativeContext class defines a context within a QML engine.
Definition:
qdeclarativecontext.h:64
qdeclarativescriptstring.h
QDeclarativeScriptString::setScript
void setScript(const QString &)
Sets the script text.
Definition:
qdeclarativescriptstring.cpp:163
QDeclarativeScriptStringPrivate::context
QDeclarativeContext * context
Definition:
qdeclarativescriptstring.cpp:51
QDeclarativeScriptString::~QDeclarativeScriptString
~QDeclarativeScriptString()
Definition:
qdeclarativescriptstring.cpp:107
QDeclarativeScriptStringPrivate::scope
QObject * scope
Definition:
qdeclarativescriptstring.cpp:52
QDeclarativeScriptString::script
QString script() const
Returns the script text.
Definition:
qdeclarativescriptstring.cpp:155
Qt 4.8 Source Code Browser