aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/accessible/quick/accessible.json2
-rw-r--r--src/plugins/accessible/quick/main.cpp25
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickitem.cpp28
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickitem.h55
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickview.cpp46
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickview.h10
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h2
-rw-r--r--src/plugins/qmltooling/shared/abstracttool.h2
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.cpp4
-rw-r--r--src/plugins/qmltooling/shared/abstractviewinspector.h2
-rw-r--r--src/plugins/qmltooling/shared/qpacketprotocol.cpp1
-rw-r--r--src/qml/animations/qabstractanimationjob.cpp2
-rw-r--r--src/qml/doc/qtqml.qdocconf8
-rw-r--r--src/qml/qml/parser/qqmljskeywords_p.h50
-rw-r--r--src/qml/qml/qqmlimport.cpp1
-rw-r--r--src/qmltest/qmltest.pro7
-rw-r--r--src/qmltest/quicktest.cpp29
-rw-r--r--src/qmltest/quicktestevent.cpp4
-rw-r--r--src/qmltest/quicktestevent_p.h2
-rw-r--r--src/quick/doc/qtquick.qdocconf8
-rw-r--r--src/quick/items/qquickaccessibleattached.cpp4
-rw-r--r--src/quick/items/qquickaccessibleattached_p.h18
-rw-r--r--src/quick/items/qquickflickable.cpp2
-rw-r--r--src/quick/items/qquickflickable_p.h2
-rw-r--r--src/quick/items/qquickitem.cpp16
-rw-r--r--src/quick/items/qquickitem.h2
-rw-r--r--src/quick/items/qquickitem_p.h2
-rw-r--r--src/quick/items/qquickmousearea.cpp2
-rw-r--r--src/quick/items/qquickmousearea_p.h2
-rw-r--r--src/quick/items/qquickshadereffectnode.cpp2
-rw-r--r--src/quick/items/qquickshadereffectsource.cpp1
-rw-r--r--src/quick/items/qquicktextinput.cpp17
-rw-r--r--src/quick/items/qquickthreadedwindowmanager.cpp3
-rw-r--r--src/quick/items/qquickwindow.cpp4
-rw-r--r--src/quick/items/qquickwindow_p.h2
-rw-r--r--src/quick/items/qquickwindowmanager.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgsimplematerial.cpp23
-rw-r--r--src/quick/util/qquickanimationcontroller.cpp2
39 files changed, 274 insertions, 122 deletions
diff --git a/src/plugins/accessible/quick/accessible.json b/src/plugins/accessible/quick/accessible.json
index 845a45aa78..b21218f19c 100644
--- a/src/plugins/accessible/quick/accessible.json
+++ b/src/plugins/accessible/quick/accessible.json
@@ -1,3 +1,3 @@
{
- "Keys": [ "QQuickView", "QQuickItem" ]
+ "Keys": [ "QQuickWindow", "QQuickItem" ]
}
diff --git a/src/plugins/accessible/quick/main.cpp b/src/plugins/accessible/quick/main.cpp
index 882cbcda4f..019c84fc6e 100644
--- a/src/plugins/accessible/quick/main.cpp
+++ b/src/plugins/accessible/quick/main.cpp
@@ -44,7 +44,7 @@
#include "qaccessiblequickview.h"
#include "qaccessiblequickitem.h"
-#include <QtQuick/QQuickView>
+#include <QtQuick/QQuickWindow>
#include <QtQuick/QQuickItem>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickaccessibleattached_p.h>
@@ -77,37 +77,22 @@ AccessibleQuickFactory::AccessibleQuickFactory()
QStringList AccessibleQuickFactory::keys() const
{
QStringList list;
- list << QLatin1String("QQuickView");
+ list << QLatin1String("QQuickWindow");
list << QLatin1String("QQuickItem");
return list;
}
QAccessibleInterface *AccessibleQuickFactory::create(const QString &classname, QObject *object)
{
- if (classname == QLatin1String("QQuickView")) {
- return new QAccessibleQuickView(qobject_cast<QQuickView *>(object)); // FIXME
+ if (classname == QLatin1String("QQuickWindow")) {
+ return new QAccessibleQuickWindow(qobject_cast<QQuickWindow *>(object));
} else if (classname == QLatin1String("QQuickItem")) {
QQuickItem *item = qobject_cast<QQuickItem *>(object);
Q_ASSERT(item);
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
if (!itemPrivate->isAccessible)
return 0;
-
- QVariant v = QQuickAccessibleAttached::property(item, "role");
- bool ok;
- QAccessible::Role role = (QAccessible::Role)v.toInt(&ok);
- if (!ok) // Not sure if this check is needed.
- return new QAccessibleQuickItem(item);
-
- switch (role) {
- case QAccessible::Slider:
- case QAccessible::SpinBox:
- case QAccessible::Dial:
- case QAccessible::ScrollBar:
- return new QAccessibleQuickItemValueInterface(item);
- default:
- return new QAccessibleQuickItem(item);
- }
+ return new QAccessibleQuickItem(item);
}
return 0;
diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.cpp b/src/plugins/accessible/quick/qaccessiblequickitem.cpp
index 2d41379940..8d36834d48 100644
--- a/src/plugins/accessible/quick/qaccessiblequickitem.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickitem.cpp
@@ -228,7 +228,7 @@ QString QAccessibleQuickItem::text(QAccessible::Text textType) const
break;
}
- // the following blocks handles item-specific behavior
+ // the following block handles item-specific behavior
if (role() == QAccessible::EditableText) {
if (textType == QAccessible::Value) {
QVariant text = object()->property("text");
@@ -241,34 +241,44 @@ QString QAccessibleQuickItem::text(QAccessible::Text textType) const
return QString();
}
-void *QAccessibleQuickItemValueInterface::interface_cast(QAccessible::InterfaceType t)
+void *QAccessibleQuickItem::interface_cast(QAccessible::InterfaceType t)
{
- if (t == QAccessible::ValueInterface)
+ QAccessible::Role r = role();
+ if (t == QAccessible::ValueInterface &&
+ (r == QAccessible::Slider ||
+ r == QAccessible::SpinBox ||
+ r == QAccessible::Dial ||
+ r == QAccessible::ScrollBar))
return static_cast<QAccessibleValueInterface*>(this);
- return QAccessibleQuickItem::interface_cast(t);
+
+ if (t == QAccessible::TextInterface &&
+ (r == QAccessible::EditableText))
+ return static_cast<QAccessibleTextInterface*>(this);
+
+ return QQmlAccessible::interface_cast(t);
}
-QVariant QAccessibleQuickItemValueInterface::currentValue() const
+QVariant QAccessibleQuickItem::currentValue() const
{
return item()->property("value");
}
-void QAccessibleQuickItemValueInterface::setCurrentValue(const QVariant &value)
+void QAccessibleQuickItem::setCurrentValue(const QVariant &value)
{
item()->setProperty("value", value);
}
-QVariant QAccessibleQuickItemValueInterface::maximumValue() const
+QVariant QAccessibleQuickItem::maximumValue() const
{
return item()->property("maximumValue");
}
-QVariant QAccessibleQuickItemValueInterface::minimumValue() const
+QVariant QAccessibleQuickItem::minimumValue() const
{
return item()->property("minimumValue");
}
-QVariant QAccessibleQuickItemValueInterface::minimumStepSize() const
+QVariant QAccessibleQuickItem::minimumStepSize() const
{
return item()->property("stepSize");
}
diff --git a/src/plugins/accessible/quick/qaccessiblequickitem.h b/src/plugins/accessible/quick/qaccessiblequickitem.h
index 0d31749ee0..46f573cc75 100644
--- a/src/plugins/accessible/quick/qaccessiblequickitem.h
+++ b/src/plugins/accessible/quick/qaccessiblequickitem.h
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-class QAccessibleQuickItem : public QQmlAccessible
+class QAccessibleQuickItem : public QQmlAccessible, public QAccessibleValueInterface, public QAccessibleTextInterface
{
public:
QAccessibleQuickItem(QQuickItem *item);
@@ -72,28 +72,51 @@ public:
bool isAccessible() const;
-protected:
- QQuickItem *item() const { return static_cast<QQuickItem*>(object()); }
-};
-
-QRect itemScreenRect(QQuickItem *item);
-
-
-class QAccessibleQuickItemValueInterface: public QAccessibleQuickItem, public QAccessibleValueInterface
-{
-public:
- QAccessibleQuickItemValueInterface(QQuickItem *item) : QAccessibleQuickItem(item)
- {}
-
- void *interface_cast(QAccessible::InterfaceType t);
-
+ // Value Interface
QVariant currentValue() const;
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
QVariant minimumStepSize() const;
+
+
+ // Text Interface
+ // selection (ignored for now)
+ void selection(int selectionIndex, int *startOffset, int *endOffset) const { *startOffset = 0; *endOffset = 0; }
+ int selectionCount() const { return 0; }
+ void addSelection(int startOffset, int endOffset) {}
+ void removeSelection(int selectionIndex) {}
+ void setSelection(int selectionIndex, int startOffset, int endOffset) {}
+
+ // cursor
+ int cursorPosition() const { return 0; }
+ void setCursorPosition(int position) {}
+
+ // text
+ QString text(int startOffset, int endOffset) const { return text(QAccessible::Name).mid(startOffset, endOffset - startOffset); }
+// QString textBeforeOffset(int offset, QAccessible2::BoundaryType boundaryType,
+// int *startOffset, int *endOffset) const;
+// QString textAfterOffset(int offset, QAccessible2::BoundaryType boundaryType,
+// int *startOffset, int *endOffset) const;
+// QString textAtOffset(int offset, QAccessible2::BoundaryType boundaryType,
+// int *startOffset, int *endOffset) const;
+ int characterCount() const { return text(QAccessible::Name).count(); }
+
+ // character <-> geometry
+ QRect characterRect(int offset) const { return QRect(); }
+ int offsetAtPoint(const QPoint &point) const { return -1; }
+
+ void scrollToSubstring(int startIndex, int endIndex) {}
+ QString attributes(int offset, int *startOffset, int *endOffset) const { return QString(); }
+
+protected:
+ QQuickItem *item() const { return static_cast<QQuickItem*>(object()); }
+ void *interface_cast(QAccessible::InterfaceType t);
};
+QRect itemScreenRect(QQuickItem *item);
+
+
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp
index 0106a3d68b..f70a41c6e2 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp
@@ -53,52 +53,59 @@
QT_BEGIN_NAMESPACE
-QAccessibleQuickView::QAccessibleQuickView(QQuickView *object)
+QAccessibleQuickWindow::QAccessibleQuickWindow(QQuickWindow *object)
:QAccessibleObject(object)
{
}
-int QAccessibleQuickView::childCount() const
+QQuickItem *QAccessibleQuickWindow::rootItem() const
{
- return view()->contentItem() ? 1 : 0;
+ if (window()->contentItem())
+ return window()->contentItem()->childItems().first();
+ return 0;
}
-QAccessibleInterface *QAccessibleQuickView::parent() const
+int QAccessibleQuickWindow::childCount() const
+{
+ return rootItem() ? 1 : 0;
+}
+
+QAccessibleInterface *QAccessibleQuickWindow::parent() const
{
// FIXME: for now we assume to be a top level window...
return QAccessible::queryAccessibleInterface(qApp);
}
-QAccessibleInterface *QAccessibleQuickView::child(int index) const
+QAccessibleInterface *QAccessibleQuickWindow::child(int index) const
{
if (index == 0) {
- if (QQuickItem *declarativeRoot = view()->rootObject())
+ if (QQuickItem *declarativeRoot = rootItem())
return new QAccessibleQuickItem(declarativeRoot);
}
return 0;
}
-QAccessible::Role QAccessibleQuickView::role() const
+QAccessible::Role QAccessibleQuickWindow::role() const
{
return QAccessible::Window; // FIXME
}
-QAccessible::State QAccessibleQuickView::state() const
+QAccessible::State QAccessibleQuickWindow::state() const
{
QAccessible::State st;
- if (view() == QGuiApplication::focusWindow())
+ if (window() == QGuiApplication::focusWindow())
st.active = true;
- if (!view()->isVisible())
+ if (!window()->isVisible())
st.invisible = true;
return st;
}
-QRect QAccessibleQuickView::rect() const
+QRect QAccessibleQuickWindow::rect() const
{
- return QRect(view()->x(), view()->y(), view()->width(), view()->height());
+ return QRect(window()->x(), window()->y(), window()->width(), window()->height());
}
-QString QAccessibleQuickView::text(QAccessible::Text text) const
+QString QAccessibleQuickWindow::text(QAccessible::Text text) const
{
#ifdef Q_ACCESSIBLE_QUICK_ITEM_ENABLE_DEBUG_DESCRIPTION
if (text == QAccessible::DebugDescription) {
@@ -107,7 +114,7 @@ QString QAccessibleQuickView::text(QAccessible::Text text) const
#else
Q_UNUSED(text)
#endif
- return view()->title();
+ return window()->title();
}
@@ -152,10 +159,10 @@ static QQuickItem *childAt_helper(QQuickItem *item, int x, int y)
return 0;
}
-QAccessibleInterface *QAccessibleQuickView::childAt(int x, int y) const
+QAccessibleInterface *QAccessibleQuickWindow::childAt(int x, int y) const
{
- Q_ASSERT(view());
- QQuickItem *root = view()->contentItem();
+ Q_ASSERT(window());
+ QQuickItem *root = rootItem();
if (root) {
if (QQuickItem *item = childAt_helper(root, x, y))
return QAccessible::queryAccessibleInterface(item);
@@ -164,15 +171,14 @@ QAccessibleInterface *QAccessibleQuickView::childAt(int x, int y) const
return 0;
}
-int QAccessibleQuickView::indexOfChild(const QAccessibleInterface *iface) const
+int QAccessibleQuickWindow::indexOfChild(const QAccessibleInterface *iface) const
{
if (iface) {
- QQuickItem *declarativeRoot = view()->rootObject();
+ QQuickItem *declarativeRoot = rootItem();
if (declarativeRoot == iface->object())
return 0;
}
return -1;
-
}
QT_END_NAMESPACE
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.h b/src/plugins/accessible/quick/qaccessiblequickview.h
index 03061be275..2b01b18f3c 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.h
+++ b/src/plugins/accessible/quick/qaccessiblequickview.h
@@ -44,16 +44,16 @@
#include <QtGui/qaccessible2.h>
#include <QtGui/qaccessibleobject.h>
-#include <QtQuick/qquickview.h>
+#include <QtQuick/qquickwindow.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-class QAccessibleQuickView : public QAccessibleObject
+class QAccessibleQuickWindow : public QAccessibleObject
{
public:
- QAccessibleQuickView(QQuickView *object);
+ QAccessibleQuickWindow(QQuickWindow *object);
QAccessibleInterface *parent() const;
QAccessibleInterface *child(int index) const;
@@ -66,8 +66,10 @@ public:
int indexOfChild(const QAccessibleInterface *iface) const;
QString text(QAccessible::Text text) const;
QAccessibleInterface *childAt(int x, int y) const;
+
private:
- QQuickView *view() const { return static_cast<QQuickView*>(object()); }
+ QQuickWindow *window() const { return static_cast<QQuickWindow*>(object()); }
+ QQuickItem *rootItem() const;
};
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
index d05f4b9b59..93cbdf3018 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.cpp
@@ -166,6 +166,7 @@ void InspectTool::hoverMoveEvent(QMouseEvent *event)
}
}
+#ifndef QT_NO_WHEELEVENT
void InspectTool::wheelEvent(QWheelEvent *event)
{
if (event->orientation() != Qt::Vertical)
@@ -184,6 +185,7 @@ void InspectTool::wheelEvent(QWheelEvent *event)
}
}
}
+#endif
void InspectTool::keyReleaseEvent(QKeyEvent *event)
{
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
index 5c480697af..5ed243d361 100644
--- a/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/inspecttool.h
@@ -79,7 +79,9 @@ public:
void mouseDoubleClickEvent(QMouseEvent *);
void hoverMoveEvent(QMouseEvent *);
+#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent *);
+#endif
void keyPressEvent(QKeyEvent *) {}
void keyReleaseEvent(QKeyEvent *);
diff --git a/src/plugins/qmltooling/shared/abstracttool.h b/src/plugins/qmltooling/shared/abstracttool.h
index f29909baf0..6e7d0c09cb 100644
--- a/src/plugins/qmltooling/shared/abstracttool.h
+++ b/src/plugins/qmltooling/shared/abstracttool.h
@@ -74,7 +74,9 @@ public:
virtual void mouseDoubleClickEvent(QMouseEvent *event) = 0;
virtual void hoverMoveEvent(QMouseEvent *event) = 0;
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event) = 0;
+#endif
virtual void keyPressEvent(QKeyEvent *event) = 0;
virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.cpp b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
index ed207c5f26..c1d0cf1343 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.cpp
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.cpp
@@ -173,10 +173,12 @@ bool AbstractViewInspector::eventFilter(QObject *obj, QEvent *event)
if (mouseDoubleClickEvent(static_cast<QMouseEvent*>(event)))
return true;
break;
+#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
if (wheelEvent(static_cast<QWheelEvent*>(event)))
return true;
break;
+#endif
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -244,12 +246,14 @@ bool AbstractViewInspector::mouseDoubleClickEvent(QMouseEvent *event)
return true;
}
+#ifndef QT_NO_WHEELEVENT
bool AbstractViewInspector::wheelEvent(QWheelEvent *event)
{
foreach (AbstractTool *tool, m_tools)
tool->wheelEvent(event);
return true;
}
+#endif
bool AbstractViewInspector::touchEvent(QTouchEvent *event)
{
diff --git a/src/plugins/qmltooling/shared/abstractviewinspector.h b/src/plugins/qmltooling/shared/abstractviewinspector.h
index d98707eaca..e0524c880c 100644
--- a/src/plugins/qmltooling/shared/abstractviewinspector.h
+++ b/src/plugins/qmltooling/shared/abstractviewinspector.h
@@ -107,7 +107,9 @@ protected:
virtual bool keyPressEvent(QKeyEvent *event);
virtual bool keyReleaseEvent(QKeyEvent *keyEvent);
virtual bool mouseDoubleClickEvent(QMouseEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual bool wheelEvent(QWheelEvent *event);
+#endif
virtual bool touchEvent(QTouchEvent *event);
virtual void setShowAppOnTop(bool) = 0;
diff --git a/src/plugins/qmltooling/shared/qpacketprotocol.cpp b/src/plugins/qmltooling/shared/qpacketprotocol.cpp
index 205601c3bf..020e5dbe9d 100644
--- a/src/plugins/qmltooling/shared/qpacketprotocol.cpp
+++ b/src/plugins/qmltooling/shared/qpacketprotocol.cpp
@@ -290,6 +290,7 @@ void QPacketProtocol::send(const QPacket & p)
d->sendingPackets.append(sendSize);
qint32 sendSize32 = sendSize;
qint64 writeBytes = d->dev->write((char *)&sendSize32, sizeof(qint32));
+ Q_UNUSED(writeBytes);
Q_ASSERT(writeBytes == sizeof(qint32));
writeBytes = d->dev->write(p.b);
Q_ASSERT(writeBytes == p.b.size());
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp
index df8431e746..67b3391c0c 100644
--- a/src/qml/animations/qabstractanimationjob.cpp
+++ b/src/qml/animations/qabstractanimationjob.cpp
@@ -463,7 +463,7 @@ void QAbstractAnimationJob::setCurrentTime(int msecs)
// and has reached the end.
if ((m_direction == Forward && m_totalCurrentTime == totalDura)
|| (m_direction == Backward && m_totalCurrentTime == 0)) {
- stop();
+ RETURN_IF_DELETED(stop());
}
if (m_hasCurrentTimeChangeListeners)
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 3556570d16..06c1c42a92 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -3,7 +3,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtQml
description = Qt QML Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtqml
-version = 5.0.0
+version = 5.0.1
qhp.projects = QtQml
@@ -13,9 +13,9 @@ qhp.QtQml.virtualFolder = qtqml
qhp.QtQml.indexTitle = Qt QML
qhp.QtQml.indexRoot =
-qhp.QtQml.filterAttributes = qtqml 5.0.0 qtrefdoc
-qhp.QtQml.customFilters.Qt.name = QtQml 5.0.0
-qhp.QtQml.customFilters.Qt.filterAttributes = qtqml 5.0.0
+qhp.QtQml.filterAttributes = qtqml 5.0.1 qtrefdoc
+qhp.QtQml.customFilters.Qt.name = QtQml 5.0.1
+qhp.QtQml.customFilters.Qt.filterAttributes = qtqml 5.0.1
qhp.QtQml.subprojects = classes examples
qhp.QtQml.subprojects.classes.title = C++ Classes
qhp.QtQml.subprojects.classes.indexTitle = Qt QML Module C++ Classes
diff --git a/src/qml/qml/parser/qqmljskeywords_p.h b/src/qml/qml/parser/qqmljskeywords_p.h
index 49ce0e2a8f..f20627c23a 100644
--- a/src/qml/qml/parser/qqmljskeywords_p.h
+++ b/src/qml/qml/parser/qqmljskeywords_p.h
@@ -91,7 +91,7 @@ static inline int classify3(const QChar *s, bool qmlMode) {
else if (s[0].unicode() == 'i') {
if (s[1].unicode() == 'n') {
if (s[2].unicode() == 't') {
- return qmlMode ? Lexer::T_INT : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_INT) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -124,7 +124,7 @@ static inline int classify4(const QChar *s, bool qmlMode) {
if (s[1].unicode() == 'y') {
if (s[2].unicode() == 't') {
if (s[3].unicode() == 'e') {
- return qmlMode ? Lexer::T_BYTE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_BYTE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -140,7 +140,7 @@ static inline int classify4(const QChar *s, bool qmlMode) {
else if (s[1].unicode() == 'h') {
if (s[2].unicode() == 'a') {
if (s[3].unicode() == 'r') {
- return qmlMode ? Lexer::T_CHAR : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_CHAR) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -165,7 +165,7 @@ static inline int classify4(const QChar *s, bool qmlMode) {
if (s[1].unicode() == 'o') {
if (s[2].unicode() == 't') {
if (s[3].unicode() == 'o') {
- return qmlMode ? Lexer::T_GOTO : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_GOTO) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -174,7 +174,7 @@ static inline int classify4(const QChar *s, bool qmlMode) {
if (s[1].unicode() == 'o') {
if (s[2].unicode() == 'n') {
if (s[3].unicode() == 'g') {
- return qmlMode ? Lexer::T_LONG : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_LONG) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -260,7 +260,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'n') {
if (s[3].unicode() == 's') {
if (s[4].unicode() == 't') {
- return qmlMode ? Lexer::T_CONST : Lexer::T_RESERVED_WORD;
+ return qmlMode ? int(Lexer::T_CONST) : int(Lexer::T_RESERVED_WORD);
}
}
}
@@ -280,7 +280,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'n') {
if (s[3].unicode() == 'a') {
if (s[4].unicode() == 'l') {
- return qmlMode ? Lexer::T_FINAL : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_FINAL) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -289,7 +289,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'o') {
if (s[3].unicode() == 'a') {
if (s[4].unicode() == 't') {
- return qmlMode ? Lexer::T_FLOAT : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_FLOAT) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -300,7 +300,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'o') {
if (s[3].unicode() == 'r') {
if (s[4].unicode() == 't') {
- return qmlMode ? Lexer::T_SHORT : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_SHORT) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -309,7 +309,7 @@ static inline int classify5(const QChar *s, bool qmlMode) {
if (s[2].unicode() == 'p') {
if (s[3].unicode() == 'e') {
if (s[4].unicode() == 'r') {
- return qmlMode ? Lexer::T_SUPER : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_SUPER) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -358,7 +358,7 @@ static inline int classify6(const QChar *s, bool qmlMode) {
if (s[3].unicode() == 'b') {
if (s[4].unicode() == 'l') {
if (s[5].unicode() == 'e') {
- return qmlMode ? Lexer::T_DOUBLE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_DOUBLE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -384,7 +384,7 @@ static inline int classify6(const QChar *s, bool qmlMode) {
if (s[3].unicode() == 'o') {
if (s[4].unicode() == 'r') {
if (s[5].unicode() == 't') {
- return qmlMode ? Lexer::T_IMPORT : Lexer::T_RESERVED_WORD;
+ return qmlMode ? int(Lexer::T_IMPORT) : int(Lexer::T_RESERVED_WORD);
}
}
}
@@ -397,7 +397,7 @@ static inline int classify6(const QChar *s, bool qmlMode) {
if (s[3].unicode() == 'i') {
if (s[4].unicode() == 'v') {
if (s[5].unicode() == 'e') {
- return qmlMode ? Lexer::T_NATIVE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_NATIVE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -447,7 +447,7 @@ static inline int classify6(const QChar *s, bool qmlMode) {
if (s[3].unicode() == 't') {
if (s[4].unicode() == 'i') {
if (s[5].unicode() == 'c') {
- return qmlMode ? Lexer::T_STATIC : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_STATIC) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -471,7 +471,7 @@ static inline int classify6(const QChar *s, bool qmlMode) {
if (s[3].unicode() == 'o') {
if (s[4].unicode() == 'w') {
if (s[5].unicode() == 's') {
- return qmlMode ? Lexer::T_THROWS : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_THROWS) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -500,7 +500,7 @@ static inline int classify7(const QChar *s, bool qmlMode) {
if (s[4].unicode() == 'e') {
if (s[5].unicode() == 'a') {
if (s[6].unicode() == 'n') {
- return qmlMode ? Lexer::T_BOOLEAN : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_BOOLEAN) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -560,7 +560,7 @@ static inline int classify7(const QChar *s, bool qmlMode) {
if (s[4].unicode() == 'a') {
if (s[5].unicode() == 'g') {
if (s[6].unicode() == 'e') {
- return qmlMode ? Lexer::T_PACKAGE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_PACKAGE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -573,7 +573,7 @@ static inline int classify7(const QChar *s, bool qmlMode) {
if (s[4].unicode() == 'a') {
if (s[5].unicode() == 't') {
if (s[6].unicode() == 'e') {
- return qmlMode ? Lexer::T_PRIVATE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_PRIVATE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -593,7 +593,7 @@ static inline int classify8(const QChar *s, bool qmlMode) {
if (s[5].unicode() == 'a') {
if (s[6].unicode() == 'c') {
if (s[7].unicode() == 't') {
- return qmlMode ? Lexer::T_ABSTRACT : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_ABSTRACT) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -695,7 +695,7 @@ static inline int classify8(const QChar *s, bool qmlMode) {
if (s[5].unicode() == 'i') {
if (s[6].unicode() == 'l') {
if (s[7].unicode() == 'e') {
- return qmlMode ? Lexer::T_VOLATILE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_VOLATILE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -717,7 +717,7 @@ static inline int classify9(const QChar *s, bool qmlMode) {
if (s[6].unicode() == 'a') {
if (s[7].unicode() == 'c') {
if (s[8].unicode() == 'e') {
- return qmlMode ? Lexer::T_INTERFACE : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_INTERFACE) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -736,7 +736,7 @@ static inline int classify9(const QChar *s, bool qmlMode) {
if (s[6].unicode() == 't') {
if (s[7].unicode() == 'e') {
if (s[8].unicode() == 'd') {
- return qmlMode ? Lexer::T_PROTECTED : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_PROTECTED) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -755,7 +755,7 @@ static inline int classify9(const QChar *s, bool qmlMode) {
if (s[6].unicode() == 'e') {
if (s[7].unicode() == 'n') {
if (s[8].unicode() == 't') {
- return qmlMode ? Lexer::T_TRANSIENT : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_TRANSIENT) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -779,7 +779,7 @@ static inline int classify10(const QChar *s, bool qmlMode) {
if (s[7].unicode() == 'n') {
if (s[8].unicode() == 't') {
if (s[9].unicode() == 's') {
- return qmlMode ? Lexer::T_IMPLEMENTS : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_IMPLEMENTS) : int(Lexer::T_IDENTIFIER);
}
}
}
@@ -825,7 +825,7 @@ static inline int classify12(const QChar *s, bool qmlMode) {
if (s[9].unicode() == 'z') {
if (s[10].unicode() == 'e') {
if (s[11].unicode() == 'd') {
- return qmlMode ? Lexer::T_SYNCHRONIZED : Lexer::T_IDENTIFIER;
+ return qmlMode ? int(Lexer::T_SYNCHRONIZED) : int(Lexer::T_IDENTIFIER);
}
}
}
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 7a2f4eaf34..adce26b76c 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -986,6 +986,7 @@ QQmlImportNamespace::Import *QQmlImportsPrivate::addImportToNamespace(QQmlImport
{
Q_ASSERT(nameSpace);
Q_ASSERT(errors);
+ Q_UNUSED(errors);
Q_ASSERT(url.isEmpty() || url.endsWith(Slash));
QQmlImportNamespace::Import *import = new QQmlImportNamespace::Import;
diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
index 8864f1cae1..9ed792748c 100644
--- a/src/qmltest/qmltest.pro
+++ b/src/qmltest/qmltest.pro
@@ -4,6 +4,11 @@ DEFINES += QT_NO_URL_CAST_FROM_STRING
QT = core
QT_PRIVATE = testlib-private quick qml-private v8-private gui core-private
+!contains(QT_CONFIG, no-widgets) {
+ QT += widgets
+ DEFINES += QT_QMLTEST_WITH_WIDGETS
+}
+
load(qt_module)
# Install qmltestcase.prf into the Qt mkspecs so that "CONFIG += qmltestcase"
@@ -23,4 +28,4 @@ HEADERS += \
$$PWD/quicktestresult_p.h \
$$PWD/qtestoptions_p.h
-DEFINES += QT_QML_DEBUG_NO_WARNING \ No newline at end of file
+DEFINES += QT_QML_DEBUG_NO_WARNING
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 6be10add38..705908c3c4 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -64,6 +64,10 @@
#include <QtCore/QTranslator>
#include <QtTest/QSignalSpy>
+#ifdef QT_QMLTEST_WITH_WIDGETS
+#include <QtWidgets/QApplication>
+#endif
+
QT_BEGIN_NAMESPACE
class QTestRootObject : public QObject
@@ -167,11 +171,6 @@ bool qWaitForSignal(QObject *obj, const char* signal, int timeout = 5000)
int quick_test_main(int argc, char **argv, const char *name, const char *sourceDir)
{
- QGuiApplication* app = 0;
- if (!QCoreApplication::instance()) {
- app = new QGuiApplication(argc, argv);
- }
-
// Look for QML-specific command-line options.
// -import dir Specify an import directory.
// -input dir Specify the input directory for test cases.
@@ -179,6 +178,9 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
QStringList imports;
QString testPath;
QString translationFile;
+#ifdef QT_QMLTEST_WITH_WIDGETS
+ bool withWidgets = false;
+#endif
int outargc = 1;
int index = 1;
while (index < argc) {
@@ -190,6 +192,11 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
index += 2;
} else if (strcmp(argv[index], "-opengl") == 0) {
++index;
+#ifdef QT_QMLTEST_WITH_WIDGETS
+ } else if (strcmp(argv[index], "-widgets") == 0) {
+ withWidgets = true;
+ ++index;
+#endif
} else if (strcmp(argv[index], "-translation") == 0 && (index + 1) < argc) {
translationFile = stripQuotes(QString::fromLocal8Bit(argv[index + 1]));
index += 2;
@@ -203,6 +210,18 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
argv[outargc] = 0;
argc = outargc;
+ QCoreApplication* app = 0;
+ if (!QCoreApplication::instance()) {
+#ifdef QT_QMLTEST_WITH_WIDGETS
+ if (withWidgets)
+ app = new QApplication(argc, argv);
+ else
+#endif
+ {
+ app = new QGuiApplication(argc, argv);
+ }
+ }
+
// Parse the command-line arguments.
// Setting currentAppname and currentTestObjectName (via setProgramName) are needed
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 2fccf3cd72..20ede936fa 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -146,6 +146,7 @@ namespace QtQuickTest
}
}
+#ifndef QT_NO_WHEELEVENT
static void mouseWheel(QWindow* window, QObject* item, Qt::MouseButtons buttons,
Qt::KeyboardModifiers stateKey,
QPointF _pos, int xDelta, int yDelta, int delay = -1)
@@ -172,6 +173,7 @@ namespace QtQuickTest
if (!qApp->notify(window, &we))
QTest::qWarn("Wheel event not accepted by receiving window");
}
+#endif
};
bool QuickTestEvent::mousePress
@@ -188,6 +190,7 @@ bool QuickTestEvent::mousePress
return true;
}
+#ifndef QT_NO_WHEELEVENT
bool QuickTestEvent::mouseWheel(
QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay)
@@ -200,6 +203,7 @@ bool QuickTestEvent::mouseWheel(
QPointF(x, y), xDelta, yDelta, delay);
return true;
}
+#endif
bool QuickTestEvent::mouseRelease
(QObject *item, qreal x, qreal y, int button,
diff --git a/src/qmltest/quicktestevent_p.h b/src/qmltest/quicktestevent_p.h
index 9dfa66a54d..f72d9265b5 100644
--- a/src/qmltest/quicktestevent_p.h
+++ b/src/qmltest/quicktestevent_p.h
@@ -69,8 +69,10 @@ public Q_SLOTS:
int modifiers, int delay);
bool mouseMove(QObject *item, qreal x, qreal y, int delay, int buttons);
+#ifndef QT_NO_WHEELEVENT
bool mouseWheel(QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay);
+#endif
private:
QWindow *eventWindow();
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index 518304ab62..f75ae06539 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -3,7 +3,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtQuick
description = Qt Quick Reference Documentation
url = http://qt-project.org/doc/qt-5.0/qtquick-index.html
-version = 5.0.0
+version = 5.0.1
qhp.projects = QtQuick
@@ -14,9 +14,9 @@ qhp.QtQuick.virtualFolder = qtquick
qhp.QtQuick.indexTitle = Qt Quick
qhp.QtQuick.indexRoot =
-qhp.QtQuick.filterAttributes = qtquick 5.0.0 qtrefdoc
-qhp.QtQuick.customFilters.Qt.name = QtQuick 5.0.0
-qhp.QtQuick.customFilters.Qt.filterAttributes = qtquick 5.0.0
+qhp.QtQuick.filterAttributes = qtquick 5.0.1 qtrefdoc
+qhp.QtQuick.customFilters.Qt.name = QtQuick 5.0.1
+qhp.QtQuick.customFilters.Qt.filterAttributes = qtquick 5.0.1
qhp.QtQuick.subprojects = qmltypes classes examples
qhp.QtQuick.subprojects.qmltypes.title = QML Types
qhp.QtQuick.subprojects.qmltypes.indexTitle = Qt Quick QML Types
diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp
index 372a47963e..193a0280b3 100644
--- a/src/quick/items/qquickaccessibleattached.cpp
+++ b/src/quick/items/qquickaccessibleattached.cpp
@@ -152,6 +152,10 @@ QQuickAccessibleAttached::QQuickAccessibleAttached(QObject *parent)
item->d_func()->setAccessibleFlagAndListener();
QAccessibleEvent ev(item, QAccessible::ObjectCreated);
QAccessible::updateAccessibility(&ev);
+
+ if (!parent->property("value").isNull()) {
+ connect(parent, SIGNAL(valueChanged()), this, SLOT(valueChanged()));
+ }
}
QQuickAccessibleAttached::~QQuickAccessibleAttached()
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h
index 74f486ae7d..6c10b496d0 100644
--- a/src/quick/items/qquickaccessibleattached_p.h
+++ b/src/quick/items/qquickaccessibleattached_p.h
@@ -127,11 +127,29 @@ public:
return obj->setProperty(propertyName, value);
}
+ static QObject *findAccessible(QObject *object, QAccessible::Role role = QAccessible::NoRole)
+ {
+ while (object) {
+ QObject *att = QQuickAccessibleAttached::attachedProperties(object);
+ if (att && (role == QAccessible::NoRole || att->property("role").toInt() == role)) {
+ break;
+ }
+ object = object->parent();
+ }
+ return object;
+ }
+
+public Q_SLOTS:
+ void valueChanged() {
+ QAccessibleValueChangeEvent ev(parent(), parent()->property("value"));
+ QAccessible::updateAccessibility(&ev);
+ }
Q_SIGNALS:
void roleChanged();
void nameChanged();
void descriptionChanged();
+
private:
QAccessible::Role m_role;
QString m_name;
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 0a3dcd8039..6e5e6b74a0 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1270,6 +1270,7 @@ void QQuickFlickable::mouseReleaseEvent(QMouseEvent *event)
}
}
+#ifndef QT_NO_WHEELEVENT
void QQuickFlickable::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickFlickable);
@@ -1324,6 +1325,7 @@ void QQuickFlickable::wheelEvent(QWheelEvent *event)
if (!event->isAccepted())
QQuickItem::wheelEvent(event);
}
+#endif
bool QQuickFlickablePrivate::isInnermostPressDelay(QQuickItem *i) const
{
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index d5f97ad963..ed4b026be3 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -234,7 +234,9 @@ protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual void timerEvent(QTimerEvent *event);
QQuickFlickableVisibleArea *visibleArea();
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 2340da9b9f..6668cb72c5 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -3129,8 +3129,12 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)
void QQuickItem::focusInEvent(QFocusEvent * /*event*/)
{
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleEvent ev(this, QAccessible::Focus);
- QAccessible::updateAccessibility(&ev);
+ if (QAccessible::isActive()) {
+ if (QObject *acc = QQuickAccessibleAttached::findAccessible(this)) {
+ QAccessibleEvent ev(acc, QAccessible::Focus);
+ QAccessible::updateAccessibility(&ev);
+ }
+ }
#endif
}
@@ -3202,6 +3206,7 @@ void QQuickItem::touchUngrabEvent()
// XXX todo
}
+#ifndef QT_NO_WHEELEVENT
/*!
This event handler can be reimplemented in a subclass to receive
wheel events for an item. The event information is provided by the
@@ -3211,6 +3216,7 @@ void QQuickItem::wheelEvent(QWheelEvent *event)
{
event->ignore();
}
+#endif
/*!
This event handler can be reimplemented in a subclass to receive touch
@@ -4100,11 +4106,13 @@ void QQuickItemPrivate::deliverMouseEvent(QMouseEvent *e)
}
}
+#ifndef QT_NO_WHEELEVENT
void QQuickItemPrivate::deliverWheelEvent(QWheelEvent *e)
{
Q_Q(QQuickItem);
q->wheelEvent(e);
}
+#endif
void QQuickItemPrivate::deliverTouchEvent(QTouchEvent *e)
{
@@ -5264,7 +5272,7 @@ void QQuickItem::setFlags(Flags flags)
{
Q_D(QQuickItem);
- if ((flags & ItemIsFocusScope) != (d->flags & ItemIsFocusScope)) {
+ if (int(flags & ItemIsFocusScope) != int(d->flags & ItemIsFocusScope)) {
if (flags & ItemIsFocusScope && !d->childItems.isEmpty() && d->window) {
qWarning("QQuickItem: Cannot set FocusScope once item has children and is in a window.");
flags &= ~ItemIsFocusScope;
@@ -5274,7 +5282,7 @@ void QQuickItem::setFlags(Flags flags)
}
}
- if ((flags & ItemClipsChildrenToShape ) != (d->flags & ItemClipsChildrenToShape))
+ if (int(flags & ItemClipsChildrenToShape) != int(d->flags & ItemClipsChildrenToShape))
d->dirty(QQuickItemPrivate::Clip);
d->flags = flags;
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index bba26be060..dc20310c48 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -398,7 +398,9 @@ protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseUngrabEvent(); // XXX todo - params?
virtual void touchUngrabEvent();
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual void touchEvent(QTouchEvent *event);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 363cc93cc4..804b10deac 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -528,7 +528,9 @@ public:
#endif
void deliverFocusEvent(QFocusEvent *);
void deliverMouseEvent(QMouseEvent *);
+#ifndef QT_NO_WHEELEVENT
void deliverWheelEvent(QWheelEvent *);
+#endif
void deliverTouchEvent(QTouchEvent *);
void deliverHoverEvent(QHoverEvent *);
#ifndef QT_NO_DRAGANDDROP
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index fd01c80ba5..0edbd1b9a9 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -938,6 +938,7 @@ void QQuickMouseArea::hoverLeaveEvent(QHoverEvent *event)
setHovered(false);
}
+#ifndef QT_NO_WHEELEVENT
void QQuickMouseArea::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickMouseArea);
@@ -953,6 +954,7 @@ void QQuickMouseArea::wheelEvent(QWheelEvent *event)
if (!we.isAccepted())
QQuickItem::wheelEvent(event);
}
+#endif
void QQuickMouseArea::ungrabMouse()
{
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index eb5bddf1db..c2138792ae 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -222,7 +222,9 @@ protected:
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
+#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *event);
+#endif
virtual bool childMouseEventFilter(QQuickItem *i, QEvent *e);
virtual void timerEvent(QTimerEvent *event);
virtual void windowDeactivateEvent();
diff --git a/src/quick/items/qquickshadereffectnode.cpp b/src/quick/items/qquickshadereffectnode.cpp
index 622000e492..15989db57b 100644
--- a/src/quick/items/qquickshadereffectnode.cpp
+++ b/src/quick/items/qquickshadereffectnode.cpp
@@ -153,7 +153,7 @@ void QQuickCustomMaterialShader::updateState(const RenderState &state, QSGMateri
if (state.isMatrixDirty())
program()->setUniformValue(loc, state.combinedMatrix());
} else if (d.specialType == UniformData::None) {
- switch (d.value.type()) {
+ switch (int(d.value.type())) {
case QMetaType::QColor:
program()->setUniformValue(loc, qt_premultiply_color(qvariant_cast<QColor>(d.value)));
break;
diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp
index 2b613df0f2..0c4e263ac2 100644
--- a/src/quick/items/qquickshadereffectsource.cpp
+++ b/src/quick/items/qquickshadereffectsource.cpp
@@ -695,6 +695,7 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item)
void QQuickShaderEffectSource::sourceItemDestroyed(QObject *item)
{
Q_ASSERT(item == m_sourceItem);
+ Q_UNUSED(item);
m_sourceItem = 0;
update();
emit sourceItemChanged();
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index fee49593ee..6dd8fb157d 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -59,6 +59,7 @@
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
+#include "qquickaccessibleattached_p.h"
#endif
QT_BEGIN_NAMESPACE
@@ -3374,9 +3375,11 @@ void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool e
#ifdef QT_NO_ACCESSIBILITY
Q_UNUSED(changed)
#else
- if (changed) {
- QAccessibleTextUpdateEvent ev(q, 0, oldText, m_text);
- QAccessible::updateAccessibility(&ev);
+ if (changed && QAccessible::isActive()) {
+ if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)) {
+ QAccessibleTextUpdateEvent ev(acc, 0, oldText, m_text);
+ QAccessible::updateAccessibility(&ev);
+ }
}
#endif
}
@@ -4025,8 +4028,12 @@ bool QQuickTextInputPrivate::emitCursorPositionChanged()
}
#ifndef QT_NO_ACCESSIBILITY
- QAccessibleTextCursorEvent ev(q, m_cursor);
- QAccessible::updateAccessibility(&ev);
+ if (QAccessible::isActive()) {
+ if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)) {
+ QAccessibleTextCursorEvent ev(acc, m_cursor);
+ QAccessible::updateAccessibility(&ev);
+ }
+ }
#endif
return true;
diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp
index 4c38686298..63e2c46d79 100644
--- a/src/quick/items/qquickthreadedwindowmanager.cpp
+++ b/src/quick/items/qquickthreadedwindowmanager.cpp
@@ -845,6 +845,9 @@ QImage QQuickRenderThreadSingleContextWindowManager::grab(QQuickWindow *window)
if (QThread::currentThread() != qApp->thread()) {
qWarning("QQuickWindow::grabFrameBuffer: can only be called from the GUI thread");
return QImage();
+ } else if (window->size().width() <= 0 || window->size().height() <= 0 ) {
+ qWarning("QQuickWindow::grabFrameBuffer: Can't grab a Window with size %dx%d", window->size().width(), window->size().height());
+ return QImage();
}
#ifdef THREAD_DEBUG
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index a915430616..2cde3cc434 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1421,6 +1421,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce
return false;
}
+#ifndef QT_NO_WHEELEVENT
bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event)
{
Q_Q(QQuickWindow);
@@ -1457,7 +1458,6 @@ bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event
return false;
}
-#ifndef QT_NO_WHEELEVENT
/*! \reimp */
void QQuickWindow::wheelEvent(QWheelEvent *event)
{
@@ -2058,9 +2058,11 @@ bool QQuickWindow::sendEvent(QQuickItem *item, QEvent *e)
item->mouseUngrabEvent();
}
break;
+#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
QQuickItemPrivate::get(item)->deliverWheelEvent(static_cast<QWheelEvent *>(e));
break;
+#endif
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index fdf5fe2abb..c8ecd43238 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -131,7 +131,9 @@ public:
bool deliverInitialMousePressEvent(QQuickItem *, QMouseEvent *);
bool deliverMouseEvent(QMouseEvent *);
bool sendFilteredMouseEvent(QQuickItem *, QQuickItem *, QEvent *);
+#ifndef QT_NO_WHEELEVENT
bool deliverWheelEvent(QQuickItem *, QWheelEvent *);
+#endif
bool deliverTouchPoints(QQuickItem *, QTouchEvent *, const QList<QTouchEvent::TouchPoint> &, QSet<int> *,
QHash<QQuickItem *, QList<QTouchEvent::TouchPoint> > *);
bool deliverTouchEvent(QTouchEvent *);
diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp
index 5da904ace2..1249468a4d 100644
--- a/src/quick/items/qquickwindowmanager.cpp
+++ b/src/quick/items/qquickwindowmanager.cpp
@@ -253,7 +253,7 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window);
cd->polishItems();
- int renderTime, syncTime;
+ int renderTime = 0, syncTime = 0;
QTime renderTimer;
if (qquick_render_timing())
renderTimer.start();
diff --git a/src/quick/scenegraph/util/qsgsimplematerial.cpp b/src/quick/scenegraph/util/qsgsimplematerial.cpp
index 6267d3ff5c..f91c85af93 100644
--- a/src/quick/scenegraph/util/qsgsimplematerial.cpp
+++ b/src/quick/scenegraph/util/qsgsimplematerial.cpp
@@ -145,6 +145,29 @@
*/
/*!
+ \macro QSG_DECLARE_SIMPLE_SHADER(Shader, State)
+ \relates QSGSimpleMaterialShader
+
+ This macro is used to declare a QSGMaterialType and a \c
+ createMaterial() function for \a Shader with the given \a State.
+ */
+
+/*!
+ \macro QSG_DECLARE_SIMPLE_COMPARABLE_SHADER(Shader, State)
+ \relates QSGSimpleMaterialShader
+
+ This macro is used to declare a QSGMaterialType and a \c
+ createMaterial() function for \a Shader with the given \a State,
+ where the \a State class must define a compare function on the
+ form:
+
+ \code
+ int compare(const State *other) const;
+ \endcode
+*/
+
+
+/*!
\fn char const *const *QSGSimpleMaterialShader::attributeNames() const
\internal
*/
diff --git a/src/quick/util/qquickanimationcontroller.cpp b/src/quick/util/qquickanimationcontroller.cpp
index e4a82ca091..71efda5846 100644
--- a/src/quick/util/qquickanimationcontroller.cpp
+++ b/src/quick/util/qquickanimationcontroller.cpp
@@ -67,6 +67,7 @@ void QQuickAnimationControllerPrivate::animationFinished(QAbstractAnimationJob *
{
Q_Q(QQuickAnimationController);
Q_ASSERT(animationInstance && animationInstance == job);
+ Q_UNUSED(job);
animationInstance->removeAnimationChangeListener(this, QAbstractAnimationJob::Completion | QAbstractAnimationJob::CurrentTime);
@@ -84,6 +85,7 @@ void QQuickAnimationControllerPrivate::animationCurrentTimeChanged(QAbstractAnim
{
Q_Q(QQuickAnimationController);
Q_ASSERT(animationInstance && animationInstance == job);
+ Q_UNUSED(job);
const qreal newProgress = currentTime * 1.0 / animationInstance->duration();
if (progress != newProgress) {
progress = newProgress;