summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem_p.h10
-rw-r--r--src/declarative/qml/parser/qmljs.g7
-rw-r--r--src/declarative/qml/parser/qmljsparser.cpp7
-rw-r--r--src/declarative/qml/qmlcompiler.cpp1
4 files changed, 18 insertions, 7 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
index ca850f3..91d2119 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
@@ -116,6 +116,12 @@ public:
smooth(false), keyHandler(0),
width(0), height(0), implicitWidth(0), implicitHeight(0)
{
+ QGraphicsItemPrivate::acceptedMouseButtons = 0;
+ QGraphicsItemPrivate::flags = QGraphicsItem::GraphicsItemFlags(
+ QGraphicsItem::ItemHasNoContents
+ | QGraphicsItem::ItemIsFocusable
+ | QGraphicsItem::ItemNegativeZStacksBehindParent);
+
}
void init(QmlGraphicsItem *parent)
@@ -125,10 +131,6 @@ public:
if (parent)
q->setParentItem(parent);
_baselineOffset.invalidate();
- q->setAcceptedMouseButtons(Qt::NoButton);
- q->setFlags(QGraphicsItem::ItemHasNoContents |
- QGraphicsItem::ItemIsFocusable |
- QGraphicsItem::ItemNegativeZStacksBehindParent);
mouseSetsFocus = false;
}
diff --git a/src/declarative/qml/parser/qmljs.g b/src/declarative/qml/parser/qmljs.g
index 7fbb3f6..90949d5 100644
--- a/src/declarative/qml/parser/qmljs.g
+++ b/src/declarative/qml/parser/qmljs.g
@@ -2985,7 +2985,12 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ;
token_buffer[1].loc = yylloc = location(lexer);
if (t_action(errorState, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token]));
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QmlParser", "Syntax error");
+ else
+ msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
action = errorState;
diff --git a/src/declarative/qml/parser/qmljsparser.cpp b/src/declarative/qml/parser/qmljsparser.cpp
index c2788f4..856d06d 100644
--- a/src/declarative/qml/parser/qmljsparser.cpp
+++ b/src/declarative/qml/parser/qmljsparser.cpp
@@ -1761,7 +1761,12 @@ case 340: {
token_buffer[1].loc = yylloc = location(lexer);
if (t_action(errorState, yytoken)) {
- const QString msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token_buffer[0].token]));
+ QString msg;
+ int token = token_buffer[0].token;
+ if (token < 0 || token >= TERMINAL_COUNT)
+ msg = qApp->translate("QmlParser", "Syntax error");
+ else
+ msg = qApp->translate("QmlParser", "Unexpected token `%1'").arg(QLatin1String(spell[token]));
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, token_buffer[0].loc, msg));
action = errorState;
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index fedc1ee..1368324 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -2388,7 +2388,6 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode)
}
for (int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
- const Object::DynamicSlot &s = obj->dynamicSlots.at(ii);
const QString &funcScript = funcScripts.at(ii);
QmlVMEMetaData::MethodData *data =
((QmlVMEMetaData *)dynamicData.data())->methodData() + ii;