aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-07-26 11:52:06 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-07-26 11:52:32 +0200
commit993bc84f49b4922480f6ec566f31c24465f0e005 (patch)
tree5189edc8e2e0942459d09a4765ad17dd681fe801 /src
parent713a4c5b1d601f57d538fdbb1e8f6bc05ce07275 (diff)
parent84871192077c18bb093c6259339200bd22d64f00 (diff)
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into merge
Diffstat (limited to 'src')
-rw-r--r--src/imports/dialogs/DefaultFileDialog.qml5
-rw-r--r--src/imports/dialogs/qquickabstractfiledialog.cpp15
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp10
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.h3
-rw-r--r--src/imports/imports.pro3
-rw-r--r--src/imports/widgets/qquickqfiledialog.cpp17
-rw-r--r--src/qml/qml/qqml.h11
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp5
-rw-r--r--src/quick/doc/src/advtutorial.qdoc12
-rw-r--r--src/quick/doc/src/dynamicview-tutorial.qdoc12
-rw-r--r--src/quick/scenegraph/util/qsgdistancefieldutil_p.h1
11 files changed, 48 insertions, 46 deletions
diff --git a/src/imports/dialogs/DefaultFileDialog.qml b/src/imports/dialogs/DefaultFileDialog.qml
index 2cdb34cc03..fb6996b80c 100644
--- a/src/imports/dialogs/DefaultFileDialog.qml
+++ b/src/imports/dialogs/DefaultFileDialog.qml
@@ -107,11 +107,10 @@ AbstractFileDialog {
selectedIndices.map(function(idx) {
if (view.model.isFolder(idx)) {
if (selectFolder)
- // TODO after QTBUG-32039: should not need to convert pathToUrl here
- addSelection(pathToUrl(view.model.get(idx, "filePath")))
+ addSelection(view.model.get(idx, "fileURL"))
} else {
if (!selectFolder)
- addSelection(pathToUrl(view.model.get(idx, "filePath")))
+ addSelection(view.model.get(idx, "fileURL"))
}
})
}
diff --git a/src/imports/dialogs/qquickabstractfiledialog.cpp b/src/imports/dialogs/qquickabstractfiledialog.cpp
index ec5a7f6926..e415ebc7e4 100644
--- a/src/imports/dialogs/qquickabstractfiledialog.cpp
+++ b/src/imports/dialogs/qquickabstractfiledialog.cpp
@@ -108,12 +108,9 @@ void QQuickAbstractFileDialog::setSelectFolder(bool selectFolder)
QUrl QQuickAbstractFileDialog::folder()
{
- return QUrl();
- /* TODO after dialog helper switches to URLs
if (m_dlgHelper && !m_dlgHelper->directory().isEmpty())
- return QUrl::fromLocalFile(m_dlgHelper->directory());
- return QUrl::fromLocalFile(m_options->initialDirectory());
- */
+ return m_dlgHelper->directory();
+ return m_options->initialDirectory();
}
void QQuickAbstractFileDialog::setFolder(const QUrl &f)
@@ -162,13 +159,7 @@ QUrl QQuickAbstractFileDialog::fileUrl()
QList<QUrl> QQuickAbstractFileDialog::fileUrls()
{
- QList<QUrl> ret;
- /* TODO after dialog helper switches to URLs
- if (m_dlgHelper)
- foreach (QString path, m_dlgHelper->selectedFiles())
- ret << QUrl::fromLocalFile(path);
- */
- return ret;
+ return m_dlgHelper->selectedFiles();
}
void QQuickAbstractFileDialog::updateModes()
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 4dbbcf359d..2f9c07cf20 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -325,6 +325,7 @@ QQuickFolderListModel::QQuickFolderListModel(QObject *parent)
d->roleNames[FileLastModifiedRole] = "fileModified";
d->roleNames[FileLastReadRole] = "fileAccessed";
d->roleNames[FileIsDirRole] = "fileIsDir";
+ d->roleNames[FileUrlRole] = "fileURL";
d->init();
}
@@ -366,6 +367,9 @@ QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const
case FileIsDirRole:
rv = d->data.at(index.row()).isDir();
break;
+ case FileUrlRole:
+ rv = QUrl::fromLocalFile(d->data.at(index.row()).filePath());
+ break;
default:
break;
}
@@ -402,8 +406,7 @@ QModelIndex QQuickFolderListModel::index(int row, int , const QModelIndex &) con
The \a folder property holds a URL for the folder that the model is
currently providing.
- The value is a URL expressed as a string, and must be a \c file: or \c qrc:
- URL, or a relative URL.
+ The value must be a \c file: or \c qrc: URL, or a relative URL.
By default, the value is an invalid URL.
*/
@@ -443,7 +446,7 @@ void QQuickFolderListModel::setFolder(const QUrl &folder)
/*!
- \qmlproperty string QQuickFolderListModel::rootFolder
+ \qmlproperty url QQuickFolderListModel::rootFolder
When the rootFolder is set, then this folder will
be threated as the root in the file system, so that
@@ -753,6 +756,7 @@ void QQuickFolderListModel::setShowOnlyReadable(bool on)
\list
\li \c fileName
\li \c filePath
+ \li \c fileURL
\li \c fileBaseName
\li \c fileSuffix
\li \c fileSize
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h
index 43af77adf5..68541f1735 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.h
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h
@@ -90,7 +90,8 @@ public:
FileSizeRole = Qt::UserRole + 5,
FileLastModifiedRole = Qt::UserRole + 6,
FileLastReadRole = Qt::UserRole +7,
- FileIsDirRole = Qt::UserRole + 8
+ FileIsDirRole = Qt::UserRole + 8,
+ FileUrlRole = Qt::UserRole + 9
};
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 6fbe8a51b8..7a922a832e 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -10,8 +10,7 @@ qtHaveModule(quick) {
qtquick2 \
particles \
window \
-# disabled to allow file dialog changes to use urls internally (qtbase)
-# dialogs \
+ dialogs \
testlib
}
diff --git a/src/imports/widgets/qquickqfiledialog.cpp b/src/imports/widgets/qquickqfiledialog.cpp
index 6aab2adbb9..7446887eb8 100644
--- a/src/imports/widgets/qquickqfiledialog.cpp
+++ b/src/imports/widgets/qquickqfiledialog.cpp
@@ -66,12 +66,10 @@ public:
}
virtual bool defaultNameFilterDisables() const { return true; }
- virtual void setDirectory(const QString &dir) { m_dialog.setDirectory(dir); }
- virtual void selectFile(const QString &f) { m_dialog.selectFile(f); }
- /* TODO after dialog helper switches to URLs
- virtual QString directory() const { return m_dialog.directory().absolutePath(); }
- virtual QStringList selectedFiles() const { return m_dialog.selectedFiles(); }
- */
+ virtual void setDirectory(const QUrl &dir) { m_dialog.setDirectoryUrl(dir); }
+ virtual QUrl directory() const { return m_dialog.directoryUrl(); }
+ virtual void selectFile(const QUrl &f) { m_dialog.selectUrl(f); }
+ virtual QList<QUrl> selectedFiles() const;
virtual void setFilter() {
m_dialog.setWindowTitle(QPlatformFileDialogHelper::options()->windowTitle());
@@ -190,7 +188,6 @@ QPlatformFileDialogHelper *QQuickQFileDialog::helper()
if (parentItem)
m_parentWindow = parentItem->window();
- /* TODO after dialog helper switches to URLs
if (!m_dlgHelper) {
m_dlgHelper = new QFileDialogHelper();
connect(m_dlgHelper, SIGNAL(directoryEntered(QString)), this, SIGNAL(folderChanged()));
@@ -198,9 +195,13 @@ QPlatformFileDialogHelper *QQuickQFileDialog::helper()
connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
}
- */
return m_dlgHelper;
}
+QList<QUrl> QFileDialogHelper::selectedFiles() const
+{
+ return m_dialog.selectedUrls();
+}
+
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h
index b48a776b4f..ee69985edb 100644
--- a/src/qml/qml/qqml.h
+++ b/src/qml/qml/qqml.h
@@ -428,8 +428,19 @@ namespace QtQml {
Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *,
const QMetaObject *, bool create);
}
+
+#ifdef Q_CC_CLANG
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wheader-hygiene"
+#endif
+
+// This is necessary to allow for QtQuick1 and QtQuick2 scenes in a single application.
using namespace QtQml;
+#ifdef Q_CC_CLANG
+#pragma clang diagnostic pop
+#endif
+
template<typename T>
QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
{
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 115814914d..fb6733ee58 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1338,6 +1338,11 @@ void QQmlXMLHttpRequest::finished()
if (redirect.isValid()) {
QUrl url = m_network->url().resolved(redirect.toUrl());
if (url.scheme() != QLatin1String("file")) {
+ // See http://www.ietf.org/rfc/rfc2616.txt, section 10.3.4 "303 See Other":
+ // Result of 303 redirection should be a new "GET" request.
+ const QVariant code = m_network->attribute(QNetworkRequest::HttpStatusCodeAttribute);
+ if (code.isValid() && code.toInt() == 303 && m_method != QLatin1String("GET"))
+ m_method = QStringLiteral("GET");
destroyNetwork();
requestFromUrl(url);
return;
diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc
index 80a0173f32..966bd9d804 100644
--- a/src/quick/doc/src/advtutorial.qdoc
+++ b/src/quick/doc/src/advtutorial.qdoc
@@ -52,10 +52,10 @@ control QML types.
Tutorial chapters:
\list 1
-\li \l {quick/tutorials/samegame/samegame1}{Creating the Game Canvas and Blocks}
-\li \l {quick/tutorials/samegame/samegame2}{Populating the Game Canvas}
-\li \l {quick/tutorials/samegame/samegame3}{Implementing the Game Logic}
-\li \l {quick/tutorials/samegame/samegame4}{Finishing Touches}
+\li \l {QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks}{Creating the Game Canvas and Blocks}
+\li \l {QML Advanced Tutorial 2 - Populating the Game Canvas}{Populating the Game Canvas}
+\li \l {QML Advanced Tutorial 3 - Implementing the Game Logic}{Implementing the Game Logic}
+\li \l {QML Advanced Tutorial 4 - Finishing Touches}{Finishing Touches}
\endlist
All the code in this tutorial can be found in Qt's \c examples/quick/tutorials/samegame
@@ -63,7 +63,6 @@ directory.
*/
/*!
-\page qml-advtutorial1.html
\title QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial
@@ -132,7 +131,6 @@ types to get started. Next, we will populate the game canvas with some blocks.
/*!
-\page qml-advtutorial2.html
\title QML Advanced Tutorial 2 - Populating the Game Canvas
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
@@ -207,7 +205,6 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics.
*/
/*!
-\page qml-advtutorial3.html
\title QML Advanced Tutorial 3 - Implementing the Game Logic
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
@@ -295,7 +292,6 @@ until the next chapter - where your application becomes alive!
*/
/*!
-\page qml-advtutorial4.html
\title QML Advanced Tutorial 4 - Finishing Touches
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc
index fad09b396b..c579d0f7ef 100644
--- a/src/quick/doc/src/dynamicview-tutorial.qdoc
+++ b/src/quick/doc/src/dynamicview-tutorial.qdoc
@@ -38,10 +38,10 @@ data to dynamically sort all items in a view.
Tutorial chapters:
\list 1
-\li \l {quick/tutorials/dynamicview/dynamicview1}{A Simple ListView and Delegate}
-\li \l {quick/tutorials/dynamicview/dynamicview2}{Dragging View Items}
-\li \l {quick/tutorials/dynamicview/dynamicview3}{Moving Dragged Items}
-\li \l {quick/tutorials/dynamicview/dynamicview4}{Sorting Items}
+\li \l {QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate}{A Simple ListView and Delegate}
+\li \l {QML Dynamic View Ordering Tutorial 2 - Dragging View Items}{Dragging View Items}
+\li \l {QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items}{Moving Dragged Items}
+\li \l {QML Dynamic View Ordering Tutorial 4 - Sorting Items}{Sorting Items}
\endlist
All the code in this tutorial can be found in Qt's \c examples/quick/tutorials/dynamicview
@@ -49,7 +49,6 @@ directory.
*/
/*!
-\page qml-dynamicview-tutorial1.html
\title QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial
@@ -85,7 +84,6 @@ The second part of the application is the ListView itself to which we bind the m
*/
/*!
-\page qml-dynamicview-tutorial2.html
\title QML Dynamic View Ordering Tutorial 2 - Dragging View Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
@@ -129,7 +127,6 @@ so that is above other items in the stacking order and isn't obscured as it is d
*/
/*!
-\page qml-dynamicview-tutorial3.html
\title QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
@@ -182,7 +179,6 @@ property of the view and bind the \l {QtQuick2::VisualDataModel::model}{model} a
*/
/*!
-\page qml-dynamicview-tutorial4.html
\title QML Dynamic View Ordering Tutorial 4 - Sorting Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil_p.h b/src/quick/scenegraph/util/qsgdistancefieldutil_p.h
index c9d4f3cb33..de3e778689 100644
--- a/src/quick/scenegraph/util/qsgdistancefieldutil_p.h
+++ b/src/quick/scenegraph/util/qsgdistancefieldutil_p.h
@@ -75,7 +75,6 @@ private:
QHash<QString, QSGDistanceFieldGlyphCache *> m_caches;
- QSGGlyphNode::AntialiasingMode m_defaultAntialiasingMode;
ThresholdFunc m_threshold_func;
AntialiasingSpreadFunc m_antialiasingSpread_func;
};