summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Smith <msmith@trolltech.com>2010-04-28 08:14:11 (GMT)
committerMartin Smith <msmith@trolltech.com>2010-04-28 08:14:11 (GMT)
commit36bd47429312f6d78d620c04bb7e62d34273d310 (patch)
treedea54adff0ec870a88d96e7e3bb00b9657175412 /src
parent00ebbeb5c319957d5671130313da3c5485e0f31c (diff)
parent2737386ebcb99715d3198a91b5951415c24f99aa (diff)
downloadQt-36bd47429312f6d78d620c04bb7e62d34273d310.zip
Qt-36bd47429312f6d78d620c04bb7e62d34273d310.tar.gz
Qt-36bd47429312f6d78d620c04bb7e62d34273d310.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qlist.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp30
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h3
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp81
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp6
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp196
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h3
-rw-r--r--src/declarative/qml/qdeclarativeextensionplugin.cpp15
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp2
-rw-r--r--src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp9
-rw-r--r--src/declarative/qml/qdeclarativescriptparser.cpp8
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp5
-rw-r--r--src/declarative/util/qdeclarativestateoperations.cpp7
-rw-r--r--src/declarative/util/qdeclarativeutilmodule.cpp4
-rw-r--r--src/gui/dialogs/qdialog.cpp14
-rw-r--r--src/gui/dialogs/qdialog.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp24
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsproxywidget.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp22
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm3
-rw-r--r--src/gui/kernel/qwidget.cpp6
-rw-r--r--src/gui/widgets/qmenu_mac.mm3
-rw-r--r--src/imports/gestures/plugin.cpp3
-rw-r--r--src/imports/gestures/qdeclarativegesturearea_p.h2
-rw-r--r--src/multimedia/mediaservices/base/qmediapluginloader.cpp6
-rw-r--r--src/multimedia/mediaservices/base/qtmedianamespace.qdoc18
-rw-r--r--src/network/access/qftp.cpp2
-rw-r--r--src/network/access/qnetworkaccessmanager.h12
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h2
-rw-r--r--src/plugins/accessible/widgets/simplewidgets.cpp4
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp4
37 files changed, 403 insertions, 147 deletions
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 6f5bb9b..6cc6fc1 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -853,9 +853,7 @@ void **QListData::erase(void **xi)
same as takeAt(0). This function assumes the list is not empty. To
avoid failure, call isEmpty() before calling this function.
- This operation is very fast (\l{constant time}), because QList
- preallocates extra space on both sides of its internal buffer to
- allow for fast growth at both ends of the list.
+ This operation takes \l{constant time}.
If you don't use the return value, removeFirst() is more
efficient.
@@ -870,9 +868,7 @@ void **QListData::erase(void **xi)
not empty. To avoid failure, call isEmpty() before calling this
function.
- This operation is very fast (\l{constant time}), because QList
- preallocates extra space on both sides of its internal buffer to
- allow for fast growth at both ends of the list.
+ This operation takes \l{constant time}.
If you don't use the return value, removeLast() is more
efficient.
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index f8b773e..f79a853 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -375,9 +375,11 @@ FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex)
if (QDeclarativeItem *item = model->item(modelIndex, false)) {
listItem = new FxGridItem(item, q);
listItem->index = modelIndex;
- listItem->item->setZValue(1);
- // complete
- model->completeItem();
+ if (model->completePending()) {
+ // complete
+ listItem->item->setZValue(1);
+ model->completeItem();
+ }
listItem->item->setParentItem(q->viewport());
unrequestedItems.remove(listItem->item);
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 60e8f6c..c88dab2 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -570,9 +570,11 @@ FxListItem *QDeclarativeListViewPrivate::createItem(int modelIndex)
listItem->attached->m_prevSection = sectionAt(modelIndex-1);
}
}
- listItem->item->setZValue(1);
- // complete
- model->completeItem();
+ if (model->completePending()) {
+ // complete
+ listItem->item->setZValue(1);
+ model->completeItem();
+ }
listItem->item->setParentItem(q->viewport());
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 95f6276..d49bb02 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -346,21 +346,26 @@ void QDeclarativeRepeater::itemsInserted(int index, int count)
void QDeclarativeRepeater::itemsRemoved(int index, int count)
{
Q_D(QDeclarativeRepeater);
- if (!isComponentComplete())
+ if (!isComponentComplete() || count <= 0)
return;
while (count--) {
QDeclarativeItem *item = d->deletables.takeAt(index);
- if (item) {
+ if (item)
d->model->release(item);
- }
+ else
+ break;
}
}
void QDeclarativeRepeater::itemsMoved(int from, int to, int count)
{
Q_D(QDeclarativeRepeater);
- if (!isComponentComplete())
+ if (!isComponentComplete() || count <= 0)
return;
+ if (from + count > d->deletables.count()) {
+ regenerate();
+ return;
+ }
QList<QDeclarativeItem*> removed;
int removedCount = count;
while (removedCount--)
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index 0b59503..2b8da8e 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -717,6 +717,7 @@ void QDeclarativeTextPrivate::updateSize()
dy -= size.height();
} else {
singleline = false; // richtext can't elide or be optimized for single-line case
+ ensureDoc();
doc->setDefaultFont(font);
QTextOption option((Qt::Alignment)int(hAlign | vAlign));
option.setWrapMode(QTextOption::WrapMode(wrapMode));
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 2161e23..b618183 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -726,8 +726,18 @@ void QDeclarativeTextInput::setEchoMode(QDeclarativeTextInput::EchoMode echo)
Q_D(QDeclarativeTextInput);
if (echoMode() == echo)
return;
-
+ Qt::InputMethodHints imHints = inputMethodHints();
+ if (echo == Password || echo == NoEcho)
+ imHints |= Qt::ImhHiddenText;
+ else
+ imHints &= ~Qt::ImhHiddenText;
+ if (echo != Normal)
+ imHints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ else
+ imHints &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText);
+ setInputMethodHints(imHints);
d->control->setEchoMode((uint)echo);
+ update();
emit echoModeChanged(echoMode());
}
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index e2d8bc7..43cafe3 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -176,6 +176,11 @@ QDeclarativeVisualModel::ReleaseFlags QDeclarativeVisualItemModel::release(QDecl
return 0;
}
+bool QDeclarativeVisualItemModel::completePending() const
+{
+ return false;
+}
+
void QDeclarativeVisualItemModel::completeItem()
{
// Nothing to do
@@ -352,9 +357,10 @@ public:
VDMDelegateDataType *m_delegateDataType;
friend class QDeclarativeVisualDataModelData;
- bool m_metaDataCreated;
- bool m_metaDataCacheable;
- bool m_delegateValidated;
+ bool m_metaDataCreated : 1;
+ bool m_metaDataCacheable : 1;
+ bool m_delegateValidated : 1;
+ bool m_completePending : 1;
QDeclarativeVisualDataModelData *data(QObject *item);
@@ -567,7 +573,7 @@ QDeclarativeVisualDataModelParts::QDeclarativeVisualDataModelParts(QDeclarativeV
QDeclarativeVisualDataModelPrivate::QDeclarativeVisualDataModelPrivate(QDeclarativeContext *ctxt)
: m_listModelInterface(0), m_abstractItemModel(0), m_visualItemModel(0), m_delegate(0)
, m_context(ctxt), m_parts(0), m_delegateDataType(0), m_metaDataCreated(false)
-, m_metaDataCacheable(false), m_delegateValidated(false), m_listAccessor(0)
+, m_metaDataCacheable(false), m_delegateValidated(false), m_completePending(false), m_listAccessor(0)
{
}
@@ -1026,11 +1032,14 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray
QDeclarativeVisualDataModelData *data = new QDeclarativeVisualDataModelData(index, this);
ctxt->setContextProperty(QLatin1String("model"), data);
ctxt->setContextObject(data);
+ d->m_completePending = false;
nobj = d->m_delegate->beginCreate(ctxt);
- if (complete)
+ if (complete) {
d->m_delegate->completeCreate();
- else
+ } else {
+ d->m_completePending = true;
needComplete = true;
+ }
if (nobj) {
QDeclarative_setParent_noEvent(ctxt, nobj);
QDeclarative_setParent_noEvent(data, nobj);
@@ -1066,6 +1075,14 @@ QDeclarativeItem *QDeclarativeVisualDataModel::item(int index, const QByteArray
return item;
}
+bool QDeclarativeVisualDataModel::completePending() const
+{
+ Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->completePending();
+ return d->m_completePending;
+}
+
void QDeclarativeVisualDataModel::completeItem()
{
Q_D(QDeclarativeVisualDataModel);
@@ -1075,6 +1092,7 @@ void QDeclarativeVisualDataModel::completeItem()
}
d->m_delegate->completeCreate();
+ d->m_completePending = false;
}
QString QDeclarativeVisualDataModel::stringValue(int index, const QString &name)
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
index 0a9173f..edfd387 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -82,6 +82,7 @@ public:
virtual bool isValid() const = 0;
virtual QDeclarativeItem *item(int index, bool complete=true) = 0;
virtual ReleaseFlags release(QDeclarativeItem *item) = 0;
+ virtual bool completePending() const = 0;
virtual void completeItem() = 0;
virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext) = 0;
virtual QString stringValue(int, const QString &) { return QString(); }
@@ -123,6 +124,7 @@ public:
virtual bool isValid() const;
virtual QDeclarativeItem *item(int index, bool complete=true);
virtual ReleaseFlags release(QDeclarativeItem *item);
+ virtual bool completePending() const;
virtual void completeItem();
virtual QString stringValue(int index, const QString &role);
virtual QVariant evaluate(int index, const QString &expression, QObject *objectContext);
@@ -177,6 +179,7 @@ public:
QDeclarativeItem *item(int index, bool complete=true);
QDeclarativeItem *item(int index, const QByteArray &, bool complete=true);
ReleaseFlags release(QDeclarativeItem *item);
+ bool completePending() const;
void completeItem();
virtual QString stringValue(int index, const QString &role);
QVariant evaluate(int index, const QString &expression, QObject *objectContext);
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index c697367..d8bbb70 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -154,7 +154,7 @@ int statusId = qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeCom
\value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content.
\value Ready This QDeclarativeComponent is ready and create() may be called.
\value Loading This QDeclarativeComponent is loading network data.
- \value Error An error has occured. Calling errorDescription() to retrieve a description.
+ \value Error An error has occured. Call errors() to retrieve a list of \{QDeclarativeError}{errors}.
*/
void QDeclarativeComponentPrivate::typeDataReady()
@@ -239,6 +239,18 @@ QDeclarativeComponent::~QDeclarativeComponent()
}
/*!
+ \qmlproperty enumeration Component::status
+ This property holds the status of component loading. It can be one of:
+ \list
+ \o Null - no data is available for the component
+ \o Ready - the component has been loaded, and can be used to create instances.
+ \o Loading - the component is currently being loaded
+ \o Error - an error occurred while loading the component.
+ Calling errorsString() will provide a human-readable description of any errors.
+ \endlist
+ */
+
+/*!
\property QDeclarativeComponent::status
The component's current \l{QDeclarativeComponent::Status} {status}.
*/
@@ -257,6 +269,14 @@ QDeclarativeComponent::Status QDeclarativeComponent::status() const
}
/*!
+ \qmlproperty bool Component::isNull
+
+ Is true if the component is in the Null state, false otherwise.
+
+ Equivalent to status == Component.Null.
+*/
+
+/*!
\property QDeclarativeComponent::isNull
Is true if the component is in the Null state, false otherwise.
@@ -269,6 +289,14 @@ bool QDeclarativeComponent::isNull() const
}
/*!
+ \qmlproperty bool Component::isReady
+
+ Is true if the component is in the Ready state, false otherwise.
+
+ Equivalent to status == Component.Ready.
+*/
+
+/*!
\property QDeclarativeComponent::isReady
Is true if the component is in the Ready state, false otherwise.
@@ -281,6 +309,16 @@ bool QDeclarativeComponent::isReady() const
}
/*!
+ \qmlproperty bool Component::isError
+
+ Is true if the component is in the Error state, false otherwise.
+
+ Equivalent to status == Component.Error.
+
+ Calling errorsString() will provide a human-readable description of any errors.
+*/
+
+/*!
\property QDeclarativeComponent::isError
Is true if the component is in the Error state, false otherwise.
@@ -293,6 +331,14 @@ bool QDeclarativeComponent::isError() const
}
/*!
+ \qmlproperty bool Component::isLoading
+
+ Is true if the component is in the Loading state, false otherwise.
+
+ Equivalent to status == Component::Loading.
+*/
+
+/*!
\property QDeclarativeComponent::isLoading
Is true if the component is in the Loading state, false otherwise.
@@ -305,6 +351,12 @@ bool QDeclarativeComponent::isLoading() const
}
/*!
+ \qmlproperty real Component::progress
+ The progress of loading the component, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+*/
+
+/*!
\property QDeclarativeComponent::progress
The progress of loading the component, from 0.0 (nothing loaded)
to 1.0 (finished).
@@ -490,6 +542,17 @@ QList<QDeclarativeError> QDeclarativeComponent::errors() const
}
/*!
+ \qmlmethod string Component::errorsString()
+
+ Returns a human-readable description of any errors.
+
+ The string includes the file, location, and description of each error.
+ If multiple errors are present they are separated by a newline character.
+
+ If no errors are present, an empty string is returned.
+*/
+
+/*!
\internal
errorsString is only meant as a way to get the errors in script
*/
@@ -508,6 +571,11 @@ QString QDeclarativeComponent::errorsString() const
}
/*!
+ \qmlproperty url Component::url
+ The component URL. This is the URL that was used to construct the component.
+*/
+
+/*!
\property QDeclarativeComponent::url
The component URL. This is the URL passed to either the constructor,
or the loadUrl() or setData() methods.
@@ -527,6 +595,13 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
+ \qmlmethod object Component::createObject()
+ Returns an object instance from this component, or null if object creation fails.
+
+ The object will be created in the same context as the component was created in.
+*/
+
+/*!
\internal
A version of create which returns a scriptObject, for use in script
*/
@@ -535,10 +610,10 @@ QScriptValue QDeclarativeComponent::createObject()
Q_D(QDeclarativeComponent);
QDeclarativeContext* ctxt = creationContext();
if(!ctxt)
- return QScriptValue();
+ return QScriptValue(QScriptValue::NullValue);
QObject* ret = create(ctxt);
if (!ret)
- return QScriptValue();
+ return QScriptValue(QScriptValue::NullValue);
QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine);
QDeclarativeData::get(ret, true)->setImplicitDestructible();
return priv->objectClass->newQObject(ret, QMetaType::QObjectStar);
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index adeb7a5..0eb7e1b 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -617,7 +617,8 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
int majorVersion;
int minorVersion;
QDeclarativeEnginePrivate::ImportedNamespace *typeNamespace = 0;
- if (!QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace)
+ QString errorString;
+ if (!QDeclarativeEnginePrivate::get(engine)->resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion, &typeNamespace, &errorString)
|| typeNamespace)
{
// Known to not be a type:
@@ -630,7 +631,8 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
if (typeNamespace)
error.setDescription(tr("Namespace %1 cannot be used as a type").arg(userTypeName));
else
- error.setDescription(tr("%1 is not a type").arg(userTypeName));
+ error.setDescription(tr("%1 %2").arg(userTypeName).arg(errorString));
+
if (!parserRef->refObjects.isEmpty()) {
QDeclarativeParser::Object *obj = parserRef->refObjects.first();
error.setLine(obj->location.start.line);
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 8eae120..0ee6dfe 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -112,6 +112,7 @@ Q_DECLARE_METATYPE(QDeclarativeProperty)
QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE)
+DEFINE_BOOL_CONFIG_OPTION(qmlCheckTypes, QML_CHECK_TYPES)
/*!
\qmlclass QtObject QObject
@@ -293,6 +294,10 @@ QNetworkAccessManager *QDeclarativeScriptEngine::networkAccessManager()
QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate()
{
+ Q_ASSERT(inProgressCreations == 0);
+ Q_ASSERT(bindValues.isEmpty());
+ Q_ASSERT(parserStatus.isEmpty());
+
while (cleanup) {
QDeclarativeCleanup *c = cleanup;
cleanup = c->next;
@@ -317,10 +322,6 @@ QDeclarativeEnginePrivate::~QDeclarativeEnginePrivate()
delete globalClass;
globalClass = 0;
- for(int ii = 0; ii < bindValues.count(); ++ii)
- clear(bindValues[ii]);
- for(int ii = 0; ii < parserStatus.count(); ++ii)
- clear(parserStatus[ii]);
for(QHash<int, QDeclarativeCompiledData*>::ConstIterator iter = m_compositeTypes.constBegin(); iter != m_compositeTypes.constEnd(); ++iter)
(*iter)->release();
for(QHash<const QMetaObject *, QDeclarativePropertyCache *>::Iterator iter = propertyCache.begin(); iter != propertyCache.end(); ++iter)
@@ -770,7 +771,9 @@ void QDeclarativeEngine::setObjectOwnership(QObject *object, ObjectOwnership own
if (!object)
return;
- QDeclarativeData *ddata = QDeclarativeData::get(object, true);
+ // No need to do anything if CppOwnership and there is no QDeclarativeData as
+ // the current ownership must be CppOwnership
+ QDeclarativeData *ddata = QDeclarativeData::get(object, ownership == JavaScriptOwnership);
if (!ddata)
return;
@@ -808,9 +811,6 @@ void qmlExecuteDeferred(QObject *object)
data->deferredComponent = 0;
QDeclarativeComponentPrivate::complete(ep, &state);
-
- if (!state.errors.isEmpty())
- ep->warning(state.errors);
}
}
@@ -1161,7 +1161,7 @@ QScriptValue QDeclarativeEnginePrivate::formatDateTime(QScriptContext*ctxt, QScr
} else if (ctxt->argument(1).isNumber()) {
enumFormat = Qt::DateFormat(ctxt->argument(1).toUInt32());
} else {
- return ctxt->throwError("Qt.formatDateTime(): Invalid datetime formate");
+ return ctxt->throwError("Qt.formatDateTime(): Invalid datetime format");
}
}
return engine->newVariant(qVariantFromValue(date.toString(enumFormat)));
@@ -1543,55 +1543,65 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
QList<bool> isLibrary;
QList<QDeclarativeDirComponents> qmlDirComponents;
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return,
- QUrl *base = 0)
+
+ bool find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
+ QDeclarativeType** type_return, QUrl* url_return,
+ QUrl *base = 0, bool *typeRecursionDetected = 0)
{
- for (int i=0; i<urls.count(); ++i) {
- int vmaj = majversions.at(i);
- int vmin = minversions.at(i);
-
- QByteArray qt = uris.at(i).toUtf8();
- qt += '/';
- qt += type;
-
- QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
- if (t) {
- if (vmajor) *vmajor = vmaj;
- if (vminor) *vminor = vmin;
- if (type_return)
- *type_return = t;
- return true;
- }
+ int vmaj = majversions.at(i);
+ int vmin = minversions.at(i);
+
+ QByteArray qt = uris.at(i).toUtf8();
+ qt += '/';
+ qt += type;
+
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
+ if (t) {
+ if (vmajor) *vmajor = vmaj;
+ if (vminor) *vminor = vmin;
+ if (type_return)
+ *type_return = t;
+ return true;
+ }
- QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
- QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
-
- bool typeWasDeclaredInQmldir = false;
- if (!qmldircomponents.isEmpty()) {
- const QString typeName = QString::fromUtf8(type);
- foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) {
- if (c.typeName == typeName) {
- typeWasDeclaredInQmldir = true;
-
- // importing version -1 means import ALL versions
- if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
- QUrl candidate = url.resolved(QUrl(c.fileName));
- if (c.internal && base) {
- if (base->resolved(QUrl(c.fileName)) != candidate)
- continue; // failed attempt to access an internal type
- }
- if (url_return)
- *url_return = candidate;
- return true;
+ QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
+ QDeclarativeDirComponents qmldircomponents = qmlDirComponents.at(i);
+
+ bool typeWasDeclaredInQmldir = false;
+ if (!qmldircomponents.isEmpty()) {
+ const QString typeName = QString::fromUtf8(type);
+ foreach (const QDeclarativeDirParser::Component &c, qmldircomponents) {
+ if (c.typeName == typeName) {
+ typeWasDeclaredInQmldir = true;
+
+ // importing version -1 means import ALL versions
+ if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
+ QUrl candidate = url.resolved(QUrl(c.fileName));
+ if (c.internal && base) {
+ if (base->resolved(QUrl(c.fileName)) != candidate)
+ continue; // failed attempt to access an internal type
}
+ if (base && *base == candidate) {
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ continue; // no recursion
+ }
+ if (url_return)
+ *url_return = candidate;
+ return true;
}
}
}
+ }
- if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
- // XXX search non-files too! (eg. zip files, see QT-524)
- QFileInfo f(toLocalFileOrQrc(url));
- if (f.exists()) {
+ if (!typeWasDeclaredInQmldir && !isLibrary.at(i)) {
+ // XXX search non-files too! (eg. zip files, see QT-524)
+ QFileInfo f(toLocalFileOrQrc(url));
+ if (f.exists()) {
+ if (base && *base == url) { // no recursion
+ if (typeRecursionDetected)
+ *typeRecursionDetected = true;
+ } else {
if (url_return)
*url_return = url;
return true;
@@ -1600,6 +1610,63 @@ struct QDeclarativeEnginePrivate::ImportedNamespace {
}
return false;
}
+
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QUrl *base = 0, QString *errorString = 0)
+ {
+ bool typeRecursionDetected = false;
+ for (int i=0; i<urls.count(); ++i) {
+ if (find_helper(i, type, vmajor, vminor, type_return, url_return, base, &typeRecursionDetected)) {
+ if (qmlCheckTypes()) {
+ // check for type clashes
+ for (int j = i+1; j<urls.count(); ++j) {
+ if (find_helper(j, type, vmajor, vminor, 0, 0, base)) {
+ if (errorString) {
+ QString u1 = urls.at(i);
+ QString u2 = urls.at(j);
+ if (base) {
+ QString b = base->toString();
+ int slash = b.lastIndexOf(QLatin1Char('/'));
+ if (slash >= 0) {
+ b = b.left(slash+1);
+ QString l = b.left(slash);
+ if (u1.startsWith(b))
+ u1 = u1.mid(b.count());
+ else if (u1 == l)
+ u1 = QDeclarativeEngine::tr("local directory");
+ if (u2.startsWith(b))
+ u2 = u2.mid(b.count());
+ else if (u2 == l)
+ u2 = QDeclarativeEngine::tr("local directory");
+ }
+ }
+
+ if (u1 != u2)
+ *errorString
+ = QDeclarativeEngine::tr("is ambiguous. Found in %1 and in %2")
+ .arg(u1).arg(u2);
+ else
+ *errorString
+ = QDeclarativeEngine::tr("is ambiguous. Found in %1 in version %2.%3 and %4.%5")
+ .arg(u1)
+ .arg(majversions.at(i)).arg(minversions.at(i))
+ .arg(majversions.at(j)).arg(minversions.at(j));
+ }
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ if (errorString) {
+ if (typeRecursionDetected)
+ *errorString = QDeclarativeEngine::tr("is instantiated recursively");
+ else
+ *errorString = QDeclarativeEngine::tr("is not a type");
+ }
+ return false;
+ }
};
static bool greaterThan(const QString &s1, const QString &s2)
@@ -1809,30 +1876,37 @@ public:
return true;
}
- bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return, QUrl* url_return)
+ bool find(const QByteArray& type, int *vmajor, int *vminor, QDeclarativeType** type_return,
+ QUrl* url_return, QString *errorString)
{
QDeclarativeEnginePrivate::ImportedNamespace *s = 0;
int slash = type.indexOf('/');
if (slash >= 0) {
- s = set.value(QString::fromUtf8(type.left(slash)));
- if (!s)
- return false; // qualifier must be a namespace
+ QString namespaceName = QString::fromUtf8(type.left(slash));
+ s = set.value(namespaceName);
+ if (!s) {
+ if (errorString)
+ *errorString = QDeclarativeEngine::tr("- %1 is not a namespace").arg(namespaceName);
+ return false;
+ }
int nslash = type.indexOf('/',slash+1);
- if (nslash > 0)
- return false; // only single qualification allowed
+ if (nslash > 0) {
+ if (errorString)
+ *errorString = QDeclarativeEngine::tr("- nested namespaces not allowed");
+ return false;
+ }
} else {
s = &unqualifiedset;
}
QByteArray unqualifiedtype = slash < 0 ? type : type.mid(slash+1); // common-case opt (QString::mid works fine, but slower)
if (s) {
- if (s->find(unqualifiedtype,vmajor,vminor,type_return,url_return, &base))
+ if (s->find(unqualifiedtype,vmajor,vminor,type_return,url_return, &base, errorString))
return true;
if (s->urls.count() == 1 && !s->isLibrary[0] && url_return && s != &unqualifiedset) {
// qualified, and only 1 url
*url_return = QUrl(s->urls[0]+QLatin1Char('/')).resolved(QUrl(QString::fromUtf8(unqualifiedtype) + QLatin1String(".qml")));
return true;
}
-
}
return false;
@@ -2329,7 +2403,7 @@ bool QDeclarativeEnginePrivate::addToImport(Imports* imports, const QDeclarative
\sa addToImport()
*/
-bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, ImportedNamespace** ns_return) const
+bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteArray& type, QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin, ImportedNamespace** ns_return, QString *errorString) const
{
ImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
if (ns) {
@@ -2338,7 +2412,7 @@ bool QDeclarativeEnginePrivate::resolveType(const Imports& imports, const QByteA
return true;
}
if (type_return || url_return) {
- if (imports.d->find(type,vmaj,vmin,type_return,url_return)) {
+ if (imports.d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
if (qmlImportTrace()) {
if (type_return && *type_return && url_return && !url_return->isEmpty())
qDebug() << "QDeclarativeEngine::resolveType" << type << '=' << (*type_return)->typeName() << *url_return;
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index f6b9bcb..743275e 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -290,7 +290,8 @@ public:
bool resolveType(const Imports&, const QByteArray& type,
QDeclarativeType** type_return, QUrl* url_return,
int *version_major, int *version_minor,
- ImportedNamespace** ns_return) const;
+ ImportedNamespace** ns_return,
+ QString *errorString = 0) const;
void resolveTypeInNamespace(ImportedNamespace*, const QByteArray& type,
QDeclarativeType** type_return, QUrl* url_return,
int *version_major, int *version_minor ) const;
diff --git a/src/declarative/qml/qdeclarativeextensionplugin.cpp b/src/declarative/qml/qdeclarativeextensionplugin.cpp
index 863bfc4..2c15385 100644
--- a/src/declarative/qml/qdeclarativeextensionplugin.cpp
+++ b/src/declarative/qml/qdeclarativeextensionplugin.cpp
@@ -64,8 +64,11 @@ QT_BEGIN_NAMESPACE
as any manipulation of the engine's root context may cause conflicts
or other issues in the library user's code.
- See \l {Extending QML in C++} for details how to write a QML extension plugin.
- See \l {How to Create Qt Plugins} for general Qt plugin documentation.
+ See \l {Tutorial: Writing QML extensions with C++} for details on creating
+ QML extensions, including how to build a plugin with with QDeclarativeExtensionPlugin.
+ For a simple overview, see the \l{declarative/plugins}{plugins} example.
+
+ Also see \l {How to Create Qt Plugins} for general Qt plugin documentation.
\sa QDeclarativeEngine::importPlugin()
*/
@@ -73,8 +76,12 @@ QT_BEGIN_NAMESPACE
/*!
\fn void QDeclarativeExtensionPlugin::registerTypes(const char *uri)
- Registers the QML types in the given \a uri. Here you call qmlRegisterType() for
- all types which are provided by the extension plugin.
+ Registers the QML types in the given \a uri. Subclasses should implement
+ this to call qmlRegisterType() for all types which are provided by the extension
+ plugin.
+
+ The \a uri is an identifier for the plugin generated by the QML engine
+ based on the name and path of the extension's plugin library.
*/
/*!
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index d9ea8dc..5fcb7ee 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -247,7 +247,7 @@ static void clone(QMetaObjectBuilder &builder, const QMetaObject *mo,
QMetaProperty property = mo->property(ii);
int otherIndex = ignoreEnd->indexOfProperty(property.name());
- if (otherIndex >= ignoreStart->classInfoOffset() + ignoreStart->classInfoCount()) {
+ if (otherIndex >= ignoreStart->propertyOffset() + ignoreStart->propertyCount()) {
builder.addProperty(QByteArray("__qml_ignore__") + property.name(), QByteArray("void"));
// Skip
} else {
diff --git a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
index b116129..399831d 100644
--- a/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
+++ b/src/declarative/qml/qdeclarativenetworkaccessmanagerfactory.cpp
@@ -59,10 +59,6 @@ QT_BEGIN_NAMESPACE
To use a factory, assign it to the relevant QDeclarativeEngine using
QDeclarativeEngine::setNetworkAccessManagerFactory().
- If the created QNetworkAccessManager becomes invalid, due to a
- change in proxy settings, for example, call the invalidate() method.
- This will cause all QNetworkAccessManagers to be recreated.
-
Note: the create() method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
@@ -82,7 +78,10 @@ QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactor
Implement this method to create a QNetworkAccessManager with \a parent.
This allows proxies, caching and cookie support to be setup appropriately.
- This method should return a new QNetworkAccessManager each time it is called.
+ This method must return a new QNetworkAccessManager each time it is called.
+ The parent of the QNetworkAccessManager must be the \a parent provided.
+ The QNetworkAccessManager(s) created by this
+ function will be destroyed automatically when their parent is destroyed.
Note: this method may be called by multiple threads, so ensure the
implementation of this method is reentrant.
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp
index e7c8a12..8b96733 100644
--- a/src/declarative/qml/qdeclarativescriptparser.cpp
+++ b/src/declarative/qml/qdeclarativescriptparser.cpp
@@ -449,6 +449,14 @@ bool ProcessAST::visit(AST::UiImport *node)
_parser->_errors << error;
return false;
}
+ if (import.qualifier == QLatin1String("Qt")) {
+ QDeclarativeError error;
+ error.setDescription(QCoreApplication::translate("QDeclarativeParser","Reserved name \"Qt\" cannot be used as an qualifier"));
+ error.setLine(node->importIdToken.startLine);
+ error.setColumn(node->importIdToken.startColumn);
+ _parser->_errors << error;
+ return false;
+ }
// Check for script qualifier clashes
bool isScript = import.type == QDeclarativeScriptParser::Import::Script;
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index ab50bb1..4b2d5a0 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -125,8 +125,9 @@ QT_BEGIN_NAMESPACE
}
\endqml
- Changes to an Item's parent or anchors should be done using the associated change elements
- (ParentChange and AnchorChanges, respectively) rather than PropertyChanges.
+ Anchor margins should be changed with PropertyChanges, but other anchor changes or changes to
+ an Item's parent should be done using the associated change elements
+ (ParentChange and AnchorChanges, respectively).
\sa {qmlstate}{States}, QtDeclarative
*/
diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp
index 9049b83..689f53c 100644
--- a/src/declarative/util/qdeclarativestateoperations.cpp
+++ b/src/declarative/util/qdeclarativestateoperations.cpp
@@ -612,6 +612,11 @@ QString QDeclarativeStateChangeScript::typeName() const
anchors.top: window.top;
anchors.bottom: window.bottom
}
+ PropertyChanges {
+ target: content;
+ anchors.topMargin: 3
+ anchors.bottomMargin: 3;
+ }
}
\endqml
@@ -623,6 +628,8 @@ QString QDeclarativeStateChangeScript::typeName() const
}
\endqml
+ Margin animations can be animated using NumberAnimation.
+
For more information on anchors see \l {anchor-layout}{Anchor Layouts}.
*/
diff --git a/src/declarative/util/qdeclarativeutilmodule.cpp b/src/declarative/util/qdeclarativeutilmodule.cpp
index eb59fb1..3cf07a7 100644
--- a/src/declarative/util/qdeclarativeutilmodule.cpp
+++ b/src/declarative/util/qdeclarativeutilmodule.cpp
@@ -122,6 +122,6 @@ void QDeclarativeUtilModule::defineModule()
qmlRegisterUncreatableType<QDeclarativeAbstractAnimation>("Qt",4,7,"Animation",QDeclarativeAbstractAnimation::tr("Animation is an abstract class"));
qmlRegisterCustomType<QDeclarativeListModel>("Qt", 4,7, "ListModel", new QDeclarativeListModelParser);
- qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 6, "PropertyChanges", new QDeclarativePropertyChangesParser);
- qmlRegisterCustomType<QDeclarativeConnections>("Qt", 4, 6, "Connections", new QDeclarativeConnectionsParser);
+ qmlRegisterCustomType<QDeclarativePropertyChanges>("Qt", 4, 7, "PropertyChanges", new QDeclarativePropertyChangesParser);
+ qmlRegisterCustomType<QDeclarativeConnections>("Qt", 4, 7, "Connections", new QDeclarativeConnectionsParser);
}
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index e4f45ba..a6bd78a 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -393,6 +393,7 @@ void QDialogPrivate::resetModalitySetByOpen()
resetModalityTo = -1;
}
+#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
#ifdef Q_WS_WINCE_WM
void QDialogPrivate::_q_doneAction()
{
@@ -407,12 +408,12 @@ void QDialogPrivate::_q_doneAction()
bool QDialog::event(QEvent *e)
{
bool result = QWidget::event(e);
-#if defined(Q_WS_WINCE)
+#ifdef Q_WS_WINCE
if (e->type() == QEvent::OkRequest) {
accept();
result = true;
- } else
-#elif defined(Q_WS_S60)
+ }
+#else
if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) {
if (!testAttribute(Qt::WA_Moved)) {
Qt::WindowStates state = windowState();
@@ -421,14 +422,11 @@ bool QDialog::event(QEvent *e)
if (state != windowState())
setWindowState(state);
}
- } else
-#endif
- if (e->type() == QEvent::Move) {
- setAttribute(Qt::WA_Moved, true); // as explicit as the user wants it to be
}
-
+#endif
return result;
}
+#endif
/*!
Returns the modal dialog's result code, \c Accepted or \c Rejected.
diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h
index 7ab0cb6..777256a 100644
--- a/src/gui/dialogs/qdialog.h
+++ b/src/gui/dialogs/qdialog.h
@@ -107,7 +107,9 @@ public Q_SLOTS:
protected:
QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0);
+#if defined(Q_WS_WINCE) || defined(Q_WS_S60)
bool event(QEvent *e);
+#endif
void keyPressEvent(QKeyEvent *);
void closeEvent(QCloseEvent *);
void showEvent(QShowEvent *);
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6cc3f7d..326f130 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7325,6 +7325,18 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
{
Q_D(QGraphicsItem);
d->imHints = hints;
+ if (!hasFocus())
+ return;
+ d->scene->d_func()->updateInputMethodSensitivityInViews();
+#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
+ QWidget *fw = QApplication::focusWidget();
+ if (!fw)
+ return;
+ for (int i = 0 ; i < scene()->views().count() ; ++i)
+ if (scene()->views().at(i) == fw)
+ if (QInputContext *inputContext = fw->inputContext())
+ inputContext->update();
+#endif
}
/*!
@@ -7337,13 +7349,11 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints)
void QGraphicsItem::updateMicroFocus()
{
#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
- if (QWidget *fw = qApp->focusWidget()) {
- if (qt_widget_private(fw)->ic || qApp->d_func()->inputContext) {
- if (QInputContext *ic = fw->inputContext()) {
- if (ic)
- ic->update();
- }
- }
+ if (QWidget *fw = QApplication::focusWidget()) {
+ for (int i = 0 ; i < scene()->views().count() ; ++i)
+ if (scene()->views().at(i) == fw)
+ if (QInputContext *inputContext = fw->inputContext())
+ inputContext->update();
#ifndef QT_NO_ACCESSIBILITY
// ##### is this correct
QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged);
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 8c7fbb4..6b22607 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -861,7 +861,7 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
->source->d_func())->invalidateCache();
}
- if (parentp->graphicsEffect->isEnabled()) {
+ if (parentp->scene && parentp->graphicsEffect->isEnabled()) {
parentp->dirty = 1;
parentp->fullUpdatePending = 1;
}
diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp
index 1f89714..320395e 100644
--- a/src/gui/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp
@@ -975,6 +975,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event)
d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
}
break;
+#ifndef QT_NO_TOOLTIP
case QEvent::ToolTipChange:
// Propagate tooltip change to the proxy.
if (!d->tooltipChangeMode) {
@@ -983,6 +984,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event)
d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode;
}
break;
+#endif
default:
break;
}
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 114de85..c951dce 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -1037,10 +1037,28 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg
void QGraphicsViewPrivate::updateInputMethodSensitivity()
{
Q_Q(QGraphicsView);
- bool enabled = scene && scene->focusItem()
- && (scene->focusItem()->flags() & QGraphicsItem::ItemAcceptsInputMethod);
+ QGraphicsItem *focusItem = 0;
+ bool enabled = scene && (focusItem = scene->focusItem())
+ && (focusItem->d_ptr->flags & QGraphicsItem::ItemAcceptsInputMethod);
q->setAttribute(Qt::WA_InputMethodEnabled, enabled);
q->viewport()->setAttribute(Qt::WA_InputMethodEnabled, enabled);
+
+ if (!enabled) {
+ q->setInputMethodHints(0);
+ return;
+ }
+
+ QGraphicsProxyWidget *proxy = focusItem->d_ptr->isWidget && focusItem->d_ptr->isProxyWidget()
+ ? static_cast<QGraphicsProxyWidget *>(focusItem) : 0;
+ if (!proxy) {
+ q->setInputMethodHints(focusItem->inputMethodHints());
+ } else if (QWidget *widget = proxy->widget()) {
+ if (QWidget *fw = widget->focusWidget())
+ widget = fw;
+ q->setInputMethodHints(widget->inputMethodHints());
+ } else {
+ q->setInputMethodHints(0);
+ }
}
/*!
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index dd12f65..4953c48 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1554,7 +1554,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
qt_button_down = 0;
[dndParams.view release];
[image release];
- dragPrivate()->executed_action = Qt::IgnoreAction;
+ if (dragPrivate())
+ dragPrivate()->executed_action = Qt::IgnoreAction;
object = 0;
Qt::DropAction performedAction(qt_mac_mapNSDragOperation(qMacDnDParams()->performedAction));
// do post drag processing, if required.
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index cf952aa..20d1d30 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -7312,9 +7312,9 @@ void QWidgetPrivate::show_helper()
setVisible(false).
- \note Since Qt 4.7, when calling hide() and then show() on QDialog
- derived widgets will show on the previous (as in "Where the user moved it to")
- position.
+ \note If you are working with QDialog or its subclasses and you invoke
+ the show() function after this function, the dialog will be displayed in
+ its original position.
\sa hideEvent(), isHidden(), show(), setVisible(), isVisible(), close()
*/
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm
index e8400d6..aaa113b 100644
--- a/src/gui/widgets/qmenu_mac.mm
+++ b/src/gui/widgets/qmenu_mac.mm
@@ -2066,6 +2066,7 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly()
cancelAllMenuTracking();
QWidget *w = findWindowThatShouldDisplayMenubar();
QMenuBar *mb = findMenubarForWindow(w);
+ extern bool qt_mac_app_fullscreen; //qapplication_mac.mm
// We need to see if we are in full screen mode, if so we need to
// switch the full screen mode to be able to show or hide the menubar.
@@ -2074,12 +2075,14 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly()
if(w->isFullScreen()) {
// Ok, switch to showing the menubar when hovering over it.
SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
+ qt_mac_app_fullscreen = true;
}
} else if(w) {
// Removing a menubar
if(w->isFullScreen()) {
// Ok, switch to not showing the menubar when hovering on it
SetSystemUIMode(kUIModeAllHidden, 0);
+ qt_mac_app_fullscreen = true;
}
}
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
index 9f5d923..b8a9751 100644
--- a/src/imports/gestures/plugin.cpp
+++ b/src/imports/gestures/plugin.cpp
@@ -53,8 +53,7 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures"));
- qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", "QDeclarativeGestureArea",
- new QDeclarativeGestureAreaParser);
+ qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
}
};
diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h
index 8e2c066..0195511 100644
--- a/src/imports/gestures/qdeclarativegesturearea_p.h
+++ b/src/imports/gestures/qdeclarativegesturearea_p.h
@@ -59,7 +59,7 @@ QT_MODULE(Declarative)
class QDeclarativeBoundSignal;
class QDeclarativeContext;
class QDeclarativeGestureAreaPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeGestureArea : public QDeclarativeItem
+class QDeclarativeGestureArea : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/multimedia/mediaservices/base/qmediapluginloader.cpp b/src/multimedia/mediaservices/base/qmediapluginloader.cpp
index d6da0ba..8b0ddf4 100644
--- a/src/multimedia/mediaservices/base/qmediapluginloader.cpp
+++ b/src/multimedia/mediaservices/base/qmediapluginloader.cpp
@@ -108,7 +108,11 @@ void QMediaPluginLoader::load()
if (!pluginDir.exists())
continue;
- foreach (QString pluginLib, pluginDir.entryList(QDir::Files)) {
+ foreach (const QString &pluginLib, pluginDir.entryList(QDir::Files)) {
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+ if (pluginLib.endsWith(QLatin1String(".debug")))
+ continue;
+#endif
QPluginLoader loader(pluginPathName + pluginLib);
QObject *o = loader.instance();
diff --git a/src/multimedia/mediaservices/base/qtmedianamespace.qdoc b/src/multimedia/mediaservices/base/qtmedianamespace.qdoc
index 277b1a5..54b856f 100644
--- a/src/multimedia/mediaservices/base/qtmedianamespace.qdoc
+++ b/src/multimedia/mediaservices/base/qtmedianamespace.qdoc
@@ -40,15 +40,15 @@
****************************************************************************/
/*!
- \namespace QtMultimedia
- \ingroup multimedia
+ \namespace QtMediaServices
+ \ingroup multimedia-serv
- \brief The QtMultimedia namespace contains miscellaneous identifiers used
- throughout the Qt Multimedia library.
+ \brief The QtMediaServices namespace contains miscellaneous identifiers used
+ throughout the Qt Media Services library.
*/
/*!
- \enum QtMultimedia::MetaData
+ \enum QtMediaServices::MetaData
This enum provides identifiers for meta-data attributes.
@@ -169,7 +169,7 @@
*/
/*!
- \enum QtMultimedia::SupportEstimate
+ \enum QtMediaServices::SupportEstimate
Enumerates the levels of support a media service provider may have for a feature.
@@ -180,7 +180,7 @@
*/
/*!
- \enum QtMultimedia::EncodingQuality
+ \enum QtMediaServices::EncodingQuality
Enumerates quality encoding levels.
@@ -192,7 +192,7 @@
*/
/*!
- \enum QtMultimedia::EncodingMode
+ \enum QtMediaServices::EncodingMode
Enumerates encoding modes.
@@ -203,7 +203,7 @@
*/
/*!
- \enum QtMultimedia::AvailabilityError
+ \enum QtMediaServices::AvailabilityError
Enumerates Service status errors.
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 7f6df0a..97219f4 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -2311,7 +2311,7 @@ void QFtpPrivate::_q_piError(int errorCode, const QString &text)
Q_Q(QFtp);
if (pending.isEmpty()) {
- qWarning() << "QFtpPrivate::_q_piError was called without pending command!";
+ qWarning("QFtpPrivate::_q_piError was called without pending command!");
return;
}
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index a0ffb07..95e45f0 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -62,7 +62,7 @@ class QNetworkReply;
class QNetworkProxy;
class QNetworkProxyFactory;
class QSslError;
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER)
class QNetworkConfiguration;
#endif
@@ -121,11 +121,13 @@ public:
QNetworkReply *deleteResource(const QNetworkRequest &request);
QNetworkReply *sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data = 0);
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER)
void setConfiguration(const QNetworkConfiguration &config);
QNetworkConfiguration configuration() const;
QNetworkConfiguration activeConfiguration() const;
+#endif
+#ifndef QT_NO_BEARERMANAGEMENT
void setNetworkAccessible(NetworkAccessibility accessible);
NetworkAccessibility networkAccessible() const;
#endif
@@ -140,9 +142,11 @@ Q_SIGNALS:
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
#endif
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER)
void networkSessionConnected();
+#endif
+#ifndef QT_NO_BEARERMANAGEMENT
void networkAccessibleChanged(QNetworkAccessManager::NetworkAccessibility accessible);
#endif
@@ -155,7 +159,7 @@ private:
Q_DECLARE_PRIVATE(QNetworkAccessManager)
Q_PRIVATE_SLOT(d_func(), void _q_replyFinished())
Q_PRIVATE_SLOT(d_func(), void _q_replySslErrors(QList<QSslError>))
-#ifndef QT_NO_BEARERMANAGEMENT
+#if !defined(QT_NO_BEARERMANAGEMENT) && !defined(QT_MOBILITY_BEARER)
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionClosed())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionNewConfigurationActivated())
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionPreferredConfigurationChanged(QNetworkConfiguration,bool))
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 04731b1..75c2bb1 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
class QGL2PaintEngineExPrivate;
-class QGLTextureGlyphCache : public QObject, public QTextureGlyphCache
+class Q_OPENGL_EXPORT QGLTextureGlyphCache : public QObject, public QTextureGlyphCache
{
Q_OBJECT
public:
diff --git a/src/plugins/accessible/widgets/simplewidgets.cpp b/src/plugins/accessible/widgets/simplewidgets.cpp
index daa827e..f39d538 100644
--- a/src/plugins/accessible/widgets/simplewidgets.cpp
+++ b/src/plugins/accessible/widgets/simplewidgets.cpp
@@ -605,7 +605,11 @@ int QAccessibleDisplay::navigate(RelationFlag rel, int entry, QAccessibleInterfa
/*! \reimp */
QString QAccessibleDisplay::imageDescription()
{
+#ifndef QT_NO_TOOLTIP
return widget()->toolTip();
+#else
+ return QString::null;
+#endif
}
/*! \reimp */
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp
index 733080e..150860f 100644
--- a/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp
+++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowsamplescheduler.cpp
@@ -255,11 +255,11 @@ HRESULT DirectShowSampleScheduler::Receive(IMediaSample *pSample)
if (m_state == Running) {
if (!timedSample->schedule(m_clock, m_startTime, m_timeoutEvent)) {
// Timing information is unavailable, so schedule frames immediately.
- QMetaObject::invokeMethod(this, "timerActivated", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "sampleReady", Qt::QueuedConnection);
}
} else if (m_tail == m_head) {
// If this is the first frame make is available.
- QMetaObject::invokeMethod(this, "timerActivated", Qt::QueuedConnection);
+ QMetaObject::invokeMethod(this, "sampleReady", Qt::QueuedConnection);
}
return S_OK;