summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/declarative/webview/content/Mapping/Map.qml40
-rwxr-xr-xexamples/declarative/webview/content/Mapping/map.html94
-rw-r--r--examples/declarative/webview/googleMaps.qml62
-rw-r--r--qmake/generators/symbian/symmake.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsanchors.cpp26
-rw-r--r--src/declarative/qml/qmlcompiler.cpp12
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp6
-rw-r--r--src/declarative/util/qmlanimation.cpp14
-rw-r--r--src/declarative/util/qmlbehavior.cpp2
-rw-r--r--src/declarative/util/qmlpropertychanges.cpp2
-rw-r--r--src/declarative/util/qmlstateoperations.cpp8
-rw-r--r--src/declarative/util/qmlxmllistmodel.cpp4
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp10
-rw-r--r--src/gui/styles/qs60style.cpp45
-rw-r--r--src/gui/styles/qs60style_p.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp2
-rw-r--r--src/gui/widgets/qlineedit.cpp12
-rw-r--r--src/gui/widgets/qplaintextedit.cpp2
-rw-r--r--src/gui/widgets/qtextedit.cpp13
-rw-r--r--tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp6
-rw-r--r--tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp2
-rw-r--r--tests/auto/declarative/qmldom/tst_qmldom.cpp2
-rw-r--r--tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp12
-rw-r--r--tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp24
-rw-r--r--tests/auto/declarative/qmlgraphicsloader/data/NoResizeGraphicsWidget.qml16
-rw-r--r--tests/auto/declarative/qmlgraphicsloader/data/SizeGraphicsWidgetToLoader.qml16
-rw-r--r--tests/auto/declarative/qmlgraphicsloader/data/SizeLoaderToGraphicsWidget.qml12
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt2
-rw-r--r--tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt2
-rw-r--r--tests/auto/declarative/qmlstates/tst_qmlstates.cpp4
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp40
-rw-r--r--tests/benchmarks/benchmarks.pro1
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.cpp28
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.h6
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp3
-rw-r--r--tools/designer/src/components/formeditor/formeditor.pri2
-rw-r--r--tools/designer/src/components/formeditor/formwindow.cpp219
-rw-r--r--tools/designer/src/components/formeditor/formwindow.h15
-rw-r--r--tools/designer/src/components/formeditor/qdesignerundostack.cpp112
-rw-r--r--tools/designer/src/components/formeditor/qdesignerundostack.h90
-rw-r--r--tools/designer/src/lib/shared/qdesigner_formwindowcommand.cpp6
-rw-r--r--tools/designer/src/lib/shared/qdesigner_formwindowcommand_p.h4
-rw-r--r--tools/designer/src/lib/shared/qdesigner_propertycommand.cpp54
-rw-r--r--tools/designer/src/lib/shared/qdesigner_propertycommand_p.h28
-rw-r--r--translations/translations.pri1
58 files changed, 703 insertions, 388 deletions
diff --git a/examples/declarative/webview/content/Mapping/Map.qml b/examples/declarative/webview/content/Mapping/Map.qml
index aae6b5d..2e98940 100644
--- a/examples/declarative/webview/content/Mapping/Map.qml
+++ b/examples/declarative/webview/content/Mapping/Map.qml
@@ -1,20 +1,20 @@
-import Qt 4.6
-
-Item {
- id: page
- property real latitude: -34.397
- property real longitude: 150.644
- property string address: ""
- WebView {
- id: map
- anchors.fill: parent
- url: "map.html"
- javaScriptWindowObjects: QtObject {
- WebView.windowObjectName: "qml"
- property real lat: page.latitude
- property real lng: page.longitude
- property string address: page.address
- onAddressChanged: {map.evaluateJavaScript("goToAddress()")}
- }
- }
-}
+import Qt 4.6
+
+Item {
+ id: page
+ property real latitude: -34.397
+ property real longitude: 150.644
+ property string address: ""
+ WebView {
+ id: map
+ anchors.fill: parent
+ url: "map.html"
+ javaScriptWindowObjects: QtObject {
+ WebView.windowObjectName: "qml"
+ property real lat: page.latitude
+ property real lng: page.longitude
+ property string address: page.address
+ onAddressChanged: {map.evaluateJavaScript("goToAddress()")}
+ }
+ }
+}
diff --git a/examples/declarative/webview/content/Mapping/map.html b/examples/declarative/webview/content/Mapping/map.html
index 8afa21c..72f426a 100755
--- a/examples/declarative/webview/content/Mapping/map.html
+++ b/examples/declarative/webview/content/Mapping/map.html
@@ -1,47 +1,47 @@
-<html>
-<head>
-<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
-<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
-<script type="text/javascript">
- var geocoder
- var map
- function goToLatLng(latlng,bounds) {
- if (map) {
- map.setCenter(latlng)
- map.fitBounds(bounds)
- } else {
- var myOptions = {
- zoom: 8,
- center: latlng,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
- }
- }
- function initialize() {
- geocoder = new google.maps.Geocoder();
- if (window.qml.address) {
- goToAddress()
- } else {
- goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
- }
- }
- function goToAddress() {
- if (geocoder) {
- var req = {
- address: window.qml.address,
- }
- if (map)
- req.bounds = map.getBounds()
- geocoder.geocode(req, function(results, status) {
- if (status == google.maps.GeocoderStatus.OK)
- goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
- });
- }
- }
-</script>
-</head>
-<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
- <div id="map_canvas" style="width:100%; height:100%"></div>
-</body>
-</html>
+<html>
+<head>
+<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script type="text/javascript">
+ var geocoder
+ var map
+ function goToLatLng(latlng,bounds) {
+ if (map) {
+ map.setCenter(latlng)
+ map.fitBounds(bounds)
+ } else {
+ var myOptions = {
+ zoom: 8,
+ center: latlng,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+ map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
+ }
+ }
+ function initialize() {
+ geocoder = new google.maps.Geocoder();
+ if (window.qml.address) {
+ goToAddress()
+ } else {
+ goToLatLng(new google.maps.LatLng(window.qml.lat,window.qml.lng));
+ }
+ }
+ function goToAddress() {
+ if (geocoder) {
+ var req = {
+ address: window.qml.address,
+ }
+ if (map)
+ req.bounds = map.getBounds()
+ geocoder.geocode(req, function(results, status) {
+ if (status == google.maps.GeocoderStatus.OK)
+ goToLatLng(results[0].geometry.location,results[0].geometry.bounds);
+ });
+ }
+ }
+</script>
+</head>
+<body onload="initialize()" leftmargin="0px" topmargin="0px" marginwidth="0px" marginheight="0px">
+ <div id="map_canvas" style="width:100%; height:100%"></div>
+</body>
+</html>
diff --git a/examples/declarative/webview/googleMaps.qml b/examples/declarative/webview/googleMaps.qml
index b5b13bb..1886961 100644
--- a/examples/declarative/webview/googleMaps.qml
+++ b/examples/declarative/webview/googleMaps.qml
@@ -1,31 +1,31 @@
-// This example demonstrates how Web services such as Google Maps can be
-// abstracted as QML types. Here we have a "Mapping" module with a "Map"
-// type. The Map type has an address property. Setting that property moves
-// the map. The underlying implementation uses WebView and the Google Maps
-// API, but users from QML don't need to understand the implementation in
-// order to create a Map.
-
-import Qt 4.6
-import "content/Mapping"
-
-Map {
- id: map
- width: 300
- height: 300
- address: "Paris"
- Rectangle {
- color: "white"
- width: input.width + 20
- height: input.height + 4
- radius: 5
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 5
- x: 70
- TextInput {
- id: input
- text: map.address
- anchors.centerIn: parent
- Keys.onReturnPressed: map.address = input.text
- }
- }
-}
+// This example demonstrates how Web services such as Google Maps can be
+// abstracted as QML types. Here we have a "Mapping" module with a "Map"
+// type. The Map type has an address property. Setting that property moves
+// the map. The underlying implementation uses WebView and the Google Maps
+// API, but users from QML don't need to understand the implementation in
+// order to create a Map.
+
+import Qt 4.6
+import "content/Mapping"
+
+Map {
+ id: map
+ width: 300
+ height: 300
+ address: "Paris"
+ Rectangle {
+ color: "white"
+ width: input.width + 20
+ height: input.height + 4
+ radius: 5
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 5
+ x: 70
+ TextInput {
+ id: input
+ text: map.address
+ anchors.centerIn: parent
+ Keys.onReturnPressed: map.address = input.text
+ }
+ }
+}
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 69668ab..5ebc8a2 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -1938,7 +1938,7 @@ void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)
t << OK_ROM_STUB_SIS_TARGET ":" << endl;
- QString stubpkgcommand = QString::fromLatin1("\tcreatepackage.bat -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
+ QString stubpkgcommand = QString::fromLatin1("\tcreatepackage" SCRIPT_EXT " -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \
"$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")
.arg(fixedTarget)
.arg("pkg");
diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
index 93055fc..945e7d3 100644
--- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
@@ -366,7 +366,7 @@ void QmlGraphicsAnchors::setFill(QmlGraphicsItem *f)
return;
}
if (f != d->item->parentItem() && f->parentItem() != d->item->parentItem()){
- qmlInfo(d->item) << tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
return;
}
d->remDepend(d->fill);
@@ -400,7 +400,7 @@ void QmlGraphicsAnchors::setCenterIn(QmlGraphicsItem* c)
return;
}
if (c != d->item->parentItem() && c->parentItem() != d->item->parentItem()){
- qmlInfo(d->item) << tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(d->item) << tr("Cannot anchor to an item that isn't a parent or sibling.");
return;
}
@@ -991,7 +991,7 @@ bool QmlGraphicsAnchorsPrivate::checkHValid() const
if (usedAnchors & QmlGraphicsAnchors::HasLeftAnchor &&
usedAnchors & QmlGraphicsAnchors::HasRightAnchor &&
usedAnchors & QmlGraphicsAnchors::HasHCenterAnchor) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't specify left, right, and hcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot specify left, right, and hcenter anchors.");
return false;
}
@@ -1001,16 +1001,16 @@ bool QmlGraphicsAnchorsPrivate::checkHValid() const
bool QmlGraphicsAnchorsPrivate::checkHAnchorValid(QmlGraphicsAnchorLine anchor) const
{
if (!anchor.item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to a null item.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to a null item.");
return false;
} else if (anchor.anchorLine & QmlGraphicsAnchorLine::Vertical_Mask) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor a horizontal edge to a vertical edge.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor a horizontal edge to a vertical edge.");
return false;
} else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
return false;
} else if (anchor.item == item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor item to self.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor item to self.");
return false;
}
@@ -1022,13 +1022,13 @@ bool QmlGraphicsAnchorsPrivate::checkVValid() const
if (usedAnchors & QmlGraphicsAnchors::HasTopAnchor &&
usedAnchors & QmlGraphicsAnchors::HasBottomAnchor &&
usedAnchors & QmlGraphicsAnchors::HasVCenterAnchor) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't specify top, bottom, and vcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot specify top, bottom, and vcenter anchors.");
return false;
} else if (usedAnchors & QmlGraphicsAnchors::HasBaselineAnchor &&
(usedAnchors & QmlGraphicsAnchors::HasTopAnchor ||
usedAnchors & QmlGraphicsAnchors::HasBottomAnchor ||
usedAnchors & QmlGraphicsAnchors::HasVCenterAnchor)) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.");
return false;
}
@@ -1038,16 +1038,16 @@ bool QmlGraphicsAnchorsPrivate::checkVValid() const
bool QmlGraphicsAnchorsPrivate::checkVAnchorValid(QmlGraphicsAnchorLine anchor) const
{
if (!anchor.item) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to a null item.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to a null item.");
return false;
} else if (anchor.anchorLine & QmlGraphicsAnchorLine::Horizontal_Mask) {
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor a vertical edge to a horizontal edge.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor a vertical edge to a horizontal edge.");
return false;
} else if (anchor.item != item->parentItem() && anchor.item->parentItem() != item->parentItem()){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor to an item that isn't a parent or sibling.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor to an item that isn't a parent or sibling.");
return false;
} else if (anchor.item == item){
- qmlInfo(item) << QmlGraphicsAnchors::tr("Can't anchor item to self.");
+ qmlInfo(item) << QmlGraphicsAnchors::tr("Cannot anchor item to self.");
return false;
}
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 10150de..9990c06 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -730,7 +730,7 @@ bool QmlCompiler::buildObject(Object *obj, const BindingContext &ctxt)
compileState.parserStatusCount++;
// Check if this is a custom parser type. Custom parser types allow
- // assignments to non-existant properties. These assignments are then
+ // assignments to non-existent properties. These assignments are then
// compiled by the type.
bool isCustomParser = output->types.at(obj->type).type &&
output->types.at(obj->type).type->customParser() != 0;
@@ -1429,7 +1429,7 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
ctxt));
return true;
} else if (!type || !type->attachedPropertiesType()) {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existant attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
}
if (!prop->value)
@@ -1486,9 +1486,9 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop,
} else if (prop->index == -1) {
if (prop->isDefault) {
- COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant default property"));
+ COMPILE_EXCEPTION(prop->values.first(), QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent default property"));
} else {
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
}
} else if (prop->value) {
@@ -1534,7 +1534,7 @@ QmlCompiler::buildPropertyInNamespace(QmlEnginePrivate::ImportedNamespace *ns,
&type, 0, 0, 0);
if (!type || !type->attachedPropertiesType())
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existant attached object"));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Non-existent attached object"));
if (!prop->value)
COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Invalid attached object assignment"));
@@ -1841,7 +1841,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type,
foreach (Property *prop, obj->properties) {
int idx = type->metaObject()->indexOfProperty(prop->name.constData());
if (idx == -1)
- COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(prop->name)));
+ COMPILE_EXCEPTION(prop, QCoreApplication::translate("QmlCompiler","Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(prop->name)));
QMetaProperty p = type->metaObject()->property(idx);
prop->index = idx;
prop->type = p.userType();
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index 1c41d46..c373a8e 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -313,7 +313,7 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
Q_ASSERT(lastData);
if (!lastData->isValid()) {
- QString error = QLatin1String("Cannot assign to non-existant property \"") +
+ QString error = QLatin1String("Cannot assign to non-existent property \"") +
toString(name) + QLatin1Char('\"');
if (context())
context()->throwError(error);
@@ -628,11 +628,11 @@ QmlObjectMethodScriptClass::Value QmlObjectMethodScriptClass::call(Object *o, QS
for (int ii = 0; ii < argTypeNames.count(); ++ii) {
argTypes[ii] = QMetaType::type(argTypeNames.at(ii));
if (argTypes[ii] == QVariant::Invalid)
- return Value(ctxt, ctxt->throwError(QString(QLatin1String("Unknown method parameter type: %1")).arg(QLatin1String(argTypeNames.at(ii)))));
+ return Value(ctxt, ctxt->throwError(QString::fromLatin1("Unknown method parameter type: %1").arg(QLatin1String(argTypeNames.at(ii)))));
}
if (argTypes.count() > ctxt->argumentCount())
- return Value(ctxt, ctxt->throwError("Insufficient arguments"));
+ return Value(ctxt, ctxt->throwError(QLatin1String("Insufficient arguments")));
QVarLengthArray<MetaCallArgument, 9> args(argTypes.count() + 1);
args[0].initAsType(method->data.propType, engine);
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index abffefe..6609c73 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -77,7 +77,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
if (hasParams) {
QString easeName = curve.trimmed();
if (!easeName.endsWith(QLatin1Char(')'))) {
- qmlInfo(obj) << obj->tr("Unmatched parenthesis in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unmatched parenthesis in easing function \"%1\"").arg(curve);
return easingCurve;
}
@@ -86,7 +86,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
easeName.mid(idx + 1, easeName.length() - 1 - idx - 1);
normalizedCurve = easeName.left(idx);
if (!normalizedCurve.startsWith(QLatin1String("ease"))) {
- qmlInfo(obj) << obj->tr("Easing function \"%1\" must start with \"ease\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Easing function \"%1\" must start with \"ease\"").arg(curve);
return easingCurve;
}
@@ -101,7 +101,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
int value = me.keyToValue(normalizedCurve.toUtf8().constData());
if (value < 0) {
- qmlInfo(obj) << obj->tr("Unknown easing curve \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unknown easing curve \"%1\"").arg(curve);
return easingCurve;
}
easingCurve.setType((QEasingCurve::Type)value);
@@ -111,7 +111,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
int sep = str.indexOf(QLatin1Char(':'));
if (sep == -1) {
- qmlInfo(obj) << obj->tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
continue;
}
@@ -120,7 +120,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
qreal propValue = str.mid(sep + 1).trimmed().toDouble(&isOk);
if (propName.isEmpty() || !isOk) {
- qmlInfo(obj) << obj->tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Improperly specified parameter in easing function \"%1\"").arg(curve);
continue;
}
@@ -131,7 +131,7 @@ static QEasingCurve stringToCurve(const QString &curve, QObject *obj)
} else if (propName == QLatin1String("overshoot")) {
easingCurve.setOvershoot(propValue);
} else {
- qmlInfo(obj) << obj->tr("Unknown easing parameter \"%1\"").arg(propName);
+ qmlInfo(obj) << QmlPropertyAnimation::tr("Unknown easing parameter \"%1\"").arg(propName);
continue;
}
}
@@ -226,7 +226,7 @@ QmlMetaProperty QmlAbstractAnimationPrivate::createProperty(QObject *obj, const
{
QmlMetaProperty prop = QmlMetaProperty::createProperty(obj, str, qmlContext(infoObj));
if (!prop.isValid()) {
- qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate non-existant property \"%1\"").arg(str);
+ qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str);
return QmlMetaProperty();
} else if (!prop.isWritable()) {
qmlInfo(infoObj) << QmlAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str);
diff --git a/src/declarative/util/qmlbehavior.cpp b/src/declarative/util/qmlbehavior.cpp
index b9c77f5..e8feeaa 100644
--- a/src/declarative/util/qmlbehavior.cpp
+++ b/src/declarative/util/qmlbehavior.cpp
@@ -119,7 +119,7 @@ void QmlBehavior::setAnimation(QmlAbstractAnimation *animation)
{
Q_D(QmlBehavior);
if (d->animation) {
- qmlInfo(this) << tr("Can't change the animation assigned to a Behavior.");
+ qmlInfo(this) << tr("Cannot change the animation assigned to a Behavior.");
return;
}
diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp
index 68fc5cc..f1f39da 100644
--- a/src/declarative/util/qmlpropertychanges.cpp
+++ b/src/declarative/util/qmlpropertychanges.cpp
@@ -357,7 +357,7 @@ QmlPropertyChangesPrivate::property(const QByteArray &property)
Q_Q(QmlPropertyChanges);
QmlMetaProperty prop = QmlMetaProperty::createProperty(object, QString::fromUtf8(property));
if (!prop.isValid()) {
- qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(property));
+ qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(property));
return QmlMetaProperty();
} else if (!(prop.type() & QmlMetaProperty::SignalProperty) && !prop.isWritable()) {
qmlInfo(q) << QmlPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property));
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 35c8f7d..cefe2bc 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -82,7 +82,7 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
bool ok;
const QTransform &transform = target->itemTransform(targetParent, &ok);
if (transform.type() >= QTransform::TxShear || !ok) {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under complex transform");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under complex transform");
ok = false;
}
@@ -92,21 +92,21 @@ void QmlParentChangePrivate::doChange(QmlGraphicsItem *targetParent, QmlGraphics
if (transform.m11() == transform.m22())
scale = transform.m11();
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under non-uniform scale");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
} else if (ok && transform.type() == QTransform::TxRotate) {
if (transform.m11() == transform.m22())
scale = qSqrt(transform.m11()*transform.m11() + transform.m12()*transform.m12());
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under non-uniform scale");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under non-uniform scale");
ok = false;
}
if (scale != 0)
rotation = atan2(transform.m12()/scale, transform.m11()/scale) * 180/M_PI;
else {
- qmlInfo(q) << QObject::tr("Unable to preserve appearance under scale of 0");
+ qmlInfo(q) << QmlParentChange::tr("Unable to preserve appearance under scale of 0");
ok = false;
}
}
diff --git a/src/declarative/util/qmlxmllistmodel.cpp b/src/declarative/util/qmlxmllistmodel.cpp
index d31fadf..d586792 100644
--- a/src/declarative/util/qmlxmllistmodel.cpp
+++ b/src/declarative/util/qmlxmllistmodel.cpp
@@ -391,7 +391,7 @@ void QmlXmlRoleList::insert(int i, QmlXmlListModelRole *role)
{
QmlConcreteList<QmlXmlListModelRole *>::insert(i, role);
if (model->roleNames.contains(role->name())) {
- qmlInfo(role) << QObject::tr("\"%1\" duplicates a previous role name and will be disabled.").arg(role->name());
+ qmlInfo(role) << QCoreApplication::translate("QmlXmlRoleList", "\"%1\" duplicates a previous role name and will be disabled.").arg(role->name());
return;
}
model->roles.insert(i, model->highestRole);
@@ -551,7 +551,7 @@ void QmlXmlListModel::setQuery(const QString &query)
{
Q_D(QmlXmlListModel);
if (!query.startsWith(QLatin1Char('/'))) {
- qmlInfo(this) << tr("An XmlListModel query must start with '/' or \"//\"");
+ qmlInfo(this) << QCoreApplication::translate("QmlXmlRoleList", "An XmlListModel query must start with '/' or \"//\"");
return;
}
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 6cbf3d9..028ec48 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -149,11 +149,19 @@ void QS60WindowSurface::flush(QWidget *widget, const QRegion &region, const QPoi
Q_ASSERT(window);
QTLWExtra *topExtra = window->d_func()->maybeTopData();
Q_ASSERT(topExtra);
+ QRect qr = region.boundingRect();
if (!topExtra->inExpose) {
topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again
- TRect tr = qt_QRect2TRect(region.boundingRect());
+ TRect tr = qt_QRect2TRect(qr);
widget->winId()->DrawNow(tr);
topExtra->inExpose = false;
+ } else {
+ // This handles the case when syncBackingStore updates content outside of the
+ // original drawing rectangle. This might happen if there are pending update()
+ // events at the same time as we get a Draw() from Symbian.
+ QRect drawRect = qt_TRect2QRect(widget->winId()->DrawableWindow()->GetDrawRect());
+ if (!drawRect.contains(qr))
+ widget->winId()->DrawDeferred();
}
}
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 9025e5b..ea7399f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -289,6 +289,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter,
case SE_Editor:
drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth);
break;
+ case SE_DropArea:
+ drawPart(QS60StyleEnums::SP_QgnGrafOrgBgGrid, painter, rect, flags | SF_PointNorth);
+ break;
default:
break;
}
@@ -844,15 +847,18 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag
result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth));
break;
- case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed:
- case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
case QS60StyleEnums::SP_QsnCpScrollBgBottom:
- case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
case QS60StyleEnums::SP_QsnCpScrollBgTop:
case QS60StyleEnums::SP_QsnCpScrollHandleBottom:
- case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
case QS60StyleEnums::SP_QsnCpScrollHandleTop:
+ case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed:
+ result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
+ result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent));
+ break;
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed:
+ case QS60StyleEnums::SP_QsnCpScrollBgMiddle:
+ case QS60StyleEnums::SP_QsnCpScrollHandleMiddle:
result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent));
result.setWidth(pixelMetric(QStyle::PM_ScrollBarSliderMin));
break;
@@ -2271,14 +2277,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
QS60StyleEnums::SkinParts skinPart =
(option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper;
int minDimension = qMin(option->rect.width(), option->rect.height());
- const int resizeValue = minDimension >> 1;
- minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension));
- int verticalMagic(0);
- // magic values for positioning svg icon.
- if (option->rect.width() <= option->rect.height())
- verticalMagic = 3;
- iconRect.translate(3, verticalMagic - resizeValue);
+ const int magicTweak = 3;
+ int resizeValue = minDimension >> 1;
+ if (!QS60StylePrivate::isTouchSupported()) {
+ minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon.
+ iconRect.setSize(QSize(minDimension, minDimension));
+ const int verticalMagic = (option->rect.width() <= option->rect.height()) ? magicTweak : 0;
+ resizeValue = verticalMagic - resizeValue;
+ }
+ iconRect.translate(magicTweak, resizeValue);
QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags);
}
}
@@ -2302,7 +2310,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
break;
case PE_PanelScrollAreaCorner:
break;
-
+ case PE_IndicatorItemViewItemDrop:
+ if (QS60StylePrivate::isTouchSupported())
+ QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags);
+ else
+ commonStyleDraws = true;
+ break;
// todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
case PE_FrameLineEdit:
case PE_IndicatorDockWidgetResizeHandle:
@@ -2323,7 +2336,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
#endif //QT_NO_TOOLBAR
#ifndef QT_NO_COLUMNVIEW
case PE_IndicatorColumnViewArrow:
- case PE_IndicatorItemViewItemDrop:
#endif //QT_NO_COLUMNVIEW
case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt.
default:
@@ -2481,6 +2493,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
case SH_FormLayoutWrapPolicy:
retValue = QFormLayout::WrapLongRows;
break;
+ case SH_ScrollBar_ContextMenu:
+ retValue = false;
+ break;
default:
retValue = QCommonStyle::styleHint(sh, opt, widget, hret);
break;
@@ -2559,11 +2574,11 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
const int frameThickness = spinbox->frame ? pixelMetric(PM_SpinBoxFrameWidth, spinbox, widget) : 0;
const int buttonMargin = spinbox->frame ? 2 : 0;
- const int buttonWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
+ const int buttonContentWidth = QS60StylePrivate::pixelMetric(PM_ButtonIconSize) + 2 * buttonMargin;
QSize buttonSize;
buttonSize.setHeight(qMax(8, spinbox->rect.height() - frameThickness));
//width should at least be equal to height
- buttonSize.setWidth(qMax(buttonSize.height(), buttonWidth));
+ buttonSize.setWidth(qMax(buttonSize.height(), buttonContentWidth));
buttonSize = buttonSize.expandedTo(QApplication::globalStrut());
const int y = frameThickness + spinbox->rect.y();
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index eae2291..ea30b81 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -131,6 +131,7 @@ public:
SP_QgnGrafBarFrameSideL,
SP_QgnGrafBarFrameSideR,
SP_QgnGrafBarProgress,
+ SP_QgnGrafOrgBgGrid,
SP_QgnGrafScrollArrowDown,
SP_QgnGrafScrollArrowLeft,
SP_QgnGrafScrollArrowRight,
@@ -428,6 +429,7 @@ public:
SE_ScrollBarHandlePressedVertical,
SE_ButtonInactive,
SE_Editor,
+ SE_DropArea
};
enum SkinFrameElements {
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 6d9ba05..cb49fbc 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -178,6 +178,8 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
/* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1},
/* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1},
/* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_All, -1,-1},
+ // No drop area for 3.x non-touch devices
+ /* SP_QgnGrafOrgBgGrid */ {KAknsIIDNone, EDrawIcon, ES60_3_X, EAknsMajorGeneric ,0x1eba}, //KAknsIIDQgnGrafOrgBgGrid
/* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawGulIcon, ES60_All, -1,-1},
/* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawGulIcon, ES60_All, -1,-1},
/* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawGulIcon, ES60_All, -1,-1},
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 141f844..0ba8b9f 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1637,12 +1637,8 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
if (!hasEditFocus() && !(event->modifiers() & Qt::ControlModifier)) {
if (!event->text().isEmpty() && event->text().at(0).isPrint()
&& !isReadOnly())
- {
setEditFocus(true);
-#ifndef Q_OS_SYMBIAN
- clear();
-#endif
- } else {
+ else {
event->ignore();
return;
}
@@ -1698,12 +1694,8 @@ void QLineEdit::inputMethodEvent(QInputMethodEvent *e)
// commit text as they focus out without interfering with focus
if (QApplication::keypadNavigationEnabled()
&& hasFocus() && !hasEditFocus()
- && !e->preeditString().isEmpty()) {
+ && !e->preeditString().isEmpty())
setEditFocus(true);
-#ifndef Q_OS_SYMBIAN
- selectAll(); // so text is replaced rather than appended to
-#endif
- }
#endif
d->control->processInputMethodEvent(e);
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index 02ffe13..0d798b7 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -2394,7 +2394,7 @@ void QPlainTextEdit::setReadOnly(bool ro)
then the focus policy is also automatically set to Qt::ClickFocus.
The default value depends on whether the QPlainTextEdit is read-only
- or editable, and whether it is a QTextBrowser or not.
+ or editable.
*/
void QPlainTextEdit::setTextInteractionFlags(Qt::TextInteractionFlags flags)
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index b6886b4..4541730 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -1212,12 +1212,9 @@ void QTextEdit::keyPressEvent(QKeyEvent *e)
default:
if (QApplication::keypadNavigationEnabled()) {
if (!hasEditFocus() && !(e->modifiers() & Qt::ControlModifier)) {
- if (e->text()[0].isPrint()) {
+ if (e->text()[0].isPrint())
setEditFocus(true);
-#ifndef Q_OS_SYMBIAN
- clear();
-#endif
- } else {
+ else {
e->ignore();
return;
}
@@ -1677,12 +1674,8 @@ void QTextEdit::inputMethodEvent(QInputMethodEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
if (d->control->textInteractionFlags() & Qt::TextEditable
&& QApplication::keypadNavigationEnabled()
- && !hasEditFocus()) {
+ && !hasEditFocus())
setEditFocus(true);
-#ifndef Q_OS_SYMBIAN
- selectAll(); // so text is replaced rather than appended to
-#endif
- }
#endif
d->sendControlEvent(e);
ensureCursorVisible();
diff --git a/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp b/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp
index 17a1453..a00e911 100644
--- a/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp
+++ b/tests/auto/declarative/qmlanimations/tst_qmlanimations.cpp
@@ -308,7 +308,7 @@ void tst_animations::badProperties()
QmlEngine engine;
QmlComponent c1(&engine, QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml"));
- QByteArray message = "QML ColorAnimation (" + QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9) Cannot animate non-existant property \"border.colr\"";
+ QByteArray message = "QML ColorAnimation (" + QUrl::fromLocalFile(SRCDIR "/data/badproperty1.qml").toString().toUtf8() + ":18:9) Cannot animate non-existent property \"border.colr\"";
QTest::ignoreMessage(QtWarningMsg, message);
QTest::ignoreMessage(QtWarningMsg, message); // why twice?
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c1.create());
@@ -546,8 +546,8 @@ void tst_animations::easingStringConversion()
QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve().type(), QEasingCurve::InOutElastic);
QVERIFY(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve().amplitude() != qreal(5));
- QTest::ignoreMessage(QtWarningMsg, "QML NumberAnimation (unknown location) Unknown easing parameter \"nonexistantproperty\"");
- animation->setEasing("easeOutQuad(nonexistantproperty: 12)");
+ QTest::ignoreMessage(QtWarningMsg, "QML NumberAnimation (unknown location) Unknown easing parameter \"nonexistentproperty\"");
+ animation->setEasing("easeOutQuad(nonexistentproperty: 12)");
QCOMPARE(static_cast<QVariantAnimation*>(((QmlAbstractAnimation*)animation)->qtAnimation())->easingCurve().type(), QEasingCurve::OutQuad);
delete animation;
diff --git a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
index 61023a2..73ab35e 100644
--- a/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
+++ b/tests/auto/declarative/qmlbehaviors/tst_qmlbehaviors.cpp
@@ -254,7 +254,7 @@ void tst_behaviors::reassignedAnimation()
{
QmlEngine engine;
QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml"));
- QTest::ignoreMessage(QtWarningMsg, QString("QML Behavior (" + QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:12) Can't change the animation assigned to a Behavior.").toUtf8().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString("QML Behavior (" + QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:12) Cannot change the animation assigned to a Behavior.").toUtf8().constData());
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
QVERIFY(rect);
QCOMPARE(qobject_cast<QmlNumberAnimation*>(
diff --git a/tests/auto/declarative/qmldom/tst_qmldom.cpp b/tests/auto/declarative/qmldom/tst_qmldom.cpp
index ce35130..eb4d419 100644
--- a/tests/auto/declarative/qmldom/tst_qmldom.cpp
+++ b/tests/auto/declarative/qmldom/tst_qmldom.cpp
@@ -394,7 +394,7 @@ void tst_qmldom::loadErrors()
QCOMPARE(error.url(), QUrl());
QCOMPARE(error.line(), 3);
QCOMPARE(error.column(), 3);
- QCOMPARE(error.description(), QString("Cannot assign to non-existant property \"foo\""));
+ QCOMPARE(error.description(), QString("Cannot assign to non-existent property \"foo\""));
}
// Test loading a file with syntax errors
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
index e5472bb..a6baf10 100644
--- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
+++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp
@@ -572,7 +572,7 @@ void tst_qmlecmascript::enums()
QCOMPARE(object->property("i").toInt(), 19);
QCOMPARE(object->property("j").toInt(), 19);
}
- // Non-existant enums
+ // Non-existent enums
{
QmlComponent component(&engine, TEST_FILE("enums.2.qml"));
@@ -680,7 +680,7 @@ void tst_qmlecmascript::outerBindingOverridesInnerBinding()
}
/*
-Access a non-existant attached object.
+Access a non-existent attached object.
Tests for a regression where this used to crash.
*/
@@ -928,7 +928,7 @@ void tst_qmlecmascript::scriptErrors()
QString warning5 = url + ":10: TypeError: Result of expression 'a' [undefined] is not an object.";
QString warning6 = url + ":9: Unable to assign [undefined] to int";
QString warning7 = url + ":14: Error: Cannot assign to read-only property \"trueProperty\"";
- QString warning8 = url + ":15: Error: Cannot assign to non-existant property \"fakeProperty\"";
+ QString warning8 = url + ":15: Error: Cannot assign to non-existent property \"fakeProperty\"";
QTest::ignoreMessage(QtWarningMsg, warning1.toLatin1().constData());
QTest::ignoreMessage(QtWarningMsg, warning2.toLatin1().constData());
@@ -1207,15 +1207,15 @@ void tst_qmlecmascript::callQtInvokables()
QScriptEngine *engine = &ep->scriptEngine;
ep->globalClass->explicitSetProperty("object", ep->objectClass->newQObject(&o));
- // Non-existant methods
+ // Non-existent methods
o.reset();
- QCOMPARE(engine->evaluate("object.method_nonexistant()").isError(), true);
+ QCOMPARE(engine->evaluate("object.method_nonexistent()").isError(), true);
QCOMPARE(o.error(), false);
QCOMPARE(o.invoked(), -1);
QCOMPARE(o.actuals().count(), 0);
o.reset();
- QCOMPARE(engine->evaluate("object.method_nonexistant(10, 11)").isError(), true);
+ QCOMPARE(engine->evaluate("object.method_nonexistent(10, 11)").isError(), true);
QCOMPARE(o.error(), false);
QCOMPARE(o.invoked(), -1);
QCOMPARE(o.actuals().count(), 0);
diff --git a/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp b/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp
index 5850cf0..70e70d0 100644
--- a/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp
+++ b/tests/auto/declarative/qmlgraphicsanchors/tst_qmlgraphicsanchors.cpp
@@ -223,55 +223,55 @@ void tst_anchors::illegalSets_data()
QTest::newRow("H - too many anchors")
<< "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }"
- << "QML Rectangle (file::2:23) Can't specify left, right, and hcenter anchors.";
+ << "QML Rectangle (file::2:23) Cannot specify left, right, and hcenter anchors.";
foreach (const QString &side, QStringList() << "left" << "right") {
QTest::newRow("H - anchor to V")
<< QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side)
- << "QML Rectangle (file::2:13) Can't anchor a horizontal edge to a vertical edge.";
+ << "QML Rectangle (file::2:13) Cannot anchor a horizontal edge to a vertical edge.";
QTest::newRow("H - anchor to non parent/sibling")
<< QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
- << "QML Rectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling.";
+ << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("H - anchor to self")
<< QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
- << "QML Rectangle (file::2:1) Can't anchor item to self.";
+ << "QML Rectangle (file::2:1) Cannot anchor item to self.";
}
QTest::newRow("V - too many anchors")
<< "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }"
- << "QML Rectangle (file::2:23) Can't specify top, bottom, and vcenter anchors.";
+ << "QML Rectangle (file::2:23) Cannot specify top, bottom, and vcenter anchors.";
QTest::newRow("V - too many anchors with baseline")
<< "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }"
- << "QML Text (file::2:47) Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors.";
+ << "QML Text (file::2:47) Baseline anchor cannot be used in conjunction with top, bottom, or vcenter anchors.";
foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") {
QTest::newRow("V - anchor to H")
<< QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side)
- << "QML Rectangle (file::2:13) Can't anchor a vertical edge to a horizontal edge.";
+ << "QML Rectangle (file::2:13) Cannot anchor a vertical edge to a horizontal edge.";
QTest::newRow("V - anchor to non parent/sibling")
<< QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side)
- << "QML Rectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling.";
+ << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("V - anchor to self")
<< QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side)
- << "QML Rectangle (file::2:1) Can't anchor item to self.";
+ << "QML Rectangle (file::2:1) Cannot anchor item to self.";
}
QTest::newRow("centerIn - anchor to non parent/sibling")
<< "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }"
- << "QML Rectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling.";
+ << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling.";
QTest::newRow("fill - anchor to non parent/sibling")
<< "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }"
- << "QML Rectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling.";
+ << "QML Rectangle (file::2:45) Cannot anchor to an item that isn't a parent or sibling.";
}
void tst_anchors::reset()
@@ -348,7 +348,7 @@ void tst_anchors::nullItem()
const QMetaObject *meta = item->anchors()->metaObject();
QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData()));
- QTest::ignoreMessage(QtWarningMsg, "QML Item (unknown location) Can't anchor to a null item.");
+ QTest::ignoreMessage(QtWarningMsg, "QML Item (unknown location) Cannot anchor to a null item.");
QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor)));
delete item;
diff --git a/tests/auto/declarative/qmlgraphicsloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qmlgraphicsloader/data/NoResizeGraphicsWidget.qml
index 0704e18..5eab965 100644
--- a/tests/auto/declarative/qmlgraphicsloader/data/NoResizeGraphicsWidget.qml
+++ b/tests/auto/declarative/qmlgraphicsloader/data/NoResizeGraphicsWidget.qml
@@ -1,8 +1,8 @@
-import Qt 4.6
-
-Loader {
- resizeMode: Loader.NoResize
- source: "GraphicsWidget250x250.qml"
- width: 200
- height: 80
-}
+import Qt 4.6
+
+Loader {
+ resizeMode: Loader.NoResize
+ source: "GraphicsWidget250x250.qml"
+ width: 200
+ height: 80
+}
diff --git a/tests/auto/declarative/qmlgraphicsloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qmlgraphicsloader/data/SizeGraphicsWidgetToLoader.qml
index 97c72f4..568a136 100644
--- a/tests/auto/declarative/qmlgraphicsloader/data/SizeGraphicsWidgetToLoader.qml
+++ b/tests/auto/declarative/qmlgraphicsloader/data/SizeGraphicsWidgetToLoader.qml
@@ -1,8 +1,8 @@
-import Qt 4.6
-
-Loader {
- resizeMode: Loader.SizeItemToLoader
- width: 200
- height: 80
- source: "GraphicsWidget250x250.qml"
-}
+import Qt 4.6
+
+Loader {
+ resizeMode: Loader.SizeItemToLoader
+ width: 200
+ height: 80
+ source: "GraphicsWidget250x250.qml"
+}
diff --git a/tests/auto/declarative/qmlgraphicsloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qmlgraphicsloader/data/SizeLoaderToGraphicsWidget.qml
index cb72f05..a710803 100644
--- a/tests/auto/declarative/qmlgraphicsloader/data/SizeLoaderToGraphicsWidget.qml
+++ b/tests/auto/declarative/qmlgraphicsloader/data/SizeLoaderToGraphicsWidget.qml
@@ -1,6 +1,6 @@
-import Qt 4.6
-
-Loader {
- resizeMode: Loader.SizeLoaderToItem
- source: "GraphicsWidget250x250.qml"
-}
+import Qt 4.6
+
+Loader {
+ resizeMode: Loader.SizeLoaderToItem
+ source: "GraphicsWidget250x250.qml"
+}
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt
index 68fe671..492bbb4 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt
@@ -1 +1 @@
-5:17:Cannot assign to non-existant property "foo"
+5:17:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt
index 7f630f4..ff2409b 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt
@@ -1 +1 @@
-5:15:Non-existant attached object
+5:15:Non-existent attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt
index 9f06e07..34de769 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt
@@ -1 +1 @@
-5:27:Cannot assign to non-existant property "foo"
+5:27:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt
index e232b23..6770e1f 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt
@@ -1 +1 @@
-5:5:Non-existant attached object
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt
index e232b23..6770e1f 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt
@@ -1 +1 @@
-5:5:Non-existant attached object
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt
index 7f630f4..ff2409b 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt
@@ -1 +1 @@
-5:15:Non-existant attached object
+5:15:Non-existent attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt
index e232b23..6770e1f 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt
@@ -1 +1 @@
-5:5:Non-existant attached object
+5:5:Non-existent attached object
diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt
index 19934fa..69c6871 100644
--- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt
@@ -1 +1 @@
-4:5:Cannot assign to non-existant property "foo"
+4:5:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt
index e243ae5..f562246 100644
--- a/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/missingSignal.errors.txt
@@ -1 +1 @@
-4:5:Cannot assign to non-existant property "onClicked"
+4:5:Cannot assign to non-existent property "onClicked"
diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt
index dfaa218..caf7e55 100644
--- a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt
@@ -1 +1 @@
-4:18:Cannot assign to non-existant property "foo"
+4:18:Cannot assign to non-existent property "foo"
diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt
index cfc6fc8..6bfce9a 100644
--- a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.1.errors.txt
@@ -1 +1 @@
-2:15:Cannot assign to non-existant property "something"
+2:15:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt
index 8b13585..4b30056 100644
--- a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.2.errors.txt
@@ -1 +1 @@
-3:5:Cannot assign to non-existant property "something"
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt
index 8b13585..4b30056 100644
--- a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.3.errors.txt
@@ -1 +1 @@
-3:5:Cannot assign to non-existant property "something"
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt
index 8b13585..4b30056 100644
--- a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.4.errors.txt
@@ -1 +1 @@
-3:5:Cannot assign to non-existant property "something"
+3:5:Cannot assign to non-existent property "something"
diff --git a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt
index c02d7bd..89925b7 100644
--- a/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt
+++ b/tests/auto/declarative/qmllanguage/data/nonexistantProperty.6.errors.txt
@@ -1 +1 @@
-3:5:Cannot assign to non-existant default property
+3:5:Cannot assign to non-existent default property
diff --git a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
index fc348a5..4e4f3fb 100644
--- a/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
+++ b/tests/auto/declarative/qmlstates/tst_qmlstates.cpp
@@ -731,7 +731,7 @@ void tst_states::propertyErrors()
QCOMPARE(rect->color(),QColor("red"));
- QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/propertyErrors.qml") + ":8:9) Cannot assign to non-existant property \"colr\"").constData());
+ QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/propertyErrors.qml") + ":8:9) Cannot assign to non-existent property \"colr\"").constData());
QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/propertyErrors.qml") + ":8:9) Cannot assign to read-only property \"wantsFocus\"").constData());
rect->setState("blue");
}
@@ -877,7 +877,7 @@ void tst_states::nonExistantProperty()
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create());
QVERIFY(rect != 0);
- QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/nonExistantProp.qml") + ":9:9) Cannot assign to non-existant property \"colr\"").constData());
+ QTest::ignoreMessage(QtWarningMsg, QByteArray("QML PropertyChanges (" + fullDataPath("/data/nonExistantProp.qml") + ":9:9) Cannot assign to non-existent property \"colr\"").constData());
rect->setState("blue");
QCOMPARE(rect->state(), QLatin1String("blue"));
}
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 3b6400a..6dc2c82 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -3640,6 +3640,26 @@ void tst_QLineEdit::taskQTBUG_4679_selectToStartEndOfBlock()
#endif // Q_OS_MAC
}
+#ifndef QT_NO_CONTEXTMENU
+void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash()
+{
+ // Would pass before the associated commit, but left as a guard.
+ QLineEdit *w = new QLineEdit;
+ w->show();
+ QTest::qWaitForWindowShown(w);
+
+ QTimer ti;
+ w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
+ ti.start(200);
+
+ QContextMenuEvent *cme = new QContextMenuEvent(QContextMenuEvent::Mouse, w->rect().center());
+ qApp->postEvent(w, cme);
+
+ QTest::qWait(300);
+ // No crash, it's allright.
+}
+#endif
+
void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
{
//ReadOnly QLineEdit should not intercept shortcut.
@@ -3661,25 +3681,5 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut()
QCOMPARE(spy.count(), 1);
}
-#ifndef QT_NO_CONTEXTMENU
-void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash()
-{
- // Would pass before the associated commit, but left as a guard.
- QLineEdit *w = new QLineEdit;
- w->show();
- QTest::qWaitForWindowShown(w);
-
- QTimer ti;
- w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
- ti.start(200);
-
- QContextMenuEvent *cme = new QContextMenuEvent(QContextMenuEvent::Mouse, w->rect().center());
- qApp->postEvent(w, cme);
-
- QTest::qWait(300);
- // No crash, it's allright.
-}
-#endif
-
QTEST_MAIN(tst_QLineEdit)
#include "tst_qlineedit.moc"
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index e318d02..01d5cd5 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -5,6 +5,5 @@ SUBDIRS = \
network \
script \
svg
-
contains(QT_CONFIG, opengl): SUBDIRS += opengl
contains(QT_CONFIG, declarative): SUBDIRS += declarative
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp
index 76211c5..a181c71 100644
--- a/tools/assistant/tools/assistant/helpenginewrapper.cpp
+++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp
@@ -112,6 +112,7 @@ private:
QFileSystemWatcher * const m_qchWatcher;
typedef QPair<QDateTime, QSharedPointer<TimeoutForwarder> > RecentSignal;
QMap<QString, RecentSignal> m_recentQchUpdates;
+ bool m_initialReindexingNeeded;
};
const QString HelpEngineWrapper::TrUnfiltered = tr("Unfiltered");
@@ -141,6 +142,18 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile)
: d(new HelpEngineWrapperPrivate(collectionFile))
{
TRACE_OBJ
+
+ /*
+ * Otherwise we will waste time if several new docs are found,
+ * because we will start to index them, only to be interupted
+ * by the next request. Also, there is a nasty SQLITE bug that will
+ * cause the application to hang for minutes in that case.
+ * This call is reverted by initalDocSetupDone(), which must be
+ * called after the new docs have been installed.
+ */
+ disconnect(d->m_helpEngine, SIGNAL(setupFinished()),
+ searchEngine(), SLOT(indexDocumentation()));
+
connect(d, SIGNAL(documentationRemoved(QString)),
this, SIGNAL(documentationRemoved(QString)));
connect(d, SIGNAL(documentationUpdated(QString)),
@@ -157,6 +170,15 @@ HelpEngineWrapper::~HelpEngineWrapper()
delete d;
}
+void HelpEngineWrapper::initialDocSetupDone()
+{
+ TRACE_OBJ
+ connect(d->m_helpEngine, SIGNAL(setupFinished()),
+ searchEngine(), SLOT(indexDocumentation()));
+ if (d->m_initialReindexingNeeded)
+ setupData();
+}
+
QHelpSearchEngine *HelpEngineWrapper::searchEngine() const
{
TRACE_OBJ
@@ -207,6 +229,7 @@ bool HelpEngineWrapper::registerDocumentation(const QString &docFile)
return false;
d->m_qchWatcher->addPath(docFile);
d->checkDocFilesWatched();
+ d->m_initialReindexingNeeded = true;
return true;
}
@@ -219,6 +242,7 @@ bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName)
return false;
d->m_qchWatcher->removePath(file);
d->checkDocFilesWatched();
+ d->m_initialReindexingNeeded = true;
return true;
}
@@ -698,7 +722,8 @@ void TimeoutForwarder::forward()
HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile)
: m_helpEngine(new QHelpEngine(collectionFile, this)),
- m_qchWatcher(new QFileSystemWatcher(this))
+ m_qchWatcher(new QFileSystemWatcher(this)),
+ m_initialReindexingNeeded(false)
{
TRACE_OBJ
if (!m_helpEngine->customFilters().contains(Unfiltered))
@@ -797,6 +822,7 @@ void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName,
} else {
emit documentationUpdated(ns);
}
+ m_initialReindexingNeeded = true;
m_helpEngine->setupData();
}
m_recentQchUpdates.erase(it);
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h
index a30fab8..8d95273 100644
--- a/tools/assistant/tools/assistant/helpenginewrapper.h
+++ b/tools/assistant/tools/assistant/helpenginewrapper.h
@@ -101,6 +101,12 @@ public:
const QStringList filterAttributes(const QString &filterName) const;
QString error() const;
+ /*
+ * To be called after assistant has finished looking for new documentation.
+ * This will mainly cause the search index to be updated, if necessary.
+ */
+ void initialDocSetupDone();
+
const QStringList qtDocInfo(const QString &component) const;
void setQtDocInfo(const QString &component, const QStringList &doc);
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index 4115d39..8096218 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -354,8 +354,6 @@ void MainWindow::lookForNewQtDocumentation()
void MainWindow::qtDocumentationInstalled(bool newDocsInstalled)
{
TRACE_OBJ
- if (newDocsInstalled)
- HelpEngineWrapper::instance().setupData();
statusBar()->clearMessage();
checkInitState();
}
@@ -383,6 +381,7 @@ void MainWindow::checkInitState()
}
emit initDone();
}
+ HelpEngineWrapper::instance().initialDocSetupDone();
}
void MainWindow::insertLastPages()
diff --git a/tools/designer/src/components/formeditor/formeditor.pri b/tools/designer/src/components/formeditor/formeditor.pri
index bbe96d5..b1a9318 100644
--- a/tools/designer/src/components/formeditor/formeditor.pri
+++ b/tools/designer/src/components/formeditor/formeditor.pri
@@ -8,6 +8,7 @@ FORMS += $$PWD/deviceprofiledialog.ui \
$$PWD/templateoptionspage.ui
HEADERS += $$PWD/qdesigner_resource.h \
+ $$PWD/qdesignerundostack.h \
$$PWD/formwindow.h \
$$PWD/formwindow_widgetstack.h \
$$PWD/formwindow_dnditem.h \
@@ -41,6 +42,7 @@ HEADERS += $$PWD/qdesigner_resource.h \
$$PWD/templateoptionspage.h
SOURCES += $$PWD/qdesigner_resource.cpp \
+ $$PWD/qdesignerundostack.cpp \
$$PWD/formwindow.cpp \
$$PWD/formwindow_widgetstack.cpp \
$$PWD/formwindow_dnditem.cpp \
diff --git a/tools/designer/src/components/formeditor/formwindow.cpp b/tools/designer/src/components/formeditor/formwindow.cpp
index 3a7cd83..631ca7c 100644
--- a/tools/designer/src/components/formeditor/formwindow.cpp
+++ b/tools/designer/src/components/formeditor/formwindow.cpp
@@ -399,8 +399,7 @@ void FormWindow::setCursorToAll(const QCursor &c, QWidget *start)
void FormWindow::init()
{
if (FormWindowManager *manager = qobject_cast<FormWindowManager*> (core()->formWindowManager())) {
- m_commandHistory = new QUndoStack(this);
- manager->undoGroup()->addStack(m_commandHistory);
+ manager->undoGroup()->addStack(m_undoStack.qundoStack());
}
m_blockSelectionChanged = false;
@@ -429,9 +428,8 @@ void FormWindow::init()
m_mainContainer = 0;
m_currentWidget = 0;
- connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SLOT(updateDirty()));
- connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SIGNAL(changed()));
- connect(m_commandHistory, SIGNAL(indexChanged(int)), this, SLOT(checkSelection()));
+ connect(&m_undoStack, SIGNAL(changed()), this, SIGNAL(changed()));
+ connect(&m_undoStack, SIGNAL(changed()), this, SLOT(checkSelection()));
core()->metaDataBase()->add(this);
@@ -1227,14 +1225,14 @@ void FormWindow::insertWidget(QWidget *w, const QRect &rect, QWidget *container,
if (w->parentWidget() != container) {
ReparentWidgetCommand *cmd = new ReparentWidgetCommand(this);
cmd->init(w, container);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
- m_commandHistory->push(geom_cmd);
+ m_undoStack.push(geom_cmd);
InsertWidgetCommand *cmd = new InsertWidgetCommand(this);
cmd->init(w, already_in_form);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
endCommand();
@@ -1277,12 +1275,10 @@ void FormWindow::resizeWidget(QWidget *widget, const QRect &geometry)
Q_ASSERT(isDescendant(this, widget));
QRect r = geometry;
- if (m_lastIndex > m_commandHistory->index())
- m_lastIndex = -1;
SetPropertyCommand *cmd = new SetPropertyCommand(this);
cmd->init(widget, QLatin1String("geometry"), r);
cmd->setText(tr("Resize"));
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
void FormWindow::raiseChildSelections(QWidget *w)
@@ -1428,26 +1424,117 @@ int FormWindow::calcValue(int val, bool forward, bool snap, int snapOffset) cons
return (forward ? val + 1 : val - 1);
}
-QRect FormWindow::applyValue(const QRect &rect, int val, int key, bool size) const
+// ArrowKeyOperation: Stores a keyboard move or resize (Shift pressed)
+// operation.
+struct ArrowKeyOperation {
+ ArrowKeyOperation() : resize(false), distance(0), arrowKey(Qt::Key_Left) {}
+
+ QRect apply(const QRect &in) const;
+
+ bool resize; // Resize: Shift-Key->drag bottom/right corner, else just move
+ int distance;
+ int arrowKey;
+};
+
+QRect ArrowKeyOperation::apply(const QRect &rect) const
{
QRect r = rect;
- if (size) {
- if (key == Qt::Key_Left || key == Qt::Key_Right)
- r.setWidth(val);
+ if (resize) {
+ if (arrowKey == Qt::Key_Left || arrowKey == Qt::Key_Right)
+ r.setWidth(r.width() + distance);
else
- r.setHeight(val);
+ r.setHeight(r.height() + distance);
} else {
- if (key == Qt::Key_Left || key == Qt::Key_Right)
- r.moveLeft(val);
+ if (arrowKey == Qt::Key_Left || arrowKey == Qt::Key_Right)
+ r.moveLeft(r.x() + distance);
else
- r.moveTop(val);
+ r.moveTop(r.y() + distance);
}
return r;
}
+QDebug operator<<(QDebug in, const ArrowKeyOperation &op)
+{
+ in.nospace() << "Resize=" << op.resize << " dist=" << op.distance << " Key=" << op.arrowKey << ' ';
+ return in;
+}
+
+// ArrowKeyPropertyHelper: Applies a struct ArrowKeyOperation
+// (stored as new value) to a list of widgets using to calculate the
+// changed geometry of the widget in setValue(). Thus, the 'newValue'
+// of the property command is the relative move distance, which is the same
+// for all widgets (although resulting in different geometries for the widgets).
+// The command merging can then work as it would when applying the same text
+// to all QLabels.
+
+class ArrowKeyPropertyHelper : public PropertyHelper {
+public:
+ ArrowKeyPropertyHelper(QObject* o, SpecialProperty sp,
+ QDesignerPropertySheetExtension *s, int i) :
+ PropertyHelper(o, sp, s, i) {}
+
+ virtual Value setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask);
+};
+
+PropertyHelper::Value ArrowKeyPropertyHelper::setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask)
+{
+ // Apply operation to obtain the new geometry value.
+ QWidget *w = qobject_cast<QWidget*>(object());
+ const ArrowKeyOperation operation = qvariant_cast<ArrowKeyOperation>(value);
+ const QRect newGeom = operation.apply(w->geometry());
+ return PropertyHelper::setValue(fw, QVariant(newGeom), changed, subPropertyMask);
+}
+
+// ArrowKeyPropertyCommand: Helper factory overwritten to create
+// ArrowKeyPropertyHelper and a merge operation that merges values of
+// the same direction.
+class ArrowKeyPropertyCommand: public SetPropertyCommand {
+public:
+ explicit ArrowKeyPropertyCommand(QDesignerFormWindowInterface *fw,
+ QUndoCommand *p = 0);
+
+ void init(QWidgetList &l, const ArrowKeyOperation &op);
+
+protected:
+ virtual PropertyHelper *createPropertyHelper(QObject *o, SpecialProperty sp,
+ QDesignerPropertySheetExtension *s, int i) const
+ { return new ArrowKeyPropertyHelper(o, sp, s, i); }
+ virtual QVariant mergeValue(const QVariant &newValue);
+};
+
+ArrowKeyPropertyCommand::ArrowKeyPropertyCommand(QDesignerFormWindowInterface *fw,
+ QUndoCommand *p) :
+ SetPropertyCommand(fw, p)
+{
+ static const int mid = qRegisterMetaType<qdesigner_internal::ArrowKeyOperation>();
+ Q_UNUSED(mid)
+}
+
+void ArrowKeyPropertyCommand::init(QWidgetList &l, const ArrowKeyOperation &op)
+{
+ QObjectList ol;
+ foreach(QWidget *w, l)
+ ol.push_back(w);
+ SetPropertyCommand::init(ol, QLatin1String("geometry"), qVariantFromValue(op));
+
+ setText(op.resize ? FormWindow::tr("Key Resize") : FormWindow::tr("Key Move"));
+}
+
+QVariant ArrowKeyPropertyCommand::mergeValue(const QVariant &newMergeValue)
+{
+ // Merge move operations of the same arrow key
+ if (!qVariantCanConvert<ArrowKeyOperation>(newMergeValue))
+ return QVariant();
+ ArrowKeyOperation mergedOperation = qvariant_cast<ArrowKeyOperation>(newValue());
+ const ArrowKeyOperation newMergeOperation = qvariant_cast<ArrowKeyOperation>(newMergeValue);
+ if (mergedOperation.resize != newMergeOperation.resize || mergedOperation.arrowKey != newMergeOperation.arrowKey)
+ return QVariant();
+ mergedOperation.distance += newMergeOperation.distance;
+ return qVariantFromValue(mergedOperation);
+}
+
void FormWindow::handleArrowKeyEvent(int key, Qt::KeyboardModifiers modifiers)
{
- bool startMacro = false;
const QDesignerFormWindowCursorInterface *c = cursor();
if (!c->hasSelection())
return;
@@ -1480,57 +1567,14 @@ void FormWindow::handleArrowKeyEvent(int key, Qt::KeyboardModifiers modifiers)
const int newValue = calcValue(oldValue, forward, snap, snapPoint);
- const int offset = newValue - oldValue;
-
- const int selCount = selection.count();
- // check if selection is the same as last time
- if (selCount != m_moveSelection.count() ||
- m_lastUndoIndex != m_commandHistory->index()) {
- m_moveSelection.clear();
- startMacro = true;
- } else {
- for (int index = 0; index < selCount; ++index) {
- if (m_moveSelection[index]->object() != selection.at(index)) {
- m_moveSelection.clear();
- startMacro = true;
- break;
- }
- }
- }
-
- if (startMacro)
- beginCommand(tr("Key Move"));
-
- for (int index = 0; index < selCount; ++index) {
- QWidget *w = selection.at(index);
- const QRect oldGeom = w->geometry();
- const QRect geom = applyValue(oldGeom, getValue(oldGeom, key, size) + offset, key, size);
-
- SetPropertyCommand *cmd = 0;
-
- if (m_moveSelection.count() > index)
- cmd = m_moveSelection[index];
-
- if (!cmd) {
- cmd = new SetPropertyCommand(this);
- cmd->init(w, QLatin1String("geometry"), geom);
- cmd->setText(tr("Key Move"));
- m_commandHistory->push(cmd);
+ ArrowKeyOperation operation;
+ operation.resize = modifiers & Qt::ShiftModifier;
+ operation.distance = newValue - oldValue;
+ operation.arrowKey = key;
- if (m_moveSelection.count() > index)
- m_moveSelection.replace(index, cmd);
- else
- m_moveSelection.append(cmd);
- } else {
- cmd->setNewValue(geom);
- cmd->redo();
- }
- }
-
- if (startMacro) {
- endCommand();
- m_lastUndoIndex = m_commandHistory->index();
- }
+ ArrowKeyPropertyCommand *cmd = new ArrowKeyPropertyCommand(this);
+ cmd->init(selection, operation);
+ m_undoStack.push(cmd);
}
bool FormWindow::handleKeyReleaseEvent(QWidget *, QWidget *, QKeyEvent *e)
@@ -1809,7 +1853,7 @@ void FormWindow::paste(PasteMode pasteMode)
foreach (QWidget *w, clipboard.m_widgets) {
InsertWidgetCommand *cmd = new InsertWidgetCommand(this);
cmd->init(w);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
selectWidget(w);
}
}
@@ -1819,7 +1863,7 @@ void FormWindow::paste(PasteMode pasteMode)
ensureUniqueObjectName(a);
AddActionCommand *cmd = new AddActionCommand(this);
cmd->init(a);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
endCommand();
} while (false);
@@ -1955,14 +1999,12 @@ void FormWindow::breakLayout(QWidget *w)
void FormWindow::beginCommand(const QString &description)
{
- if (m_lastIndex > m_commandHistory->index())
- m_lastIndex = -1;
- m_commandHistory->beginMacro(description);
+ m_undoStack.beginMacro(description);
}
void FormWindow::endCommand()
{
- m_commandHistory->endMacro();
+ m_undoStack.endMacro();
}
void FormWindow::raiseWidgets()
@@ -1977,7 +2019,7 @@ void FormWindow::raiseWidgets()
foreach (QWidget *widget, widgets) {
RaiseWidgetCommand *cmd = new RaiseWidgetCommand(this);
cmd->init(widget);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
endCommand();
}
@@ -1994,7 +2036,7 @@ void FormWindow::lowerWidgets()
foreach (QWidget *widget, widgets) {
LowerWidgetCommand *cmd = new LowerWidgetCommand(this);
cmd->init(widget);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
endCommand();
}
@@ -2375,20 +2417,12 @@ FormWindow *FormWindow::findFormWindow(QWidget *w)
bool FormWindow::isDirty() const
{
- return m_dirty;
+ return m_undoStack.isDirty();
}
void FormWindow::setDirty(bool dirty)
{
- m_dirty = dirty;
-
- if (!m_dirty)
- m_lastIndex = m_commandHistory->index();
-}
-
-void FormWindow::updateDirty()
-{
- m_dirty = m_commandHistory->index() != m_lastIndex;
+ m_undoStack.setDirty(dirty);
}
QWidget *FormWindow::containerAt(const QPoint &pos)
@@ -2757,7 +2791,7 @@ bool FormWindow::dropDockWidget(QDesignerDnDItemInterface *item, const QPoint &g
qVariantSetValue(v, e);
SetPropertyCommand *cmd = new SetPropertyCommand(this);
cmd->init(widget, dockWidgetAreaName, v);
- m_commandHistory->push(cmd);
+ m_undoStack.push(cmd);
}
endCommand();
@@ -2921,6 +2955,13 @@ QWidget *FormWindow::formContainer() const
return m_widgetStack->formContainer();
}
+QUndoStack *FormWindow::commandHistory() const
+{
+ return const_cast<QDesignerUndoStack &>(m_undoStack).qundoStack();
+}
+
} // namespace
QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(qdesigner_internal::ArrowKeyOperation)
diff --git a/tools/designer/src/components/formeditor/formwindow.h b/tools/designer/src/components/formeditor/formwindow.h
index 3eee476..dc0026f 100644
--- a/tools/designer/src/components/formeditor/formwindow.h
+++ b/tools/designer/src/components/formeditor/formwindow.h
@@ -43,6 +43,7 @@
#define FORMWINDOW_H
#include "formeditor_global.h"
+#include "qdesignerundostack.h"
#include <formwindowbase_p.h>
// Qt
@@ -64,7 +65,6 @@ class QLabel;
class QTimer;
class QAction;
class QMenu;
-class QUndoStack;
class QRubberBand;
namespace qdesigner_internal {
@@ -165,9 +165,7 @@ public:
void manageWidget(QWidget *w);
void unmanageWidget(QWidget *w);
- inline QUndoStack *commandHistory() const
- { return m_commandHistory; }
-
+ virtual QUndoStack *commandHistory() const;
void beginCommand(const QString &description);
void endCommand();
@@ -238,7 +236,6 @@ protected:
private slots:
void selectionChangedTimerDone();
- void updateDirty();
void checkSelection();
void checkSelectionNow();
void slotSelectWidget(QAction *);
@@ -263,7 +260,6 @@ private:
int getValue(const QRect &rect, int key, bool size) const;
int calcValue(int val, bool forward, bool snap, int snapOffset) const;
- QRect applyValue(const QRect &rect, int val, int key, bool size) const;
void handleClickSelection(QWidget *managedWidget, unsigned mouseFlags);
bool frameNeeded(QWidget *w) const;
@@ -338,7 +334,7 @@ private:
QPoint m_startPos;
- QUndoStack *m_commandHistory;
+ QDesignerUndoStack m_undoStack;
QString m_fileName;
@@ -352,9 +348,6 @@ private:
QTimer *m_checkSelectionTimer;
QTimer *m_geometryChangedTimer;
- int m_dirty;
- int m_lastIndex;
-
FormWindowWidgetStack *m_widgetStack;
WidgetEditorTool *m_widgetEditor;
@@ -368,8 +361,6 @@ private:
QString m_exportMacro;
QStringList m_includeHints;
- QList<SetPropertyCommand*> m_moveSelection;
- int m_lastUndoIndex;
QPoint m_contextMenuPosition;
private:
diff --git a/tools/designer/src/components/formeditor/qdesignerundostack.cpp b/tools/designer/src/components/formeditor/qdesignerundostack.cpp
new file mode 100644
index 0000000..007031d
--- /dev/null
+++ b/tools/designer/src/components/formeditor/qdesignerundostack.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdesignerundostack.h"
+
+#include <QtGui/QUndoStack>
+#include <QtGui/QUndoCommand>
+
+QT_BEGIN_NAMESPACE
+
+namespace qdesigner_internal {
+
+QDesignerUndoStack::QDesignerUndoStack(QObject *parent) :
+ QObject(parent),
+ m_undoStack(new QUndoStack),
+ m_fakeDirty(false)
+{
+ connect(m_undoStack, SIGNAL(indexChanged(int)), this, SIGNAL(changed()));
+}
+
+QDesignerUndoStack::~QDesignerUndoStack()
+{ // QUndoStack is managed by the QUndoGroup
+}
+
+void QDesignerUndoStack::push(QUndoCommand * cmd)
+{
+ m_undoStack->push(cmd);
+}
+
+void QDesignerUndoStack::beginMacro(const QString &text)
+{
+ m_undoStack->beginMacro(text);
+}
+
+void QDesignerUndoStack::endMacro()
+{
+ m_undoStack->endMacro();
+}
+
+int QDesignerUndoStack::index() const
+{
+ return m_undoStack->index();
+}
+
+const QUndoStack *QDesignerUndoStack::qundoStack() const
+{
+ return m_undoStack;
+}
+QUndoStack *QDesignerUndoStack::qundoStack()
+{
+ return m_undoStack;
+}
+
+bool QDesignerUndoStack::isDirty() const
+{
+ return m_fakeDirty || !m_undoStack->isClean();
+}
+
+void QDesignerUndoStack::setDirty(bool v)
+{
+ if (isDirty() == v)
+ return;
+ if (v) {
+ m_fakeDirty = true;
+ emit changed();
+ } else {
+ m_fakeDirty = false;
+ m_undoStack->setClean();
+ }
+}
+
+} // namespace qdesigner_internal
+
+QT_END_NAMESPACE
diff --git a/tools/designer/src/components/formeditor/qdesignerundostack.h b/tools/designer/src/components/formeditor/qdesignerundostack.h
new file mode 100644
index 0000000..5451ad8
--- /dev/null
+++ b/tools/designer/src/components/formeditor/qdesignerundostack.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the Qt Designer of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDESIGNERUNDOSTACK_H
+#define QDESIGNERUNDOSTACK_H
+
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+class QUndoStack;
+class QUndoCommand;
+
+namespace qdesigner_internal {
+
+/* QDesignerUndoStack: A QUndoStack extended by a way of setting it to
+ * "dirty" indepently of commands (by modifications without commands
+ * such as resizing). Accomplished via bool m_fakeDirty flag. The
+ * lifecycle of the QUndoStack is managed by the QUndoGroup. */
+class QDesignerUndoStack : public QObject
+{
+ Q_DISABLE_COPY(QDesignerUndoStack)
+ Q_OBJECT
+public:
+ explicit QDesignerUndoStack(QObject *parent = 0);
+ virtual ~QDesignerUndoStack();
+
+ void push(QUndoCommand * cmd);
+ void beginMacro(const QString &text);
+ void endMacro();
+ int index() const;
+
+ const QUndoStack *qundoStack() const;
+ QUndoStack *qundoStack();
+
+ bool isDirty() const;
+
+signals:
+ void changed();
+
+public slots:
+ void setDirty(bool);
+
+private:
+ QUndoStack *m_undoStack;
+ bool m_fakeDirty;
+};
+
+} // namespace qdesigner_internal
+
+QT_END_NAMESPACE
+
+#endif // QDESIGNERUNDOSTACK_H
diff --git a/tools/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/tools/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
index 8c55d26..490373e 100644
--- a/tools/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
@@ -62,8 +62,10 @@ QT_BEGIN_NAMESPACE
namespace qdesigner_internal {
// ---- QDesignerFormWindowCommand ----
-QDesignerFormWindowCommand::QDesignerFormWindowCommand(const QString &description, QDesignerFormWindowInterface *formWindow)
- : QUndoCommand(description),
+QDesignerFormWindowCommand::QDesignerFormWindowCommand(const QString &description,
+ QDesignerFormWindowInterface *formWindow,
+ QUndoCommand *parent)
+ : QUndoCommand(description, parent),
m_formWindow(formWindow)
{
}
diff --git a/tools/designer/src/lib/shared/qdesigner_formwindowcommand_p.h b/tools/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
index d8cd018..d73d70c 100644
--- a/tools/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_formwindowcommand_p.h
@@ -70,7 +70,9 @@ class QDESIGNER_SHARED_EXPORT QDesignerFormWindowCommand: public QUndoCommand
{
public:
- QDesignerFormWindowCommand(const QString &description, QDesignerFormWindowInterface *formWindow);
+ QDesignerFormWindowCommand(const QString &description,
+ QDesignerFormWindowInterface *formWindow,
+ QUndoCommand *parent = 0);
virtual void undo();
virtual void redo();
diff --git a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp
index 822c14b..6cc054c 100644
--- a/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_propertycommand.cpp
@@ -926,8 +926,9 @@ bool PropertyListCommand::PropertyDescription::equals(const PropertyDescription
// ---- PropertyListCommand
-PropertyListCommand::PropertyListCommand(QDesignerFormWindowInterface *formWindow) :
- QDesignerFormWindowCommand(QString(), formWindow)
+PropertyListCommand::PropertyListCommand(QDesignerFormWindowInterface *formWindow,
+ QUndoCommand *parent) :
+ QDesignerFormWindowCommand(QString(), formWindow, parent)
{
}
@@ -966,10 +967,17 @@ bool PropertyListCommand::add(QObject *object, const QString &propertyName)
if (!match || m_propertyDescription.m_specialProperty == SP_ObjectName)
return false;
}
- m_propertyHelperList.push_back(PropertyHelper(object, m_propertyDescription.m_specialProperty, sheet, index));
+
+ const PropertyHelperPtr ph(createPropertyHelper(object, m_propertyDescription.m_specialProperty, sheet, index));
+ m_propertyHelperList.push_back(ph);
return true;
}
+PropertyHelper *PropertyListCommand::createPropertyHelper(QObject *object, SpecialProperty sp,
+ QDesignerPropertySheetExtension *sheet, int sheetIndex) const
+{
+ return new PropertyHelper(object, sp, sheet, sheetIndex);
+}
// Init from a list and make sure referenceObject is added first to obtain the right property group
bool PropertyListCommand::initList(const ObjectList &list, const QString &apropertyName, QObject *referenceObject)
@@ -993,19 +1001,19 @@ bool PropertyListCommand::initList(const ObjectList &list, const QString &aprope
QObject* PropertyListCommand::object(int index) const
{
Q_ASSERT(index < m_propertyHelperList.size());
- return m_propertyHelperList[index].object();
+ return m_propertyHelperList.at(index)->object();
}
QVariant PropertyListCommand::oldValue(int index) const
{
Q_ASSERT(index < m_propertyHelperList.size());
- return m_propertyHelperList[index].oldValue();
+ return m_propertyHelperList.at(index)->oldValue();
}
void PropertyListCommand::setOldValue(const QVariant &oldValue, int index)
{
Q_ASSERT(index < m_propertyHelperList.size());
- m_propertyHelperList[index].setOldValue(oldValue);
+ m_propertyHelperList.at(index)->setOldValue(oldValue);
}
// ----- SetValueFunction: Set a new value when applied to a PropertyHelper.
class SetValueFunction {
@@ -1065,9 +1073,10 @@ template <class PropertyListIterator, class Function>
bool updatedPropertyEditor = false;
for (PropertyListIterator it = begin; it != end; ++it) {
- if (QObject* object = it->object()) { // Might have been deleted in the meantime
- const PropertyHelper::Value newValue = function(*it);
- updateMask |= it->updateMask();
+ PropertyHelper *ph = it->data();
+ if (QObject* object = ph->object()) { // Might have been deleted in the meantime
+ const PropertyHelper::Value newValue = function( *ph );
+ updateMask |= ph->updateMask();
// Update property editor if it is the current object
if (!updatedPropertyEditor && propertyEditor && object == propertyEditor->object()) {
propertyEditor->setPropertyValue(propertyName, newValue.first, newValue.second);
@@ -1084,9 +1093,11 @@ template <class PropertyListIterator, class Function>
unsigned PropertyListCommand::setValue(QVariant value, bool changed, unsigned subPropertyMask)
{
if(debugPropertyCommands)
- qDebug() << "PropertyListCommand::setValue(" << value << changed << subPropertyMask << ')';
+ qDebug() << "PropertyListCommand::setValue(" << value
+ << changed << subPropertyMask << ')';
return changePropertyList(formWindow()->core(),
- m_propertyDescription.m_propertyName, m_propertyHelperList.begin(), m_propertyHelperList.end(),
+ m_propertyDescription.m_propertyName,
+ m_propertyHelperList.begin(), m_propertyHelperList.end(),
SetValueFunction(formWindow(), PropertyHelper::Value(value, changed), subPropertyMask));
}
@@ -1146,15 +1157,16 @@ bool PropertyListCommand::canMergeLists(const PropertyHelperList& other) const
if (m_propertyHelperList.size() != other.size())
return false;
for (int i = 0; i < m_propertyHelperList.size(); i++) {
- if (!m_propertyHelperList[i].canMerge(other[i]))
+ if (!m_propertyHelperList.at(i)->canMerge(*other.at(i)))
return false;
}
return true;
}
// ---- SetPropertyCommand ----
-SetPropertyCommand::SetPropertyCommand(QDesignerFormWindowInterface *formWindow)
- : PropertyListCommand(formWindow),
+SetPropertyCommand::SetPropertyCommand(QDesignerFormWindowInterface *formWindow,
+ QUndoCommand *parent)
+ : PropertyListCommand(formWindow, parent),
m_subPropertyMask(SubPropertyAll)
{
}
@@ -1210,7 +1222,7 @@ unsigned SetPropertyCommand::subPropertyMask(const QVariant &newValue, QObject *
void SetPropertyCommand::setDescription()
{
if (propertyHelperList().size() == 1) {
- setText(QApplication::translate("Command", "Changed '%1' of '%2'").arg(propertyName()).arg(propertyHelperList()[0].object()->objectName()));
+ setText(QApplication::translate("Command", "Changed '%1' of '%2'").arg(propertyName()).arg(propertyHelperList().at(0)->object()->objectName()));
} else {
int count = propertyHelperList().size();
setText(QApplication::translate("Command", "Changed '%1' of %n objects", "", QCoreApplication::UnicodeUTF8, count).arg(propertyName()));
@@ -1231,6 +1243,11 @@ int SetPropertyCommand::id() const
return 1976;
}
+QVariant SetPropertyCommand::mergeValue(const QVariant &newValue)
+{
+ return newValue;
+}
+
bool SetPropertyCommand::mergeWith(const QUndoCommand *other)
{
if (id() != other->id() || !formWindow()->isDirty())
@@ -1248,7 +1265,10 @@ bool SetPropertyCommand::mergeWith(const QUndoCommand *other)
!canMergeLists(cmd->propertyHelperList()))
return false;
- m_newValue = cmd->newValue();
+ const QVariant newValue = mergeValue(cmd->newValue());
+ if (!newValue.isValid())
+ return false;
+ m_newValue = newValue;
m_subPropertyMask |= cmd->m_subPropertyMask;
if(debugPropertyCommands)
qDebug() << "SetPropertyCommand::mergeWith() succeeded " << propertyName();
@@ -1289,7 +1309,7 @@ bool ResetPropertyCommand::init(const ObjectList &list, const QString &aproperty
void ResetPropertyCommand::setDescription()
{
if (propertyHelperList().size() == 1) {
- setText(QApplication::translate("Command", "Reset '%1' of '%2'").arg(propertyName()).arg(propertyHelperList()[0].object()->objectName()));
+ setText(QApplication::translate("Command", "Reset '%1' of '%2'").arg(propertyName()).arg(propertyHelperList().at(0)->object()->objectName()));
} else {
int count = propertyHelperList().size();
setText(QApplication::translate("Command", "Reset '%1' of %n objects", "", QCoreApplication::UnicodeUTF8, count).arg(propertyName()));
diff --git a/tools/designer/src/lib/shared/qdesigner_propertycommand_p.h b/tools/designer/src/lib/shared/qdesigner_propertycommand_p.h
index f6b7262..75b23ca 100644
--- a/tools/designer/src/lib/shared/qdesigner_propertycommand_p.h
+++ b/tools/designer/src/lib/shared/qdesigner_propertycommand_p.h
@@ -58,6 +58,7 @@
#include <QtCore/QVariant>
#include <QtCore/QList>
#include <QtCore/QPair>
+#include <QtCore/QSharedPointer>
QT_BEGIN_NAMESPACE
@@ -77,11 +78,12 @@ enum SpecialProperty {
//Determine special property
enum SpecialProperty getSpecialProperty(const QString& propertyName);
-
// A helper class for applying properties to objects.
// Can be used for Set commands (setValue(), restoreOldValue()) or
// Reset Commands restoreDefaultValue(), restoreOldValue()).
-class PropertyHelper {
+//
+class QDESIGNER_SHARED_EXPORT PropertyHelper {
+ Q_DISABLE_COPY(PropertyHelper)
public:
// A pair of Value and changed flag
typedef QPair<QVariant, bool> Value;
@@ -92,11 +94,13 @@ public:
SpecialProperty specialProperty,
QDesignerPropertySheetExtension *sheet,
int index);
+ virtual ~PropertyHelper() {}
QObject *object() const { return m_object; }
SpecialProperty specialProperty() const { return m_specialProperty; }
- // set a new value
- Value setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask);
+ // set a new value. Can be overwritten to perform a transformation (see
+ // handling of Arrow key move in FormWindow class).
+ virtual Value setValue(QDesignerFormWindowInterface *fw, const QVariant &value, bool changed, unsigned subPropertyMask);
// restore old value
Value restoreOldValue(QDesignerFormWindowInterface *fw);
@@ -147,7 +151,7 @@ class QDESIGNER_SHARED_EXPORT PropertyListCommand : public QDesignerFormWindowCo
public:
typedef QList<QObject *> ObjectList;
- explicit PropertyListCommand(QDesignerFormWindowInterface *formWindow);
+ explicit PropertyListCommand(QDesignerFormWindowInterface *formWindow, QUndoCommand *parent = 0);
QObject* object(int index = 0) const;
@@ -159,8 +163,8 @@ public:
virtual void undo();
protected:
- typedef QList<PropertyHelper> PropertyHelperList;
-
+ typedef QSharedPointer<PropertyHelper> PropertyHelperPtr;
+ typedef QList<PropertyHelperPtr> PropertyHelperList;
// add an object
bool add(QObject *object, const QString &propertyName);
@@ -204,6 +208,10 @@ protected:
};
const PropertyDescription &propertyDescription() const { return m_propertyDescription; }
+protected:
+ virtual PropertyHelper *createPropertyHelper(QObject *o, SpecialProperty sp,
+ QDesignerPropertySheetExtension *sheet, int sheetIndex) const;
+
private:
PropertyDescription m_propertyDescription;
PropertyHelperList m_propertyHelperList;
@@ -215,7 +223,7 @@ class QDESIGNER_SHARED_EXPORT SetPropertyCommand: public PropertyListCommand
public:
typedef QList<QObject *> ObjectList;
- explicit SetPropertyCommand(QDesignerFormWindowInterface *formWindow);
+ explicit SetPropertyCommand(QDesignerFormWindowInterface *formWindow, QUndoCommand *parent = 0);
bool init(QObject *object, const QString &propertyName, const QVariant &newValue);
bool init(const ObjectList &list, const QString &propertyName, const QVariant &newValue,
@@ -232,6 +240,10 @@ public:
bool mergeWith(const QUndoCommand *other);
virtual void redo();
+
+protected:
+ virtual QVariant mergeValue(const QVariant &newValue);
+
private:
unsigned subPropertyMask(const QVariant &newValue, QObject *referenceObject);
void setDescription();
diff --git a/translations/translations.pri b/translations/translations.pri
index 808dc4f..a8fb7ee 100644
--- a/translations/translations.pri
+++ b/translations/translations.pri
@@ -25,6 +25,7 @@ ts-qt.commands = (cd $$QT_SOURCE_TREE/src && $$LUPDATE \
3rdparty/webkit \
activeqt \
corelib \
+ declarative \
gui \
multimedia \
network \