summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qevent.cpp1
-rw-r--r--src/sql/kernel/qsqlquery.cpp3
-rw-r--r--src/widgets/doc/snippets/simplemodel-use/main.cpp7
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc13
-rw-r--r--src/xml/dom/qdom.cpp19
5 files changed, 25 insertions, 18 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2b28052dd5..f555f4dc05 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -846,6 +846,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
/*!
Constructs a wheel event object.
+ \since 5.12
The \a pos provides the location of the mouse cursor
within the window. The position in global coordinates is specified
by \a globalPos.
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index e7c444f5b9..34a3ba3755 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -182,6 +182,9 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
You can retrieve the values of all the fields in a single variable
(a map) using boundValues().
+ \note Not all SQL operations support binding values. Refer to your database
+ system's documentation to check their availability.
+
\section1 Approaches to Binding Values
Below we present the same example using each of the four
diff --git a/src/widgets/doc/snippets/simplemodel-use/main.cpp b/src/widgets/doc/snippets/simplemodel-use/main.cpp
index 3e106c8eea..940669e101 100644
--- a/src/widgets/doc/snippets/simplemodel-use/main.cpp
+++ b/src/widgets/doc/snippets/simplemodel-use/main.cpp
@@ -79,8 +79,11 @@ int main(int argc, char *argv[])
//! [0]
QFileSystemModel *model = new QFileSystemModel;
- QModelIndex parentIndex = model->index(QDir::currentPath());
- int numRows = model->rowCount(parentIndex);
+ connect(model, &QFileSystemModel::directoryLoaded, [model](const QString &directory) {
+ QModelIndex parentIndex = model->index(directory);
+ int numRows = model->rowCount(parentIndex);
+ });
+ model->setRootPath(QDir::currentPath);
//! [0]
//! [1]
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 236582ef3f..ede1ebf932 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -465,14 +465,19 @@
Although this does not show a normal way of using a model, it demonstrates
the conventions used by models when dealing with model indexes.
+ QFileSystemModel loading is asynchronous to minimize system resource use.
+ We have to take that into account when dealing with this model.
+
We construct a file system model in the following way:
\snippet simplemodel-use/main.cpp 0
- In this case, we set up a default QFileSystemModel, obtain a parent index
- using a specific implementation of \l{QFileSystemModel::}{index()}
- provided by that model, and we count the number of rows in the model using
- the \l{QFileSystemModel::}{rowCount()} function.
+ In this case, we start by setting up a default QFileSystemModel. We connect
+ it to a lambda, in which we will obtain a parent index using a specific
+ implementation of \l{QFileSystemModel::}{index()} provided by that model.
+ In the lambda, we count the number of rows in the model using the
+ \l{QFileSystemModel::}{rowCount()} function. Finally, we set the root path
+ of the QFileSystemModel so it starts loading data and triggers the lambda.
For simplicity, we are only interested in the items in the first column
of the model. We examine each row in turn, obtaining a model index for
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 75b7f8988c..bbbdf1c6f3 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -4312,20 +4312,20 @@ void QDomElement::setAttribute(const QString& name, const QString& value)
\fn void QDomElement::setAttribute(const QString& name, int value)
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
/*!
\fn void QDomElement::setAttribute(const QString& name, uint value)
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, qlonglong value)
{
@@ -4339,7 +4339,7 @@ void QDomElement::setAttribute(const QString& name, qlonglong value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, qulonglong value)
{
@@ -4353,7 +4353,7 @@ void QDomElement::setAttribute(const QString& name, qulonglong value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, float value)
{
@@ -4367,19 +4367,14 @@ void QDomElement::setAttribute(const QString& name, float value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, double value)
{
if (!impl)
return;
QString x;
- char buf[256];
- int count = qsnprintf(buf, sizeof(buf), "%.16g", value);
- if (count > 0)
- x = QString::fromLatin1(buf, count);
- else
- x.setNum(value); // Fallback
+ x.setNum(value);
IMPL->setAttribute(name, x);
}