summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-08-19 04:49:25 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-08-19 04:49:25 (GMT)
commitebdda1575dcb815e89b2d9ee16a8dc2928f61b4c (patch)
tree4265f8af84c58b2f65033dc632b0c1b4cc0e8344 /src/declarative
parent43bf17864ed1b9b31bc5205d2c477b43239f9300 (diff)
parent969974a174625afda3effe33f7de589252559d2f (diff)
downloadQt-ebdda1575dcb815e89b2d9ee16a8dc2928f61b4c.zip
Qt-ebdda1575dcb815e89b2d9ee16a8dc2928f61b4c.tar.gz
Qt-ebdda1575dcb815e89b2d9ee16a8dc2928f61b4c.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/fx/qfxitem.cpp2
-rw-r--r--src/declarative/fx/qfxtextinput.cpp8
-rw-r--r--src/declarative/fx/qfxtextinput.h3
-rw-r--r--src/declarative/util/qmlbind.cpp20
-rw-r--r--src/declarative/util/qmlconnection.cpp20
-rw-r--r--src/declarative/util/qmlscript.cpp12
-rw-r--r--src/declarative/util/qmlsetproperties.cpp55
-rw-r--r--src/declarative/util/qmlstate.cpp34
-rw-r--r--src/declarative/util/qmltransition.cpp28
9 files changed, 30 insertions, 152 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 572fcc7..cca21b9 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -331,7 +331,7 @@ void QFxContents::setItem(QFxItem *item)
\code
Item {
focus: true
- key.onLeftPressed: print("move left")
+ Keys.onLeftPressed: print("move left")
}
\endcode
diff --git a/src/declarative/fx/qfxtextinput.cpp b/src/declarative/fx/qfxtextinput.cpp
index 1407a78..eb6c5bf 100644
--- a/src/declarative/fx/qfxtextinput.cpp
+++ b/src/declarative/fx/qfxtextinput.cpp
@@ -194,6 +194,7 @@ void QFxTextInput::setHAlign(HAlignment align)
{
Q_D(QFxTextInput);
d->hAlign = align;
+ //TODO: implement
}
bool QFxTextInput::isReadOnly() const
@@ -513,6 +514,13 @@ void QFxTextInput::drawContents(QPainter *p, const QRect &r)
p->restore();
}
+void QFxTextInput::selectAll()
+{
+ Q_D(QFxTextInput);
+ d->control->setSelection(0, d->control->text().length());
+}
+
+
/*!
\qmlproperty bool LineEdit::smooth
diff --git a/src/declarative/fx/qfxtextinput.h b/src/declarative/fx/qfxtextinput.h
index fe72f1e..b5812d4 100644
--- a/src/declarative/fx/qfxtextinput.h
+++ b/src/declarative/fx/qfxtextinput.h
@@ -169,6 +169,9 @@ protected:
void focusChanged(bool hasFocus);
+public Q_SLOTS:
+ void selectAll();
+
private Q_SLOTS:
void updateSize();
void q_textChanged();
diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp
index 2ba8802..f3b5fa4 100644
--- a/src/declarative/util/qmlbind.cpp
+++ b/src/declarative/util/qmlbind.cpp
@@ -73,8 +73,8 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bind,QmlBind)
to QML by C++. In these cases, regular property binding doesn't work. Bind
allows you to bind any value to any property.
- For example, imagine a C++ application that maps an "app.enteredText"
- property into QML. You could use Bind to update the enteredText property
+ For example, imagine a C++ application that maps an "app.enteredText"
+ property into QML. You could use Bind to update the enteredText property
like this.
\code
TextEdit { id: myTextField; text: "Please type here..." }
@@ -83,7 +83,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bind,QmlBind)
Whenever the text in the TextEdit is updated, the C++ property will be
updated also.
- If the bind target or bind property is changed, the bound value is
+ If the bind target or bind property is changed, the bound value is
immediately pushed onto the new target.
\sa {qmlforcpp}{Qt Declarative Markup Language For C++ Programmers}
@@ -126,10 +126,6 @@ void QmlBind::setWhen(bool v)
\qmlproperty Object Bind::target
The object to be updated.
- */
-/*!
- \property QmlBind::target
- \brief the object to be updated.
*/
QObject *QmlBind::object()
{
@@ -148,10 +144,6 @@ void QmlBind::setObject(QObject *obj)
\qmlproperty string Bind::property
The property to be updated.
- */
-/*!
- \property QmlBind::property
- \brief the property of the target to be updated.
*/
QString QmlBind::property() const
{
@@ -169,12 +161,8 @@ void QmlBind::setProperty(const QString &p)
/*!
\qmlproperty any Bind::value
- The value to be set on the target object and property. This can be a
+ The value to be set on the target object and property. This can be a
constant (which isn't very useful), or a bound expression.
- */
-/*!
- \property QmlBind::value
- \brief the value to bind to.
*/
QVariant QmlBind::value() const
{
diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp
index 24bb61f..83804a5 100644
--- a/src/declarative/util/qmlconnection.cpp
+++ b/src/declarative/util/qmlconnection.cpp
@@ -134,16 +134,6 @@ QmlConnection::~QmlConnection()
By default, the sender is assumed to be the parent of the Connection.
*/
-
-/*!
- \property QmlConnection::sender
- \brief the object that sends the signal.
-
- By default, the sender is assumed to be the parent of the Connection.
-
- Note that the set/get methods are setSignalSender() and signalSender(),
- due to the pre-existence of QObject::sender().
-*/
QObject *QmlConnection::signalSender() const
{
Q_D(const QmlConnection);
@@ -233,11 +223,6 @@ void QmlConnection::componentComplete()
This is the default attribute of Connection.
*/
-
-/*!
- \property QmlConnection::script
- \brief the JavaScript executed whenever the signal is sent.
-*/
QString QmlConnection::script() const
{
Q_D(const QmlConnection);
@@ -275,11 +260,6 @@ Connection {
}
\endqml
*/
-
-/*!
- \property QmlConnection::signal
- \brief the signal from the sender to which the script is attached.
-*/
QString QmlConnection::signal() const
{
Q_D(const QmlConnection);
diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp
index 6bc21a2..0bff047 100644
--- a/src/declarative/util/qmlscript.cpp
+++ b/src/declarative/util/qmlscript.cpp
@@ -109,10 +109,6 @@ QmlScript::QmlScript(QObject *parent) : QObject(*(new QmlScriptPrivate), parent)
\default
JavaScript code to execute.
*/
-/*!
- \property QmlScript::script
- \brief a script snippet.
-*/
QString QmlScript::script() const
{
Q_D(const QmlScript);
@@ -131,10 +127,6 @@ void QmlScript::setScript(const QString &script)
Setting this property causes the Script element to read JavaScript code from
the file specified.
- */
-/*!
- \property QmlScript::source
- \brief the path to a script file.
*/
QUrl QmlScript::source() const
{
@@ -148,7 +140,7 @@ void QmlScript::setSource(const QUrl &source)
if (d->url == source)
return;
d->url = qmlContext(this)->resolvedUrl(source);
-
+
#ifndef QT_NO_LOCALFILE_OPTIMIZED_QML
if (d->url.scheme() == QLatin1String("file")) {
QFile file(d->url.toLocalFile());
@@ -198,7 +190,7 @@ void QmlScriptPrivate::addScriptToEngine(const QString &script, const QString &s
if (scriptEngine->uncaughtException().isError()){
QScriptValue exception = scriptEngine->uncaughtException();
if (!exception.property(QLatin1String("fileName")).toString().isEmpty()){
- qWarning() << exception.property(QLatin1String("fileName")).toString()
+ qWarning() << exception.property(QLatin1String("fileName")).toString()
<< scriptEngine->uncaughtExceptionLineNumber()
<< exception.toString();
diff --git a/src/declarative/util/qmlsetproperties.cpp b/src/declarative/util/qmlsetproperties.cpp
index a08f4ba..e7be329 100644
--- a/src/declarative/util/qmlsetproperties.cpp
+++ b/src/declarative/util/qmlsetproperties.cpp
@@ -56,9 +56,8 @@ QT_BEGIN_NAMESPACE
\qmlclass SetProperties QmlSetProperties
\brief The SetProperties element describes new property values for a state.
- SetProperties is a convenience element for changing many properties on a single
- object. It allows you to specify the property names and values similar to how
- you normally would specify them for the actual item:
+ SetProperties changes the properties of an item. It allows you to specify the property
+ names and values similar to how you normally would specify them for the actual item:
\code
SetProperties {
@@ -68,38 +67,12 @@ QT_BEGIN_NAMESPACE
width: 48
}
\endcode
-
- \c target is a property of \c SetProperties, so if the property you want to change
- is named \e target you will have to use \l SetProperty instead. You should also
- use \l SetProperty if you want to update the binding for a property,
- as SetProperties does not support this.
*/
/*!
\internal
\class QmlSetProperties
\brief The QmlSetProperties class describes new property values for a state.
-
- \ingroup group_states
-
- QmlSetProperties is a convenience class for changing many properties on a single
- object. It allows you to specify the property names and values similar to how
- you normally would specify them for the actual item:
-
- \code
- SetProperties {
- target: myRect
- x: 52
- y: 300
- width: 48
- }
- \endcode
-
- \c target is a property of \c SetProperties, so if the property you want to change
- is named \e target you will have to use QmlSetProperty instead. You should also use QmlSetProperty
- if you want to update the binding for a property, as QmlSetProperties does not support this.
-
- \sa QmlSetProperty
*/
/*!
@@ -107,15 +80,11 @@ QT_BEGIN_NAMESPACE
This property holds the object that the properties to change belong to
*/
-/*!
- \property QmlSetProperties::target
- \brief the object that the properties to change belong to
-*/
class QmlSetPropertiesPrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QmlSetProperties)
public:
- QmlSetPropertiesPrivate() : object(0), decoded(true), restore(true),
+ QmlSetPropertiesPrivate() : object(0), decoded(true), restore(true),
isExplicit(false) {}
QObject *object;
@@ -141,9 +110,9 @@ public:
virtual void setCustomData(QObject *, const QByteArray &);
};
-void
-QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list,
- const QByteArray &pre,
+void
+QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list,
+ const QByteArray &pre,
const QmlCustomParserProperty &prop)
{
QByteArray propName = pre + prop.name();
@@ -156,7 +125,7 @@ QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list,
continue;
} else if(value.userType() == qMetaTypeId<QmlCustomParserProperty>()) {
- QmlCustomParserProperty prop =
+ QmlCustomParserProperty prop =
qvariant_cast<QmlCustomParserProperty>(value);
QByteArray pre = propName + ".";
compileList(list, pre, prop);
@@ -167,8 +136,8 @@ QmlSetPropertiesParser::compileList(QList<QPair<QByteArray, QVariant> > &list,
}
}
-QByteArray
-QmlSetPropertiesParser::compile(const QList<QmlCustomParserProperty> &props,
+QByteArray
+QmlSetPropertiesParser::compile(const QList<QmlCustomParserProperty> &props,
bool *ok)
{
*ok = true;
@@ -238,10 +207,10 @@ void QmlSetPropertiesPrivate::decode()
data.clear();
}
-void QmlSetPropertiesParser::setCustomData(QObject *object,
+void QmlSetPropertiesParser::setCustomData(QObject *object,
const QByteArray &data)
{
- QmlSetPropertiesPrivate *p =
+ QmlSetPropertiesPrivate *p =
static_cast<QmlSetPropertiesPrivate *>(QObjectPrivate::get(object));
p->data = data;
p->decoded = false;
@@ -310,7 +279,7 @@ QmlSetProperties::ActionList QmlSetProperties::actions()
QByteArray property = d->properties.at(ii).first;
- Action a(d->object, QString::fromLatin1(property),
+ Action a(d->object, QString::fromLatin1(property),
d->properties.at(ii).second);
if (a.property.isValid()) {
diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp
index 9967486..ce94aa8 100644
--- a/src/declarative/util/qmlstate.cpp
+++ b/src/declarative/util/qmlstate.cpp
@@ -168,13 +168,6 @@ QmlState::~QmlState()
Each state should have a unique name.
*/
-
-/*!
- \property QmlState::name
- \brief the name of the state
-
- Each state should have a unique name.
-*/
QString QmlState::name() const
{
Q_D(const QmlState);
@@ -200,14 +193,6 @@ bool QmlState::isWhenKnown() const
This should be set to an expression that evaluates to true when you want the state to
be applied.
*/
-
-/*!
- \property QmlState::when
- \brief when the state should be applied
-
- This should be set to an expression that evaluates to true when you want the state to
- be applied.
-*/
QmlBinding *QmlState::when() const
{
Q_D(const QmlState);
@@ -229,16 +214,6 @@ void QmlState::setWhen(QmlBinding *when)
The state being extended is treated as the base state in regards to
the changes specified by the extending state.
*/
-
-/*!
- \property QmlState::extends
- \brief the state that this state extends
-
- The state being extended is treated as the base state in regards to
- the changes specified by the extending state.
-
- \sa operations
-*/
QString QmlState::extends() const
{
Q_D(const QmlState);
@@ -260,15 +235,6 @@ void QmlState::setExtends(const QString &extends)
extends another state, then the changes are applied against the state being
extended.
*/
-
-/*!
- \property QmlState::operations
- \brief the changes to apply for this state
-
- By default these changes are applied against the default state. If the state
- extends another state, then the changes are applied against the state being
- extended.
-*/
QmlList<QmlStateOperation *> *QmlState::operations()
{
Q_D(QmlState);
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index a9b8cb3..fd22f6b 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -198,14 +198,6 @@ void QmlTransition::prepare(QmlStateOperation::ActionList &actions,
}
\endcode
*/
-
-/*!
- \property QmlTransition::fromState
- \brief a selector indicating which states, when left, should trigger the transition.
-
- fromState is used in conjunction with toState to determine when a transition should
- be applied. The default value is "*" (any state).
-*/
QString QmlTransition::fromState() const
{
Q_D(const QmlTransition);
@@ -224,14 +216,6 @@ void QmlTransition::setFromState(const QString &f)
The default value is false.
*/
-
-
-/*!
- \property QmlTransition::reversible
- \brief whether the transition should be automatically reversed when the conditions that triggered this transition are reversed.
-
- The default value is false.
-*/
bool QmlTransition::reversible() const
{
Q_D(const QmlTransition);
@@ -244,13 +228,6 @@ void QmlTransition::setReversible(bool r)
d->reversible = r;
}
-/*!
- \property QmlTransition::toState
- \brief a selector indicating which states, when entered, should trigger the transition.
-
- toState is used in conjunction with fromState to determine when a transition should
- be applied. The default value is "*" (any state).
-*/
QString QmlTransition::toState() const
{
Q_D(const QmlTransition);
@@ -272,11 +249,6 @@ void QmlTransition::setToState(const QString &t)
which contains all the animations, and assign that to operations.
\default
*/
-
-/*!
- \property QmlTransition::operations
- \brief a list of the transition animations to be run.
-*/
QmlList<QmlAbstractAnimation *>* QmlTransition::operations()
{
Q_D(QmlTransition);