diff options
Diffstat (limited to 'examples/corelib')
5 files changed, 9 insertions, 12 deletions
diff --git a/examples/corelib/serialization/convert/cborconverter.cpp b/examples/corelib/serialization/convert/cborconverter.cpp index ad69983eb1..f907bb0af6 100644 --- a/examples/corelib/serialization/convert/cborconverter.cpp +++ b/examples/corelib/serialization/convert/cborconverter.cpp @@ -226,7 +226,7 @@ void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, cons QTextStream out(f); out << convertFromVariant(contents, Double).toDiagnosticNotation(opts) - << endl; + << Qt::endl; } CborConverter::CborConverter() diff --git a/examples/corelib/serialization/convert/textconverter.cpp b/examples/corelib/serialization/convert/textconverter.cpp index e80e69a0b5..7aed08f96c 100644 --- a/examples/corelib/serialization/convert/textconverter.cpp +++ b/examples/corelib/serialization/convert/textconverter.cpp @@ -66,7 +66,7 @@ static void dumpVariant(QTextStream &out, const QVariant &v) case QVariant::String: { const QStringList list = v.toStringList(); for (const QString &s : list) - out << s << endl; + out << s << Qt::endl; break; } @@ -80,11 +80,11 @@ static void dumpVariant(QTextStream &out, const QVariant &v) } case QMetaType::Nullptr: - out << "(null)" << endl; + out << "(null)" << Qt::endl; break; default: - out << v.toString() << endl; + out << v.toString() << Qt::endl; break; } } diff --git a/examples/corelib/threads/doc/src/mandelbrot.qdoc b/examples/corelib/threads/doc/src/mandelbrot.qdoc index 274874632e..9e3fdc1dfe 100644 --- a/examples/corelib/threads/doc/src/mandelbrot.qdoc +++ b/examples/corelib/threads/doc/src/mandelbrot.qdoc @@ -304,8 +304,8 @@ \snippet threads/mandelbrot/mandelbrotwidget.cpp 12 The wheel event handler is reimplemented to make the mouse wheel - control the zoom level. QWheelEvent::delta() returns the angle of - the wheel mouse movement, in eights of a degree. For most mice, + control the zoom level. QWheelEvent::angleDelta() returns the angle + of the wheel mouse movement, in eighths of a degree. For most mice, one wheel step corresponds to 15 degrees. We find out how many mouse steps we have and determine the resulting zoom factor. For example, if we have two wheel steps in the positive direction diff --git a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp index 71d0abb09f..822791533b 100644 --- a/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp +++ b/examples/corelib/threads/mandelbrot/mandelbrotwidget.cpp @@ -176,7 +176,7 @@ void MandelbrotWidget::keyPressEvent(QKeyEvent *event) //! [12] void MandelbrotWidget::wheelEvent(QWheelEvent *event) { - int numDegrees = event->delta() / 8; + int numDegrees = event->angleDelta().y() / 8; double numSteps = numDegrees / 15.0f; zoom(pow(ZoomInFactor, numSteps)); } diff --git a/examples/corelib/tools/doc/src/customtype.qdoc b/examples/corelib/tools/doc/src/customtype.qdoc index 91b814808a..7ccfc95c70 100644 --- a/examples/corelib/tools/doc/src/customtype.qdoc +++ b/examples/corelib/tools/doc/src/customtype.qdoc @@ -117,8 +117,8 @@ \snippet tools/customtype/main.cpp storing a custom value - Alternatively, the QVariant::fromValue() and qVariantSetValue() functions - can be used if you are using a compiler without support for member template + Alternatively, the QVariant::fromValue() function can be used if + you are using a compiler without support for member template functions. The value can be retrieved using the QVariant::value() member template @@ -126,9 +126,6 @@ \snippet tools/customtype/main.cpp retrieving a custom value - Alternatively, the qVariantValue() template function can be used if - you are using a compiler without support for member template functions. - \section1 Further Reading The custom \c Message type can also be used with direct signal-slot |