aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-02 13:41:31 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-02 13:41:58 +0100
commit1ba68c8431d746b46bba1a0f117f3ff7cd2c6aea (patch)
tree462bcde5696636851216be3ae33fb474a7cb2f6c /src
parentc170ea57ca5a927b22726a730a7eedd274abbcfc (diff)
parentd40fcf19f7768e6ae80532ff3d8a416132594f87 (diff)
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp4
-rw-r--r--src/qml/jsruntime/qv4mm.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp6
-rw-r--r--src/qml/qml/qqmlimport.cpp36
-rw-r--r--src/quick/items/qquickwindow.cpp2
-rw-r--r--src/quick/items/qquickwindow.h2
6 files changed, 33 insertions, 19 deletions
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index 35bd6e5501..0aaf50a43c 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -637,8 +637,10 @@ Property *ArrayData::insert(Object *o, uint index, bool isAccessor)
o->initSparseArray();
SparseArrayData *s = static_cast<SparseArrayData *>(o->arrayData());
SparseArrayNode *n = s->sparse()->insert(index);
- if (n->value == UINT_MAX)
+ if (n->value == UINT_MAX) {
n->value = SparseArrayData::allocate(o, isAccessor);
+ s = static_cast<SparseArrayData *>(o->arrayData());
+ }
return reinterpret_cast<Property *>(s->arrayData() + n->value);
}
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index b9a4a55b4a..975a5d5833 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -245,7 +245,7 @@ Managed *MemoryManager::allocData(std::size_t size)
m_d->availableItems[pos] += uint(increase);
m_d->totalItems += int(increase);
#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(allocation.memory, allocation.chunkSize);
+ VALGRIND_MAKE_MEM_NOACCESS(allocation.memory.base(), allocSize);
#endif
}
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index a187c76042..04a2f9cadd 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -491,6 +491,12 @@ The following functions are also on the Qt object.
\li \c application.domain
\li This is the organization domain set on the QCoreApplication instance. This property can be written
to in order to set the organization domain.
+
+ \row
+ \li \c application.supportsMultipleWindows
+ \li This read-only property can be used to determine whether or not the
+ platform supports multiple windows. Some embedded platforms do not support
+ multiple windows, for example.
\endtable
The object also has one signal, aboutToQuit(), which is the same as \l QCoreApplication::aboutToQuit().
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index df4006d3c2..807eb05362 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -63,7 +63,8 @@ static const QLatin1Char Backslash('\\');
static const QLatin1Char Colon(':');
static const QLatin1String Slash_qmldir("/qmldir");
static const QLatin1String String_qmldir("qmldir");
-static const QString dotqml_string(QLatin1String(".qml"));
+static const QString dotqml_string(QStringLiteral(".qml"));
+static const QString dotuidotqml_string(QStringLiteral(".ui.qml"));
static bool designerSupportRequired = false;
namespace {
@@ -657,23 +658,28 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
return (*type_return != 0);
}
} else if (!isLibrary) {
- QString qmlUrl = url + QString::fromRawData(type.constData(), type.length()) + dotqml_string;
-
+ QString qmlUrl;
bool exists = false;
- if (QQmlFile::isBundle(qmlUrl)) {
- exists = QQmlFile::bundleFileExists(qmlUrl, typeLoader->engine());
- } else {
- exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(qmlUrl)).isEmpty();
- if (!exists) {
- QString formUrl = url + QString::fromRawData(type.constData(), type.length()) + QStringLiteral(".ui.qml");
- if (!typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(formUrl)).isEmpty()) {
- exists = true;
- qmlUrl = formUrl;
- }
+ const QString urlsToTry[2] = {
+ url + QString::fromRawData(type.constData(), type.length()) + dotqml_string, // Type -> Type.qml
+ url + QString::fromRawData(type.constData(), type.length()) + dotuidotqml_string // Type -> Type.ui.qml
+ };
+ for (uint i = 0; i < sizeof(urlsToTry) / sizeof(urlsToTry[0]); ++i) {
+ const QString url = urlsToTry[i];
+
+ if (QQmlFile::isBundle(url)) {
+ exists = QQmlFile::bundleFileExists(url, typeLoader->engine());
+ } else {
+ exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(url)).isEmpty();
+ if (!exists)
+ exists = QQmlMetaType::findCachedCompilationUnit(QUrl(url));
+ }
+
+ if (exists) {
+ qmlUrl = url;
+ break;
}
- if (!exists)
- exists = QQmlMetaType::findCachedCompilationUnit(QUrl(qmlUrl));
}
if (exists) {
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 986aab3c8f..9b1fad7bcc 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -3947,7 +3947,7 @@ void QQuickWindow::runJobsAfterSwap()
*
* \sa QWindow::devicePixelRatio()
*/
-int QQuickWindow::effectiveDevicePixelRatio() const
+qreal QQuickWindow::effectiveDevicePixelRatio() const
{
QWindow *w = QQuickRenderControl::renderWindowFor(const_cast<QQuickWindow *>(this));
return w ? w->devicePixelRatio() : devicePixelRatio();
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 3cac691963..ddf9722313 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -142,7 +142,7 @@ public:
void scheduleRenderJob(QRunnable *job, RenderStage schedule);
- int effectiveDevicePixelRatio() const;
+ qreal effectiveDevicePixelRatio() const;
Q_SIGNALS:
void frameSwapped();