From 0bc02fd0d61d1e4aed9b39890d28975dff30e822 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Tue, 20 Mar 2012 19:37:07 +0100 Subject: [PATCH] Doc: Prepare for building modular QtCore docs. This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll Reviewed-by: Jason McDonald Reviewed-by: Jerome Pasion --- doc/global/qt-cpp-ignore.qdocconf | 54 ++ doc/global/style/offline.css | 622 +++++++++++++++++++++ src/corelib/codecs/codecs.qdoc | 14 +- src/corelib/codecs/qtextcodec.cpp | 6 +- .../corelib/doc}/images/abstract-connections.png | Bin .../corelib/doc}/images/brush-styles.png | Bin .../corelib/doc}/images/cursor-arrow.png | Bin .../src => src/corelib/doc}/images/cursor-busy.png | Bin .../corelib/doc}/images/cursor-closedhand.png | Bin .../corelib/doc}/images/cursor-cross.png | Bin .../corelib/doc}/images/cursor-forbidden.png | Bin .../src => src/corelib/doc}/images/cursor-hand.png | Bin .../corelib/doc}/images/cursor-hsplit.png | Bin .../corelib/doc}/images/cursor-ibeam.png | Bin .../corelib/doc}/images/cursor-openhand.png | Bin .../corelib/doc}/images/cursor-sizeall.png | Bin .../corelib/doc}/images/cursor-sizeb.png | Bin .../corelib/doc}/images/cursor-sizef.png | Bin .../corelib/doc}/images/cursor-sizeh.png | Bin .../corelib/doc}/images/cursor-sizev.png | Bin .../corelib/doc}/images/cursor-uparrow.png | Bin .../corelib/doc}/images/cursor-vsplit.png | Bin .../src => src/corelib/doc}/images/cursor-wait.png | Bin .../corelib/doc}/images/cursor-whatsthis.png | Bin .../corelib/doc}/images/javaiterators1.png | Bin .../corelib/doc}/images/javaiterators2.png | Bin .../corelib/doc}/images/modelindex-no-parent.png | Bin .../doc}/images/modelview-begin-append-columns.png | Bin .../doc}/images/modelview-begin-append-rows.png | Bin .../doc}/images/modelview-begin-insert-columns.png | Bin .../doc}/images/modelview-begin-insert-rows.png | Bin .../doc}/images/modelview-begin-remove-columns.png | Bin .../doc}/images/modelview-begin-remove-rows.png | Bin .../corelib/doc}/images/modelview-move-rows-1.png | Bin .../corelib/doc}/images/modelview-move-rows-2.png | Bin .../corelib/doc}/images/modelview-move-rows-3.png | Bin .../corelib/doc}/images/modelview-move-rows-4.png | Bin .../corelib/doc}/images/qeasingcurve-inback.png | Bin .../corelib/doc}/images/qeasingcurve-inbounce.png | Bin .../corelib/doc}/images/qeasingcurve-incirc.png | Bin .../corelib/doc}/images/qeasingcurve-incubic.png | Bin .../corelib/doc}/images/qeasingcurve-inelastic.png | Bin .../corelib/doc}/images/qeasingcurve-inexpo.png | Bin .../corelib/doc}/images/qeasingcurve-inoutback.png | Bin .../doc}/images/qeasingcurve-inoutbounce.png | Bin .../corelib/doc}/images/qeasingcurve-inoutcirc.png | Bin .../doc}/images/qeasingcurve-inoutcubic.png | Bin .../doc}/images/qeasingcurve-inoutelastic.png | Bin .../corelib/doc}/images/qeasingcurve-inoutexpo.png | Bin .../corelib/doc}/images/qeasingcurve-inoutquad.png | Bin .../doc}/images/qeasingcurve-inoutquart.png | Bin .../doc}/images/qeasingcurve-inoutquint.png | Bin .../corelib/doc}/images/qeasingcurve-inoutsine.png | Bin .../corelib/doc}/images/qeasingcurve-inquad.png | Bin .../corelib/doc}/images/qeasingcurve-inquart.png | Bin .../corelib/doc}/images/qeasingcurve-inquint.png | Bin .../corelib/doc}/images/qeasingcurve-insine.png | Bin .../corelib/doc}/images/qeasingcurve-linear.png | Bin .../corelib/doc}/images/qeasingcurve-outback.png | Bin .../corelib/doc}/images/qeasingcurve-outbounce.png | Bin .../corelib/doc}/images/qeasingcurve-outcirc.png | Bin .../corelib/doc}/images/qeasingcurve-outcubic.png | Bin .../doc}/images/qeasingcurve-outelastic.png | Bin .../corelib/doc}/images/qeasingcurve-outexpo.png | Bin .../corelib/doc}/images/qeasingcurve-outinback.png | Bin .../doc}/images/qeasingcurve-outinbounce.png | Bin .../corelib/doc}/images/qeasingcurve-outincirc.png | Bin .../doc}/images/qeasingcurve-outincubic.png | Bin .../doc}/images/qeasingcurve-outinelastic.png | Bin .../corelib/doc}/images/qeasingcurve-outinexpo.png | Bin .../corelib/doc}/images/qeasingcurve-outinquad.png | Bin .../doc}/images/qeasingcurve-outinquart.png | Bin .../doc}/images/qeasingcurve-outinquint.png | Bin .../corelib/doc}/images/qeasingcurve-outinsine.png | Bin .../corelib/doc}/images/qeasingcurve-outquad.png | Bin .../corelib/doc}/images/qeasingcurve-outquart.png | Bin .../corelib/doc}/images/qeasingcurve-outquint.png | Bin .../corelib/doc}/images/qeasingcurve-outsine.png | Bin .../corelib/doc}/images/qimage-scaling.png | Bin .../corelib/doc}/images/qline-coordinates.png | Bin .../src => src/corelib/doc}/images/qline-point.png | Bin .../images/qlinef-angle-identicaldirection.png | Bin .../doc}/images/qlinef-angle-oppositedirection.png | Bin .../corelib/doc}/images/qlinef-bounded.png | Bin .../corelib/doc}/images/qlinef-normalvector.png | Bin .../corelib/doc}/images/qlinef-unbounded.png | Bin {doc/src => src/corelib/doc}/images/qpen-bevel.png | Bin .../src => src/corelib/doc}/images/qpen-custom.png | Bin {doc/src => src/corelib/doc}/images/qpen-dash.png | Bin .../corelib/doc}/images/qpen-dashdot.png | Bin .../corelib/doc}/images/qpen-dashdotdot.png | Bin {doc/src => src/corelib/doc}/images/qpen-dot.png | Bin {doc/src => src/corelib/doc}/images/qpen-flat.png | Bin {doc/src => src/corelib/doc}/images/qpen-miter.png | Bin .../corelib/doc}/images/qpen-roundcap.png | Bin .../corelib/doc}/images/qpen-roundjoin.png | Bin {doc/src => src/corelib/doc}/images/qpen-solid.png | Bin .../src => src/corelib/doc}/images/qpen-square.png | Bin .../corelib/doc}/images/qrect-coordinates.png | Bin .../corelib/doc}/images/qrect-diagram-one.png | Bin .../corelib/doc}/images/qrect-diagram-three.png | Bin .../corelib/doc}/images/qrect-diagram-two.png | Bin .../corelib/doc}/images/qrect-diagram-zero.png | Bin .../corelib/doc}/images/qrect-intersect.png | Bin .../src => src/corelib/doc}/images/qrect-unite.png | Bin .../corelib/doc}/images/qrectf-coordinates.png | Bin .../corelib/doc}/images/qrectf-diagram-one.png | Bin .../corelib/doc}/images/qrectf-diagram-three.png | Bin .../corelib/doc}/images/qrectf-diagram-two.png | Bin .../doc}/images/qsortfilterproxymodel-sorting.png | Bin .../corelib/doc}/images/qurl-authority.png | Bin .../corelib/doc}/images/qurl-authority2.png | Bin .../corelib/doc}/images/qurl-authority3.png | Bin .../corelib/doc}/images/qurl-fragment.png | Bin .../corelib/doc}/images/qurl-ftppath.png | Bin .../corelib/doc}/images/qurl-mailtopath.png | Bin .../corelib/doc}/images/qurl-querystring.png | Bin .../corelib/doc}/images/stliterators1.png | Bin .../corelib/doc}/images/thread_clock.png | Bin .../corelib/doc}/images/threadsandobjects.png | Bin .../corelib/doc}/images/threadvisual-example.png | Bin src/corelib/doc/qtcore.qdocconf | 90 +++ .../corelib/doc}/snippets/buffer/buffer.cpp | 0 .../doc}/snippets/code/doc_src_containers.cpp | 0 .../corelib/doc}/snippets/code/doc_src_groups.cpp | 0 .../doc}/snippets/code/doc_src_objecttrees.cpp | 0 .../doc}/snippets/code/doc_src_properties.cpp | 0 .../doc}/snippets/code/doc_src_qalgorithms.cpp | 0 .../corelib/doc}/snippets/code/doc_src_qcache.cpp | 0 .../doc}/snippets/code/doc_src_qiterator.cpp | 0 .../doc}/snippets/code/doc_src_qnamespace.cpp | 0 .../doc}/snippets/code/doc_src_qnamespace.qdoc | 0 .../corelib/doc}/snippets/code/doc_src_qpair.cpp | 0 .../corelib/doc}/snippets/code/doc_src_qplugin.cpp | 0 .../corelib/doc}/snippets/code/doc_src_qplugin.pro | 0 .../corelib/doc}/snippets/code/doc_src_qset.cpp | 0 .../corelib/doc}/snippets/code/doc_src_qtcore.cpp | 0 .../doc}/snippets/code/doc_src_qvarlengtharray.cpp | 0 .../doc/snippets/code/qlogging/qlogging.cpp | 0 .../code/src_corelib_codecs_qtextcodec.cpp | 0 .../code/src_corelib_concurrent_qthreadpool.cpp | 0 .../snippets/code/src_corelib_global_qglobal.cpp | 0 .../code/src_corelib_io_qabstractfileengine.cpp | 0 .../snippets/code/src_corelib_io_qdatastream.cpp | 0 .../doc}/snippets/code/src_corelib_io_qdir.cpp | 0 .../snippets/code/src_corelib_io_qdiriterator.cpp | 0 .../doc}/snippets/code/src_corelib_io_qfile.cpp | 0 .../snippets/code/src_corelib_io_qfileinfo.cpp | 0 .../snippets/code/src_corelib_io_qiodevice.cpp | 0 .../doc}/snippets/code/src_corelib_io_qprocess.cpp | 0 .../snippets/code/src_corelib_io_qsettings.cpp | 0 .../snippets/code/src_corelib_io_qtemporarydir.cpp | 0 .../code/src_corelib_io_qtemporaryfile.cpp | 0 .../snippets/code/src_corelib_io_qtextstream.cpp | 0 .../doc}/snippets/code/src_corelib_io_qurl.cpp | 0 ...src_corelib_kernel_qabstracteventdispatcher.cpp | 0 .../code/src_corelib_kernel_qabstractitemmodel.cpp | 0 .../code/src_corelib_kernel_qcoreapplication.cpp | 0 .../code/src_corelib_kernel_qmetaobject.cpp | 0 .../snippets/code/src_corelib_kernel_qmetatype.cpp | 0 .../snippets/code/src_corelib_kernel_qmimedata.cpp | 0 .../snippets/code/src_corelib_kernel_qobject.cpp | 0 .../code/src_corelib_kernel_qsystemsemaphore.cpp | 0 .../snippets/code/src_corelib_kernel_qtimer.cpp | 0 .../snippets/code/src_corelib_kernel_qvariant.cpp | 0 .../code/src_corelib_mimetype_qmimedatabase.cpp | 0 .../snippets/code/src_corelib_plugin_qlibrary.cpp | 0 .../snippets/code/src_corelib_plugin_quuid.cpp | 0 .../src_corelib_statemachine_qstatemachine.cpp | 0 .../snippets/code/src_corelib_thread_qatomic.cpp | 0 .../snippets/code/src_corelib_thread_qmutex.cpp | 0 .../code/src_corelib_thread_qmutexpool.cpp | 0 .../code/src_corelib_thread_qreadwritelock.cpp | 0 .../code/src_corelib_thread_qsemaphore.cpp | 0 .../snippets/code/src_corelib_thread_qthread.cpp | 0 .../src_corelib_thread_qwaitcondition_unix.cpp | 0 .../snippets/code/src_corelib_tools_qbitarray.cpp | 0 .../snippets/code/src_corelib_tools_qbytearray.cpp | 0 .../snippets/code/src_corelib_tools_qdatetime.cpp | 0 .../code/src_corelib_tools_qeasingcurve.cpp | 0 .../doc}/snippets/code/src_corelib_tools_qhash.cpp | 0 .../code/src_corelib_tools_qlinkedlist.cpp | 0 .../snippets/code/src_corelib_tools_qlistdata.cpp | 0 .../snippets/code/src_corelib_tools_qlocale.cpp | 0 .../doc}/snippets/code/src_corelib_tools_qmap.cpp | 0 .../snippets/code/src_corelib_tools_qpoint.cpp | 0 .../doc/snippets/code/src_corelib_tools_qqueue.cpp | 48 ++ .../doc}/snippets/code/src_corelib_tools_qrect.cpp | 0 .../snippets/code/src_corelib_tools_qregexp.cpp | 0 .../code/src_corelib_tools_qregularexpression.cpp | 0 .../code/src_corelib_tools_qscopedpointer.cpp | 0 .../doc}/snippets/code/src_corelib_tools_qsize.cpp | 0 .../snippets/code/src_corelib_tools_qstring.cpp | 0 .../snippets/code/src_corelib_tools_qtimeline.cpp | 0 .../snippets/code/src_corelib_tools_qvector.cpp | 183 ++++++ .../snippets/code/src_corelib_xml_qxmlstream.cpp | 0 .../snippets/code/src_gui_dialogs_qmessagebox.cpp | 0 .../code/src_gui_itemviews_qidentityproxymodel.cpp | 0 .../code/src_gui_itemviews_qitemselectionmodel.cpp | 0 .../src => src/corelib/doc}/snippets/file/file.cpp | 0 .../corelib/doc}/snippets/fileinfo/main.cpp | 0 {doc/src => src/corelib/doc}/snippets/ntfsp.cpp | 0 src/corelib/doc/snippets/pointer/pointer.cpp | 60 ++ .../corelib/doc}/snippets/process/process.cpp | 0 .../corelib/doc}/snippets/qdebug/qdebugsnippet.cpp | 0 .../corelib/doc}/snippets/qdir-listfiles/main.cpp | 0 .../doc}/snippets/qdir-namefilters/main.cpp | 0 .../corelib/doc}/snippets/qelapsedtimer/main.cpp | 0 .../doc}/snippets/qmetaobject-invokable/main.cpp | 0 .../qmetaobject-invokable.pro | 0 .../doc}/snippets/qmetaobject-invokable/window.cpp | 0 .../doc}/snippets/qmetaobject-invokable/window.h | 0 .../doc}/snippets/qprocess-environment/main.cpp | 0 .../snippets/qprocess/qprocess-simpleexecution.cpp | 0 .../doc}/snippets/qsignalmapper/buttonwidget.cpp | 0 .../doc}/snippets/qsignalmapper/buttonwidget.h | 0 .../qsortfilterproxymodel-details/main.cpp | 0 .../corelib/doc}/snippets/qstack/main.cpp | 0 .../corelib/doc}/snippets/qstring/main.cpp | 0 .../doc}/snippets/qstring/stringbuilder.cpp | 0 .../corelib/doc}/snippets/qstringlist/main.cpp | 0 .../doc}/snippets/qstringlistmodel/main.cpp | 0 .../corelib/doc}/snippets/qtcast/qtcast.cpp | 0 .../doc}/snippets/qxmlstreamwriter/main.cpp | 0 .../corelib/doc}/snippets/settings/settings.cpp | 0 .../doc}/snippets/sharedemployee/employee.h | 0 .../corelib/doc}/snippets/sharedemployee/main.cpp | 0 .../doc}/snippets/signalmapper/filereader.cpp | 0 .../doc}/snippets/signalsandslots/lcdnumber.h | 0 .../snippets/signalsandslots/signalsandslots.cpp | 0 .../snippets/signalsandslots/signalsandslots.h | 0 .../corelib/doc}/snippets/streaming/main.cpp | 0 .../corelib/doc}/snippets/streaming/streaming.pro | 0 .../corelib/doc}/snippets/threads/threads.cpp | 0 .../corelib/doc}/snippets/threads/threads.h | 0 .../corelib/doc}/snippets/timers/timers.cpp | 0 .../corelib/doc/src}/containers.qdoc | 60 +- .../corelib/doc/src}/datastreamformat.qdoc | 0 .../corelib/doc/src}/implicit-sharing.qdoc | 4 +- {doc/src/corelib => src/corelib/doc/src}/json.qdoc | 2 +- .../corelib/doc/src}/objectmodel/metaobjects.qdoc | 14 +- .../corelib/doc/src}/objectmodel/object.qdoc | 0 .../corelib/doc/src}/objectmodel/objecttrees.qdoc | 4 +- .../corelib/doc/src}/objectmodel/properties.qdoc | 16 +- .../doc/src}/objectmodel/signalsandslots.qdoc | 62 +- .../corelib => src/corelib/doc/src}/qtcore.qdoc | 2 +- .../corelib/doc/src}/threads-basics.qdoc | 20 +- .../corelib => src/corelib/doc/src}/threads.qdoc | 16 +- src/corelib/global/qglobal.cpp | 203 ++----- src/corelib/global/qlogging.cpp | 78 ++- src/corelib/global/qnamespace.qdoc | 16 +- src/corelib/io/qabstractfileengine.cpp | 20 +- src/corelib/io/qbuffer.cpp | 10 +- src/corelib/io/qdatastream.cpp | 26 +- src/corelib/io/qdebug.cpp | 6 +- src/corelib/io/qdir.cpp | 62 +- src/corelib/io/qdiriterator.cpp | 2 +- src/corelib/io/qfile.cpp | 22 +- src/corelib/io/qfileinfo.cpp | 34 +- src/corelib/io/qiodevice.cpp | 56 +- src/corelib/io/qprocess.cpp | 30 +- src/corelib/io/qresource.cpp | 2 +- src/corelib/io/qsettings.cpp | 104 ++-- src/corelib/io/qstandardpaths.cpp | 2 +- src/corelib/io/qtemporarydir.cpp | 2 +- src/corelib/io/qtemporaryfile.cpp | 2 +- src/corelib/io/qtextstream.cpp | 38 +- src/corelib/io/qurl.cpp | 28 +- src/corelib/itemmodels/qabstractitemmodel.cpp | 48 +- src/corelib/itemmodels/qidentityproxymodel.cpp | 2 +- src/corelib/itemmodels/qitemselectionmodel.cpp | 12 +- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 16 +- src/corelib/itemmodels/qstringlistmodel.cpp | 2 +- src/corelib/json/qjsonarray.cpp | 13 +- src/corelib/json/qjsondocument.cpp | 16 +- src/corelib/json/qjsonobject.cpp | 44 +- src/corelib/kernel/qabstracteventdispatcher.cpp | 4 +- src/corelib/kernel/qbasictimer.cpp | 8 +- src/corelib/kernel/qcoreapplication.cpp | 28 +- src/corelib/kernel/qeventloop.cpp | 2 +- src/corelib/kernel/qmetaobject.cpp | 22 +- src/corelib/kernel/qmetaobjectbuilder.cpp | 4 +- src/corelib/kernel/qmetatype.cpp | 30 +- src/corelib/kernel/qmetatype.h | 25 + src/corelib/kernel/qmimedata.cpp | 16 +- src/corelib/kernel/qobject.cpp | 120 ++-- src/corelib/kernel/qobjectcleanuphandler.cpp | 2 +- src/corelib/kernel/qpointer.cpp | 6 +- src/corelib/kernel/qsharedmemory.cpp | 14 +- src/corelib/kernel/qsignalmapper.cpp | 10 +- src/corelib/kernel/qsystemsemaphore.cpp | 6 +- src/corelib/kernel/qtimer.cpp | 16 +- src/corelib/kernel/qtranslator.cpp | 2 +- src/corelib/kernel/qvariant.cpp | 20 +- src/corelib/mimetypes/qmimedatabase.cpp | 2 +- src/corelib/plugin/qlibrary.cpp | 10 +- src/corelib/plugin/qplugin.qdoc | 10 +- src/corelib/plugin/quuid.cpp | 6 +- src/corelib/statemachine/qstatemachine.cpp | 4 +- src/corelib/thread/qatomic.cpp | 77 +-- src/corelib/thread/qatomic.h | 4 +- src/corelib/thread/qmutex.cpp | 42 +- src/corelib/thread/qmutex.h | 1 - src/corelib/thread/qmutexpool.cpp | 4 +- src/corelib/thread/qreadwritelock.cpp | 24 +- src/corelib/thread/qsemaphore.cpp | 8 +- src/corelib/thread/qthread.cpp | 12 +- src/corelib/thread/qthread_win.cpp | 2 +- src/corelib/thread/qthreadpool.cpp | 2 +- src/corelib/thread/qthreadstorage.cpp | 6 +- src/corelib/thread/qwaitcondition.qdoc | 8 +- src/corelib/tools/qalgorithms.qdoc | 52 +- src/corelib/tools/qbitarray.cpp | 34 +- src/corelib/tools/qbytearray.cpp | 98 ++-- src/corelib/tools/qcache.qdoc | 6 +- src/corelib/tools/qdatetime.cpp | 56 +- src/corelib/tools/qeasingcurve.cpp | 180 +++--- src/corelib/tools/qelapsedtimer.cpp | 6 +- src/corelib/tools/qelapsedtimer_generic.cpp | 4 +- src/corelib/tools/qhash.cpp | 56 +- src/corelib/tools/qiterator.qdoc | 104 ++-- src/corelib/tools/qlinkedlist.cpp | 40 +- src/corelib/tools/qlist.cpp | 58 +- src/corelib/tools/qlocale.cpp | 8 +- src/corelib/tools/qlocale.qdoc | 8 +- src/corelib/tools/qmap.cpp | 60 +- src/corelib/tools/qpair.qdoc | 12 +- src/corelib/tools/qpoint.cpp | 42 +- src/corelib/tools/qqueue.cpp | 2 +- src/corelib/tools/qrect.cpp | 6 +- src/corelib/tools/qregexp.cpp | 50 +- src/corelib/tools/qregularexpression.cpp | 64 +-- src/corelib/tools/qscopedpointer.cpp | 12 +- src/corelib/tools/qset.qdoc | 30 +- src/corelib/tools/qshareddata.cpp | 18 +- src/corelib/tools/qsize.cpp | 24 +- src/corelib/tools/qstack.cpp | 2 +- src/corelib/tools/qstring.cpp | 262 +++++---- src/corelib/tools/qstringbuilder.cpp | 2 +- src/corelib/tools/qstringlist.cpp | 38 +- src/corelib/tools/qtimeline.cpp | 2 +- src/corelib/tools/qvarlengtharray.qdoc | 8 +- src/corelib/tools/qvector.cpp | 36 +- src/corelib/xml/qxmlstream.cpp | 12 +- src/corelib/xml/qxmlutils.cpp | 12 +- 345 files changed, 2530 insertions(+), 1604 deletions(-) create mode 100644 doc/global/qt-cpp-ignore.qdocconf create mode 100644 doc/global/style/offline.css rename {doc/src => src/corelib/doc}/images/abstract-connections.png (100%) rename {doc/src => src/corelib/doc}/images/brush-styles.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-arrow.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-busy.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-closedhand.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-cross.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-forbidden.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-hand.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-hsplit.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-ibeam.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-openhand.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-sizeall.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-sizeb.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-sizef.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-sizeh.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-sizev.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-uparrow.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-vsplit.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-wait.png (100%) rename {doc/src => src/corelib/doc}/images/cursor-whatsthis.png (100%) rename {doc/src => src/corelib/doc}/images/javaiterators1.png (100%) rename {doc/src => src/corelib/doc}/images/javaiterators2.png (100%) rename {doc/src => src/corelib/doc}/images/modelindex-no-parent.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-append-columns.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-append-rows.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-insert-columns.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-insert-rows.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-remove-columns.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-begin-remove-rows.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-move-rows-1.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-move-rows-2.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-move-rows-3.png (100%) rename {doc/src => src/corelib/doc}/images/modelview-move-rows-4.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inback.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inbounce.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-incirc.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-incubic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inelastic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inexpo.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutback.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutbounce.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutcirc.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutcubic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutelastic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutexpo.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutquad.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutquart.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutquint.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inoutsine.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inquad.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inquart.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-inquint.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-insine.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-linear.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outback.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outbounce.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outcirc.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outcubic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outelastic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outexpo.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinback.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinbounce.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outincirc.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outincubic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinelastic.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinexpo.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinquad.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinquart.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinquint.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outinsine.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outquad.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outquart.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outquint.png (100%) rename {doc/src => src/corelib/doc}/images/qeasingcurve-outsine.png (100%) rename {doc/src => src/corelib/doc}/images/qimage-scaling.png (100%) rename {doc/src => src/corelib/doc}/images/qline-coordinates.png (100%) rename {doc/src => src/corelib/doc}/images/qline-point.png (100%) rename {doc/src => src/corelib/doc}/images/qlinef-angle-identicaldirection.png (100%) rename {doc/src => src/corelib/doc}/images/qlinef-angle-oppositedirection.png (100%) rename {doc/src => src/corelib/doc}/images/qlinef-bounded.png (100%) rename {doc/src => src/corelib/doc}/images/qlinef-normalvector.png (100%) rename {doc/src => src/corelib/doc}/images/qlinef-unbounded.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-bevel.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-custom.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-dash.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-dashdot.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-dashdotdot.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-dot.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-flat.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-miter.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-roundcap.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-roundjoin.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-solid.png (100%) rename {doc/src => src/corelib/doc}/images/qpen-square.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-coordinates.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-diagram-one.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-diagram-three.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-diagram-two.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-diagram-zero.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-intersect.png (100%) rename {doc/src => src/corelib/doc}/images/qrect-unite.png (100%) rename {doc/src => src/corelib/doc}/images/qrectf-coordinates.png (100%) rename {doc/src => src/corelib/doc}/images/qrectf-diagram-one.png (100%) rename {doc/src => src/corelib/doc}/images/qrectf-diagram-three.png (100%) rename {doc/src => src/corelib/doc}/images/qrectf-diagram-two.png (100%) rename {doc/src => src/corelib/doc}/images/qsortfilterproxymodel-sorting.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-authority.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-authority2.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-authority3.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-fragment.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-ftppath.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-mailtopath.png (100%) rename {doc/src => src/corelib/doc}/images/qurl-querystring.png (100%) rename {doc/src => src/corelib/doc}/images/stliterators1.png (100%) rename {doc/src => src/corelib/doc}/images/thread_clock.png (100%) rename {doc/src => src/corelib/doc}/images/threadsandobjects.png (100%) rename {doc/src => src/corelib/doc}/images/threadvisual-example.png (100%) create mode 100644 src/corelib/doc/qtcore.qdocconf rename {doc/src => src/corelib/doc}/snippets/buffer/buffer.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_containers.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_groups.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_objecttrees.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_properties.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qalgorithms.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qcache.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qiterator.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qnamespace.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qnamespace.qdoc (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qpair.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qplugin.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qplugin.pro (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qset.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qtcore.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/doc_src_qvarlengtharray.cpp (100%) rename doc/src/snippets/qlogging/qloggingsnippet.cpp => src/corelib/doc/snippets/code/qlogging/qlogging.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_codecs_qtextcodec.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_concurrent_qthreadpool.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_global_qglobal.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qabstractfileengine.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qdatastream.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qdir.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qdiriterator.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qfile.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qfileinfo.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qiodevice.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qprocess.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qsettings.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qtemporarydir.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qtemporaryfile.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qtextstream.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_io_qurl.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qcoreapplication.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qmetaobject.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qmetatype.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qmimedata.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qobject.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qtimer.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_kernel_qvariant.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_mimetype_qmimedatabase.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_plugin_qlibrary.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_plugin_quuid.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_statemachine_qstatemachine.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qatomic.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qmutex.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qmutexpool.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qreadwritelock.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qsemaphore.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qthread.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qbitarray.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qbytearray.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qdatetime.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qeasingcurve.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qhash.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qlinkedlist.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qlistdata.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qlocale.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qmap.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qpoint.cpp (100%) create mode 100644 src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qrect.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qregexp.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qregularexpression.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qscopedpointer.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qsize.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qstring.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_tools_qtimeline.cpp (100%) create mode 100644 src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp rename {doc/src => src/corelib/doc}/snippets/code/src_corelib_xml_qxmlstream.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_gui_dialogs_qmessagebox.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/file/file.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/fileinfo/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/ntfsp.cpp (100%) create mode 100644 src/corelib/doc/snippets/pointer/pointer.cpp rename {doc/src => src/corelib/doc}/snippets/process/process.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qdebug/qdebugsnippet.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qdir-listfiles/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qdir-namefilters/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qelapsedtimer/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qmetaobject-invokable/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qmetaobject-invokable/qmetaobject-invokable.pro (100%) rename {doc/src => src/corelib/doc}/snippets/qmetaobject-invokable/window.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qmetaobject-invokable/window.h (100%) rename {doc/src => src/corelib/doc}/snippets/qprocess-environment/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qprocess/qprocess-simpleexecution.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qsignalmapper/buttonwidget.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qsignalmapper/buttonwidget.h (100%) rename {doc/src => src/corelib/doc}/snippets/qsortfilterproxymodel-details/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qstack/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qstring/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qstring/stringbuilder.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qstringlist/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qstringlistmodel/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qtcast/qtcast.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/qxmlstreamwriter/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/settings/settings.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/sharedemployee/employee.h (100%) rename {doc/src => src/corelib/doc}/snippets/sharedemployee/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/signalmapper/filereader.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/signalsandslots/lcdnumber.h (100%) rename {doc/src => src/corelib/doc}/snippets/signalsandslots/signalsandslots.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/signalsandslots/signalsandslots.h (100%) rename {doc/src => src/corelib/doc}/snippets/streaming/main.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/streaming/streaming.pro (100%) rename {doc/src => src/corelib/doc}/snippets/threads/threads.cpp (100%) rename {doc/src => src/corelib/doc}/snippets/threads/threads.h (100%) rename {doc/src => src/corelib/doc}/snippets/timers/timers.cpp (100%) rename {doc/src/corelib => src/corelib/doc/src}/containers.qdoc (95%) rename {doc/src/network/files-and-resources => src/corelib/doc/src}/datastreamformat.qdoc (100%) rename {doc/src/corelib => src/corelib/doc/src}/implicit-sharing.qdoc (97%) rename {doc/src/corelib => src/corelib/doc/src}/json.qdoc (97%) rename {doc/src/corelib => src/corelib/doc/src}/objectmodel/metaobjects.qdoc (93%) rename {doc/src/corelib => src/corelib/doc/src}/objectmodel/object.qdoc (100%) rename {doc/src/corelib => src/corelib/doc/src}/objectmodel/objecttrees.qdoc (97%) rename {doc/src/corelib => src/corelib/doc/src}/objectmodel/properties.qdoc (96%) rename {doc/src/corelib => src/corelib/doc/src}/objectmodel/signalsandslots.qdoc (90%) rename {doc/src/corelib => src/corelib/doc/src}/qtcore.qdoc (95%) rename {doc/src/corelib => src/corelib/doc/src}/threads-basics.qdoc (97%) rename {doc/src/corelib => src/corelib/doc/src}/threads.qdoc (98%) diff --git a/doc/global/qt-cpp-ignore.qdocconf b/doc/global/qt-cpp-ignore.qdocconf new file mode 100644 index 0000000..9dbb7d9 --- /dev/null +++ b/doc/global/qt-cpp-ignore.qdocconf @@ -0,0 +1,54 @@ +Cpp.ignoretokens = QT_ASCII_CAST_WARN \ + QT_ASCII_CAST_WARN_CONSTRUCTOR \ + QT_BEGIN_HEADER \ + QT_BOOTSTRAPPED \ + QT_DESIGNER_STATIC \ + QT_END_HEADER \ + QT_FASTCALL \ + Q_COMPAT_EXPORT \ + Q_CORE_EXPORT \ + Q_CORE_EXPORT_INLINE \ + Q_EXPORT \ + Q_EXPORT_PLUGIN \ + Q_EXPORT_PLUGIN2 \ + Q_AUTOTEST_EXPORT \ + Q_GUI_EXPORT \ + Q_GUI_EXPORT_INLINE \ + Q_INLINE_TEMPLATE \ + Q_NETWORK_EXPORT \ + Q_OPENGL_EXPORT \ + Q_OPENVG_EXPORT \ + Q_OUTOFLINE_TEMPLATE \ + Q_SQL_EXPORT \ + Q_SVG_EXPORT \ + Q_SCRIPT_EXPORT \ + Q_SCRIPTTOOLS_EXPORT \ + Q_XML_EXPORT \ + Q_XMLPATTERNS_EXPORT \ + QDBUS_EXPORT \ + Q_DBUS_EXPORT \ + QT_BEGIN_NAMESPACE \ + QT_BEGIN_INCLUDE_NAMESPACE \ + QT_END_NAMESPACE \ + QT_END_INCLUDE_NAMESPACE \ + Q_GADGET \ + Q_INVOKABLE \ + Q_DECL_CONSTEXPR +Cpp.ignoredirectives = Q_DECLARE_INTERFACE \ + Q_DECLARE_METATYPE \ + Q_DECLARE_OPERATORS_FOR_FLAGS \ + Q_DECLARE_PRIVATE \ + Q_DECLARE_PUBLIC \ + Q_DECLARE_SHARED \ + Q_DECLARE_TR_FUNCTIONS \ + Q_DECLARE_TYPEINFO \ + Q_DISABLE_COPY \ + QT_FORWARD_DECLARE_CLASS \ + Q_DUMMY_COMPARISON_OPERATOR \ + Q_ENUMS \ + Q_FLAGS \ + Q_INTERFACES \ + __attribute__ \ + Q_PRIVATE_PROPERTY \ + Q_DECLARE_PRIVATE_D \ + Q_CLASSINFO diff --git a/doc/global/style/offline.css b/doc/global/style/offline.css new file mode 100644 index 0000000..1b430ab --- /dev/null +++ b/doc/global/style/offline.css @@ -0,0 +1,622 @@ +body{ +font: normal 400 14px/1.2 Arial; +margin-top:85px; +font-family: Arial, Helvetica; +color:#313131; +text-align:justify; +margin-left:5px; +margin-right:5px; +} + +img{ +-moz-box-shadow: 3px 3px 3px #ccc; +-webkit-box-shadow: 3px 3px 3px #ccc; +box-shadow: 3px 3px 3px #ccc; +border:#8E8D8D 2px solid; +margin-left:0px; +max-width: 800px; +height: auto +} + +b{ +font-weight:600; +} + +.content{} + +.descr{ +margin-top:35px; +/*max-width: 75%;*/ +margin-left:5px; +text-align:justify; +min-height:700px; +vertical-align:top; +} + +.name{ +max-width: 75%; +font-weight:100; +} + +tt{ +text-align:left;} + +/* +----------- +links +----------- +*/ + +a:link{ +color: #2C418D; +text-decoration: none; +text-align:left; +} + +a:hover{ +color: #869CD1; +text-decoration:underline; +text-align:left; +} + +a:visited{ +color: #869CD1; +text-decoration: none; +text-align:left; +} + +a:visited:hover{ +text-decoration:underline; +text-align:left; +} + +a[href*="http://"], a[href*="ftp://"],a[href*="https://"] +{ +text-decoration: none; +background-image:url(../images/ico_out.png); +background-repeat:no-repeat; +background-position:left; +padding-left:20px; +text-align:left; +} + +.flags{ +text-decoration:none; +text-height:24px; +} + +/* +------------------------------- +NOTE styles +------------------------------- +*/ +.notetitle, .tiptitle, .fastpathtitle{ +font-weight:bold; +} + +.attentiontitle,.cautiontitle,.dangertitle,.importanttitle,.remembertitle,.restrictiontitle{ +font-weight:bold; +} + +.note,.tip,.fastpath{ +background: #F2F2F2 url(../images/ico_note.png); +background-repeat: no-repeat; +background-position: top left; +padding:5px; +padding-left:40px; +padding-bottom:10px; +border:#999 1px dotted; +color:#666666; +margin:5px; +} + +.attention,.caution,.danger,.important,.remember,.restriction{ +background: #F2F2F2 url(../images/ico_note_attention.png); +background-repeat:no-repeat; +background-position:top left; +padding:5px; +padding-left:40px; +padding-bottom:10px; +border:#999 1px dotted; +color:#666666; +margin:5px; +} + +/* +------------------------------- +Top navigation +------------------------------- +*/ + +.header{ + +height:1px; +padding:0px; +margin:0px; +} + +.qtref{ +display: block; +position: relative; +top: -76px; +height:15px; +z-index: 1; +font-size:11px; +padding-right:10px; +float:right; +} + +.naviNextPrevious{ +display: block; +position: relative; +text-align: right; +top: -53px; +float:right; +height:20px; +z-index:1; +padding-right:10px; +padding-top:2px; +vertical-align:top; +margin:0px; +} + + +.naviNextPrevious > a:first-child{ +background-image:url(../images/btn_prev.png); +background-repeat:no-repeat; +background-position:left; +padding-left:20px; +height:20px; +padding-left:20px; +} + +.naviNextPrevious > a:last-child{ +background-image:url(../images/btn_next.png); +background-repeat:no-repeat; +background-position:right; +padding-right:20px; +height:20px; +margin-left:30px; +} + +.breadcrumb{ +display: block; +position: relative; +top:-20px; +/*border-top:2px solid #ffffff;*/ +border-bottom: 1px solid #cecece; +background-color:#F2F2F2; +z-index:1; +height:20px; +padding:0px; +margin:0px; +padding-left:10px; +padding-top:2px; +margin-left:-5px; +margin-right:-5px; +} + +.breadcrumb ul{ + margin:0px; + padding:0px; +} + +.breadcrumb ul li{ +background-color:#F2F2F2; +list-style-type:none; +padding:0; +margin:0; +height:20px; +} + +.breadcrumb li{ +float:left; +} + +.breadcrumb .first { +background:url(../images/home.png); +background-position:left; +background-repeat:no-repeat; +padding-left:20px; +} + + +.breadcrumb li a{ +color:#2C418D; +display:block; +text-decoration:none; +background:url(../images/arrow.png); +background-repeat:no-repeat; +background-position:right; +padding-right:25px; +padding-left:10px; +} + +.breadcrumb li a:hover{ +color:#909090; +display:block; +text-decoration:none; +background:url(../images/arrow.png); +background-repeat:no-repeat; +background-position:right; +padding-right:20px; +padding-left:10px; +} + + +/* table of content +no display +*/ + +/* +----------- +headers +----------- +*/ + + +@media screen{ +.title{ +color:#313131; +font-size: 18px; +font-weight: normal; +left: 0; +padding-bottom: 20px; +padding-left: 10px; +padding-top: 20px; +position: absolute; +right: 0; +top: 0; +background-color:#E6E6E6; +border-bottom: 1px #CCC solid; +border-top: 2px #CCC solid; +font-weight:bold; +margin-left:0px; +margin-right:0px; +} +} + +h1 { +margin: 0; +} + +h2, p.h2 { +font: 500 16px/1.2 Arial; +font-weight:100; +background-color:#F2F3F4; +padding:4px; +margin-bottom:30px; +margin-top:30px; +border-top:#E0E0DE 1px solid; +border-bottom: #E0E0DE 1px solid; +max-width: 99%; +} + +h3{ + +font: 500 14px/1.2 Arial; +font-weight:100; +text-decoration:underline; +margin-bottom:30px; +margin-top:30px; +} + +h3.fn,span.fn{ +border-width: 1px; +border-style: solid; +border-color: #E6E6E6; +-moz-border-radius: 7px 7px 7px 7px; +-webkit-border-radius: 7px 7px 7px 7px; +border-radius: 7px 7px 7px 7px; +background-color: #F6F6F6; +word-spacing: 3px; +padding: 5px 5px; +text-decoration:none; +font-weight:bold; +max-width:75%; +font-size:14px; +margin:0px; +margin-top:30px; + +} + +.name{ +color:#1A1A1A; +} +.type{ +color:#808080; +} + + + +@media print { +.title { +color:#0066CB; +font-family:Arial, Helvetica; +font-size: 32px; +font-weight: normal; +left: 0; +position: absolute; +right: 0; +top: 0; +} +} + + +/* +----------------- +table styles +----------------- +*/ +.table img { +border:none; +margin-left:0px; +-moz-box-shadow:0px 0px 0px #fff; +-webkit-box-shadow: 0px 0px 0px #fff; +box-shadow: 0px 0px 0px #fff; +} + +/* table with border alternative colours*/ + + table,pre{ +-moz-border-radius: 7px 7px 7px 7px; +-webkit-border-radius: 7px 7px 7px 7px; + border-radius: 7px 7px 7px 7px; +background-color: #F6F6F6; +border: 1px solid #E6E6E6; +border-collapse: separate; +font-size: 12px; +line-height: 1.2; +margin-bottom: 25px; +margin-left: 15px; +font-size: 12px; +line-height: 1.2; +margin-bottom: 25px; +margin-left: 15px; +} + + +table th{ +text-align:left; +padding-left:20px; +} + +table td { +padding: 3px 15px 3px 20px; +border-bottom:#CCC dotted 1px; +} +table p { margin:0px;} + +table tr.even { +background-color: white; +color: #66666E; +} + +table tr.odd { +background-color: #F6F6F6; +color: #66666E; +} + + +table thead { +text-align:left; +padding-left:20px; +background-color:#e1e0e0; +border-left:none; +border-right:none; +} + +table thead th { +padding-top:5px; +padding-left:10px; +padding-bottom:5px; +border-bottom: 2px solid #D1D1D1; +padding-right:10px; +} + + +/* table bodless & white*/ + +.borderless { +border-radius: 0px 0px 0px 0px; +background-color: #fff; +border: 1px solid #fff; +} + +.borderless tr { +background-color: #FFF; +color: #66666E; +} + +.borderless td { +border:none; +border-bottom:#fff dotted 1px; +} + +/* +----------- +List +----------- +*/ + +ul{ +padding-bottom:2px; +} + +li { +margin-bottom: 10px; +padding-left: 8px; +list-style:outside; +list-style-type:square; +text-align:left; +} + + +ol{ +margin:10px; +padding:0; +} + +ol > li{ +margin-left: 30px; +padding-left:8px; +list-style:decimal; +} + +.centerAlign{ +text-align: left; +} + +.cpp{ +display: block; +margin: 10; +overflow: hidden; +overflow-x: hidden; +overflow-y: hidden; +padding: 20px 0 20px 0; +} + +.footer{ +margin-top: 50px; +padding-left:5px; +margin-bottom: 10px; +font-size:10px; +border-top: 1px solid #999; +padding-top:11px; +} + +.footerNavi{ +width:auto; +text-align:right; +margin-top:50px; +z-index:1; +} + +.memItemLeft{ +padding-right: 3px; +} + +.memItemRight{ +padding: 3px 15px 3px 0; +} + +.qml{ +display: block; +margin: 10; +overflow: hidden; +overflow-x: hidden; +overflow-y: hidden; +padding: 20px 0 20px 0; +} + +.qmldefault{ +padding-left: 5px; +float: right; +color: red; +} + +.qmlreadonly{ +padding-left: 5px; +float: right; +color: #254117; +} + +.rightAlign{ +padding: 3px 5px 3px 10px; +text-align: right; +} + +/* +----------- +Content table +----------- +*/ + +@media print{ +.toc { +float: right; +padding-bottom: 10px; +padding-top: 50px; +width: 100%; +background-image:url(../images/bgrContent.png); +background-position:top; +background-repeat:no-repeat; +} +} + +@media screen{ +.toc{ +clear:both; +float:right; +vertical-align:top; +-moz-border-radius: 7px 7px 7px 7px; +-webkit-border-radius: 7px 7px 7px 7px; +border-radius: 7px 7px 7px 7px; + background:#FFF url(../images/bgrContent.png); +background-position:top; +background-repeat:repeat-x; +border: 1px solid #E6E6E6; +padding-left:5px; +padding-bottom:10px; +height: auto; +width: 200px; +text-align:left; +z-index:2; +margin-left:20px; +margin-right:20px; +margin-top:0px; +padding-top:0px; +} +} + +.toc h3{ +text-decoration:none; +} + +.toc h3{font: 500 14px/1.2 Arial; +font-weight:100; +padding:0px; +margin:0px; +padding-top:5px; +padding-left:5px; +} + + +.toc ul{ +width:160px; +padding-left:10px; +padding-right:5px; +padding-bottom:10px; +padding-top:10px; +} + +.toc ul li{ +margin-left:20px; +list-style-image:url(../images/blu_dot.png); +list-style:outside; + +} + + +.toc ul li a:link{ +color: #2C418D; +text-decoration: none; +} + +.toc ul li a:hover{ +color: #869CD1; +text-decoration:underline; + +} + +.toc ul li a:visited{ +color: #869CD1; +font-weight: bold; +} + +.level1{ +border:none;} + +.clearfix{ +clear:both;} + diff --git a/src/corelib/codecs/codecs.qdoc b/src/corelib/codecs/codecs.qdoc index 669072f..05714b2 100644 --- a/src/corelib/codecs/codecs.qdoc +++ b/src/corelib/codecs/codecs.qdoc @@ -68,8 +68,8 @@ for Qt. \legalese - Copyright (C) 2000 Ming-Che Chuang \BR - Copyright (C) 2002 James Su, Turbolinux Inc. \BR + Copyright (C) 2000 Ming-Che Chuang + Copyright (C) 2002 James Su, Turbolinux Inc. Copyright (C) 2002 Anthony Fok, ThizLinux Laboratory Ltd. Redistribution and use in source and binary forms, with or without @@ -137,9 +137,9 @@ for the various Big5 CharMapML tables. \legalese - Copyright (C) 2000 Ming-Che Chuang \BR - Copyright (C) 2001, 2002 James Su, Turbolinux Inc. \BR - Copyright (C) 2002 WU Yi, HancomLinux Inc. \BR + Copyright (C) 2000 Ming-Che Chuang + Copyright (C) 2001, 2002 James Su, Turbolinux Inc. + Copyright (C) 2002 WU Yi, HancomLinux Inc. Copyright (C) 2001, 2002 Anthony Fok, ThizLinux Laboratory Ltd. Redistribution and use in source and binary forms, with or without @@ -307,8 +307,8 @@ The copyright notice for their code follows: \legalese - Copyright (C) 2000 TurboLinux, Inc. Written by Justin Yu and Sean Chen. \BR - Copyright (C) 2001, 2002 Turbolinux, Inc. Written by James Su. \BR + Copyright (C) 2000 TurboLinux, Inc. Written by Justin Yu and Sean Chen. + Copyright (C) 2001, 2002 Turbolinux, Inc. Written by James Su. Copyright (C) 2001, 2002 ThizLinux Laboratory Ltd. Written by Anthony Fok. Redistribution and use in source and binary forms, with or without diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 784a75b..b7939f1 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -818,13 +818,13 @@ QTextCodec::ConverterState::~ConverterState() KOI8-R encoding, and want to convert it to Unicode. The simple way to do it is like this: - \snippet doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp 0 + \snippet code/src_corelib_codecs_qtextcodec.cpp 0 After this, \c string holds the text converted to Unicode. Converting a string from Unicode to the local encoding is just as easy: - \snippet doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp 1 + \snippet code/src_corelib_codecs_qtextcodec.cpp 1 To read or write files in various encodings, use QTextStream and its \l{QTextStream::setCodec()}{setCodec()} function. See the @@ -841,7 +841,7 @@ QTextCodec::ConverterState::~ConverterState() object for the codec and use this QTextDecoder for the whole decoding process, as shown below: - \snippet doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp 2 + \snippet code/src_corelib_codecs_qtextcodec.cpp 2 The QTextDecoder object maintains state between chunks and therefore works correctly even if a multi-byte character is split between diff --git a/doc/src/images/abstract-connections.png b/src/corelib/doc/images/abstract-connections.png similarity index 100% rename from doc/src/images/abstract-connections.png rename to src/corelib/doc/images/abstract-connections.png diff --git a/doc/src/images/brush-styles.png b/src/corelib/doc/images/brush-styles.png similarity index 100% rename from doc/src/images/brush-styles.png rename to src/corelib/doc/images/brush-styles.png diff --git a/doc/src/images/cursor-arrow.png b/src/corelib/doc/images/cursor-arrow.png similarity index 100% rename from doc/src/images/cursor-arrow.png rename to src/corelib/doc/images/cursor-arrow.png diff --git a/doc/src/images/cursor-busy.png b/src/corelib/doc/images/cursor-busy.png similarity index 100% rename from doc/src/images/cursor-busy.png rename to src/corelib/doc/images/cursor-busy.png diff --git a/doc/src/images/cursor-closedhand.png b/src/corelib/doc/images/cursor-closedhand.png similarity index 100% rename from doc/src/images/cursor-closedhand.png rename to src/corelib/doc/images/cursor-closedhand.png diff --git a/doc/src/images/cursor-cross.png b/src/corelib/doc/images/cursor-cross.png similarity index 100% rename from doc/src/images/cursor-cross.png rename to src/corelib/doc/images/cursor-cross.png diff --git a/doc/src/images/cursor-forbidden.png b/src/corelib/doc/images/cursor-forbidden.png similarity index 100% rename from doc/src/images/cursor-forbidden.png rename to src/corelib/doc/images/cursor-forbidden.png diff --git a/doc/src/images/cursor-hand.png b/src/corelib/doc/images/cursor-hand.png similarity index 100% rename from doc/src/images/cursor-hand.png rename to src/corelib/doc/images/cursor-hand.png diff --git a/doc/src/images/cursor-hsplit.png b/src/corelib/doc/images/cursor-hsplit.png similarity index 100% rename from doc/src/images/cursor-hsplit.png rename to src/corelib/doc/images/cursor-hsplit.png diff --git a/doc/src/images/cursor-ibeam.png b/src/corelib/doc/images/cursor-ibeam.png similarity index 100% rename from doc/src/images/cursor-ibeam.png rename to src/corelib/doc/images/cursor-ibeam.png diff --git a/doc/src/images/cursor-openhand.png b/src/corelib/doc/images/cursor-openhand.png similarity index 100% rename from doc/src/images/cursor-openhand.png rename to src/corelib/doc/images/cursor-openhand.png diff --git a/doc/src/images/cursor-sizeall.png b/src/corelib/doc/images/cursor-sizeall.png similarity index 100% rename from doc/src/images/cursor-sizeall.png rename to src/corelib/doc/images/cursor-sizeall.png diff --git a/doc/src/images/cursor-sizeb.png b/src/corelib/doc/images/cursor-sizeb.png similarity index 100% rename from doc/src/images/cursor-sizeb.png rename to src/corelib/doc/images/cursor-sizeb.png diff --git a/doc/src/images/cursor-sizef.png b/src/corelib/doc/images/cursor-sizef.png similarity index 100% rename from doc/src/images/cursor-sizef.png rename to src/corelib/doc/images/cursor-sizef.png diff --git a/doc/src/images/cursor-sizeh.png b/src/corelib/doc/images/cursor-sizeh.png similarity index 100% rename from doc/src/images/cursor-sizeh.png rename to src/corelib/doc/images/cursor-sizeh.png diff --git a/doc/src/images/cursor-sizev.png b/src/corelib/doc/images/cursor-sizev.png similarity index 100% rename from doc/src/images/cursor-sizev.png rename to src/corelib/doc/images/cursor-sizev.png diff --git a/doc/src/images/cursor-uparrow.png b/src/corelib/doc/images/cursor-uparrow.png similarity index 100% rename from doc/src/images/cursor-uparrow.png rename to src/corelib/doc/images/cursor-uparrow.png diff --git a/doc/src/images/cursor-vsplit.png b/src/corelib/doc/images/cursor-vsplit.png similarity index 100% rename from doc/src/images/cursor-vsplit.png rename to src/corelib/doc/images/cursor-vsplit.png diff --git a/doc/src/images/cursor-wait.png b/src/corelib/doc/images/cursor-wait.png similarity index 100% rename from doc/src/images/cursor-wait.png rename to src/corelib/doc/images/cursor-wait.png diff --git a/doc/src/images/cursor-whatsthis.png b/src/corelib/doc/images/cursor-whatsthis.png similarity index 100% rename from doc/src/images/cursor-whatsthis.png rename to src/corelib/doc/images/cursor-whatsthis.png diff --git a/doc/src/images/javaiterators1.png b/src/corelib/doc/images/javaiterators1.png similarity index 100% rename from doc/src/images/javaiterators1.png rename to src/corelib/doc/images/javaiterators1.png diff --git a/doc/src/images/javaiterators2.png b/src/corelib/doc/images/javaiterators2.png similarity index 100% rename from doc/src/images/javaiterators2.png rename to src/corelib/doc/images/javaiterators2.png diff --git a/doc/src/images/modelindex-no-parent.png b/src/corelib/doc/images/modelindex-no-parent.png similarity index 100% rename from doc/src/images/modelindex-no-parent.png rename to src/corelib/doc/images/modelindex-no-parent.png diff --git a/doc/src/images/modelview-begin-append-columns.png b/src/corelib/doc/images/modelview-begin-append-columns.png similarity index 100% rename from doc/src/images/modelview-begin-append-columns.png rename to src/corelib/doc/images/modelview-begin-append-columns.png diff --git a/doc/src/images/modelview-begin-append-rows.png b/src/corelib/doc/images/modelview-begin-append-rows.png similarity index 100% rename from doc/src/images/modelview-begin-append-rows.png rename to src/corelib/doc/images/modelview-begin-append-rows.png diff --git a/doc/src/images/modelview-begin-insert-columns.png b/src/corelib/doc/images/modelview-begin-insert-columns.png similarity index 100% rename from doc/src/images/modelview-begin-insert-columns.png rename to src/corelib/doc/images/modelview-begin-insert-columns.png diff --git a/doc/src/images/modelview-begin-insert-rows.png b/src/corelib/doc/images/modelview-begin-insert-rows.png similarity index 100% rename from doc/src/images/modelview-begin-insert-rows.png rename to src/corelib/doc/images/modelview-begin-insert-rows.png diff --git a/doc/src/images/modelview-begin-remove-columns.png b/src/corelib/doc/images/modelview-begin-remove-columns.png similarity index 100% rename from doc/src/images/modelview-begin-remove-columns.png rename to src/corelib/doc/images/modelview-begin-remove-columns.png diff --git a/doc/src/images/modelview-begin-remove-rows.png b/src/corelib/doc/images/modelview-begin-remove-rows.png similarity index 100% rename from doc/src/images/modelview-begin-remove-rows.png rename to src/corelib/doc/images/modelview-begin-remove-rows.png diff --git a/doc/src/images/modelview-move-rows-1.png b/src/corelib/doc/images/modelview-move-rows-1.png similarity index 100% rename from doc/src/images/modelview-move-rows-1.png rename to src/corelib/doc/images/modelview-move-rows-1.png diff --git a/doc/src/images/modelview-move-rows-2.png b/src/corelib/doc/images/modelview-move-rows-2.png similarity index 100% rename from doc/src/images/modelview-move-rows-2.png rename to src/corelib/doc/images/modelview-move-rows-2.png diff --git a/doc/src/images/modelview-move-rows-3.png b/src/corelib/doc/images/modelview-move-rows-3.png similarity index 100% rename from doc/src/images/modelview-move-rows-3.png rename to src/corelib/doc/images/modelview-move-rows-3.png diff --git a/doc/src/images/modelview-move-rows-4.png b/src/corelib/doc/images/modelview-move-rows-4.png similarity index 100% rename from doc/src/images/modelview-move-rows-4.png rename to src/corelib/doc/images/modelview-move-rows-4.png diff --git a/doc/src/images/qeasingcurve-inback.png b/src/corelib/doc/images/qeasingcurve-inback.png similarity index 100% rename from doc/src/images/qeasingcurve-inback.png rename to src/corelib/doc/images/qeasingcurve-inback.png diff --git a/doc/src/images/qeasingcurve-inbounce.png b/src/corelib/doc/images/qeasingcurve-inbounce.png similarity index 100% rename from doc/src/images/qeasingcurve-inbounce.png rename to src/corelib/doc/images/qeasingcurve-inbounce.png diff --git a/doc/src/images/qeasingcurve-incirc.png b/src/corelib/doc/images/qeasingcurve-incirc.png similarity index 100% rename from doc/src/images/qeasingcurve-incirc.png rename to src/corelib/doc/images/qeasingcurve-incirc.png diff --git a/doc/src/images/qeasingcurve-incubic.png b/src/corelib/doc/images/qeasingcurve-incubic.png similarity index 100% rename from doc/src/images/qeasingcurve-incubic.png rename to src/corelib/doc/images/qeasingcurve-incubic.png diff --git a/doc/src/images/qeasingcurve-inelastic.png b/src/corelib/doc/images/qeasingcurve-inelastic.png similarity index 100% rename from doc/src/images/qeasingcurve-inelastic.png rename to src/corelib/doc/images/qeasingcurve-inelastic.png diff --git a/doc/src/images/qeasingcurve-inexpo.png b/src/corelib/doc/images/qeasingcurve-inexpo.png similarity index 100% rename from doc/src/images/qeasingcurve-inexpo.png rename to src/corelib/doc/images/qeasingcurve-inexpo.png diff --git a/doc/src/images/qeasingcurve-inoutback.png b/src/corelib/doc/images/qeasingcurve-inoutback.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutback.png rename to src/corelib/doc/images/qeasingcurve-inoutback.png diff --git a/doc/src/images/qeasingcurve-inoutbounce.png b/src/corelib/doc/images/qeasingcurve-inoutbounce.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutbounce.png rename to src/corelib/doc/images/qeasingcurve-inoutbounce.png diff --git a/doc/src/images/qeasingcurve-inoutcirc.png b/src/corelib/doc/images/qeasingcurve-inoutcirc.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutcirc.png rename to src/corelib/doc/images/qeasingcurve-inoutcirc.png diff --git a/doc/src/images/qeasingcurve-inoutcubic.png b/src/corelib/doc/images/qeasingcurve-inoutcubic.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutcubic.png rename to src/corelib/doc/images/qeasingcurve-inoutcubic.png diff --git a/doc/src/images/qeasingcurve-inoutelastic.png b/src/corelib/doc/images/qeasingcurve-inoutelastic.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutelastic.png rename to src/corelib/doc/images/qeasingcurve-inoutelastic.png diff --git a/doc/src/images/qeasingcurve-inoutexpo.png b/src/corelib/doc/images/qeasingcurve-inoutexpo.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutexpo.png rename to src/corelib/doc/images/qeasingcurve-inoutexpo.png diff --git a/doc/src/images/qeasingcurve-inoutquad.png b/src/corelib/doc/images/qeasingcurve-inoutquad.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutquad.png rename to src/corelib/doc/images/qeasingcurve-inoutquad.png diff --git a/doc/src/images/qeasingcurve-inoutquart.png b/src/corelib/doc/images/qeasingcurve-inoutquart.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutquart.png rename to src/corelib/doc/images/qeasingcurve-inoutquart.png diff --git a/doc/src/images/qeasingcurve-inoutquint.png b/src/corelib/doc/images/qeasingcurve-inoutquint.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutquint.png rename to src/corelib/doc/images/qeasingcurve-inoutquint.png diff --git a/doc/src/images/qeasingcurve-inoutsine.png b/src/corelib/doc/images/qeasingcurve-inoutsine.png similarity index 100% rename from doc/src/images/qeasingcurve-inoutsine.png rename to src/corelib/doc/images/qeasingcurve-inoutsine.png diff --git a/doc/src/images/qeasingcurve-inquad.png b/src/corelib/doc/images/qeasingcurve-inquad.png similarity index 100% rename from doc/src/images/qeasingcurve-inquad.png rename to src/corelib/doc/images/qeasingcurve-inquad.png diff --git a/doc/src/images/qeasingcurve-inquart.png b/src/corelib/doc/images/qeasingcurve-inquart.png similarity index 100% rename from doc/src/images/qeasingcurve-inquart.png rename to src/corelib/doc/images/qeasingcurve-inquart.png diff --git a/doc/src/images/qeasingcurve-inquint.png b/src/corelib/doc/images/qeasingcurve-inquint.png similarity index 100% rename from doc/src/images/qeasingcurve-inquint.png rename to src/corelib/doc/images/qeasingcurve-inquint.png diff --git a/doc/src/images/qeasingcurve-insine.png b/src/corelib/doc/images/qeasingcurve-insine.png similarity index 100% rename from doc/src/images/qeasingcurve-insine.png rename to src/corelib/doc/images/qeasingcurve-insine.png diff --git a/doc/src/images/qeasingcurve-linear.png b/src/corelib/doc/images/qeasingcurve-linear.png similarity index 100% rename from doc/src/images/qeasingcurve-linear.png rename to src/corelib/doc/images/qeasingcurve-linear.png diff --git a/doc/src/images/qeasingcurve-outback.png b/src/corelib/doc/images/qeasingcurve-outback.png similarity index 100% rename from doc/src/images/qeasingcurve-outback.png rename to src/corelib/doc/images/qeasingcurve-outback.png diff --git a/doc/src/images/qeasingcurve-outbounce.png b/src/corelib/doc/images/qeasingcurve-outbounce.png similarity index 100% rename from doc/src/images/qeasingcurve-outbounce.png rename to src/corelib/doc/images/qeasingcurve-outbounce.png diff --git a/doc/src/images/qeasingcurve-outcirc.png b/src/corelib/doc/images/qeasingcurve-outcirc.png similarity index 100% rename from doc/src/images/qeasingcurve-outcirc.png rename to src/corelib/doc/images/qeasingcurve-outcirc.png diff --git a/doc/src/images/qeasingcurve-outcubic.png b/src/corelib/doc/images/qeasingcurve-outcubic.png similarity index 100% rename from doc/src/images/qeasingcurve-outcubic.png rename to src/corelib/doc/images/qeasingcurve-outcubic.png diff --git a/doc/src/images/qeasingcurve-outelastic.png b/src/corelib/doc/images/qeasingcurve-outelastic.png similarity index 100% rename from doc/src/images/qeasingcurve-outelastic.png rename to src/corelib/doc/images/qeasingcurve-outelastic.png diff --git a/doc/src/images/qeasingcurve-outexpo.png b/src/corelib/doc/images/qeasingcurve-outexpo.png similarity index 100% rename from doc/src/images/qeasingcurve-outexpo.png rename to src/corelib/doc/images/qeasingcurve-outexpo.png diff --git a/doc/src/images/qeasingcurve-outinback.png b/src/corelib/doc/images/qeasingcurve-outinback.png similarity index 100% rename from doc/src/images/qeasingcurve-outinback.png rename to src/corelib/doc/images/qeasingcurve-outinback.png diff --git a/doc/src/images/qeasingcurve-outinbounce.png b/src/corelib/doc/images/qeasingcurve-outinbounce.png similarity index 100% rename from doc/src/images/qeasingcurve-outinbounce.png rename to src/corelib/doc/images/qeasingcurve-outinbounce.png diff --git a/doc/src/images/qeasingcurve-outincirc.png b/src/corelib/doc/images/qeasingcurve-outincirc.png similarity index 100% rename from doc/src/images/qeasingcurve-outincirc.png rename to src/corelib/doc/images/qeasingcurve-outincirc.png diff --git a/doc/src/images/qeasingcurve-outincubic.png b/src/corelib/doc/images/qeasingcurve-outincubic.png similarity index 100% rename from doc/src/images/qeasingcurve-outincubic.png rename to src/corelib/doc/images/qeasingcurve-outincubic.png diff --git a/doc/src/images/qeasingcurve-outinelastic.png b/src/corelib/doc/images/qeasingcurve-outinelastic.png similarity index 100% rename from doc/src/images/qeasingcurve-outinelastic.png rename to src/corelib/doc/images/qeasingcurve-outinelastic.png diff --git a/doc/src/images/qeasingcurve-outinexpo.png b/src/corelib/doc/images/qeasingcurve-outinexpo.png similarity index 100% rename from doc/src/images/qeasingcurve-outinexpo.png rename to src/corelib/doc/images/qeasingcurve-outinexpo.png diff --git a/doc/src/images/qeasingcurve-outinquad.png b/src/corelib/doc/images/qeasingcurve-outinquad.png similarity index 100% rename from doc/src/images/qeasingcurve-outinquad.png rename to src/corelib/doc/images/qeasingcurve-outinquad.png diff --git a/doc/src/images/qeasingcurve-outinquart.png b/src/corelib/doc/images/qeasingcurve-outinquart.png similarity index 100% rename from doc/src/images/qeasingcurve-outinquart.png rename to src/corelib/doc/images/qeasingcurve-outinquart.png diff --git a/doc/src/images/qeasingcurve-outinquint.png b/src/corelib/doc/images/qeasingcurve-outinquint.png similarity index 100% rename from doc/src/images/qeasingcurve-outinquint.png rename to src/corelib/doc/images/qeasingcurve-outinquint.png diff --git a/doc/src/images/qeasingcurve-outinsine.png b/src/corelib/doc/images/qeasingcurve-outinsine.png similarity index 100% rename from doc/src/images/qeasingcurve-outinsine.png rename to src/corelib/doc/images/qeasingcurve-outinsine.png diff --git a/doc/src/images/qeasingcurve-outquad.png b/src/corelib/doc/images/qeasingcurve-outquad.png similarity index 100% rename from doc/src/images/qeasingcurve-outquad.png rename to src/corelib/doc/images/qeasingcurve-outquad.png diff --git a/doc/src/images/qeasingcurve-outquart.png b/src/corelib/doc/images/qeasingcurve-outquart.png similarity index 100% rename from doc/src/images/qeasingcurve-outquart.png rename to src/corelib/doc/images/qeasingcurve-outquart.png diff --git a/doc/src/images/qeasingcurve-outquint.png b/src/corelib/doc/images/qeasingcurve-outquint.png similarity index 100% rename from doc/src/images/qeasingcurve-outquint.png rename to src/corelib/doc/images/qeasingcurve-outquint.png diff --git a/doc/src/images/qeasingcurve-outsine.png b/src/corelib/doc/images/qeasingcurve-outsine.png similarity index 100% rename from doc/src/images/qeasingcurve-outsine.png rename to src/corelib/doc/images/qeasingcurve-outsine.png diff --git a/doc/src/images/qimage-scaling.png b/src/corelib/doc/images/qimage-scaling.png similarity index 100% rename from doc/src/images/qimage-scaling.png rename to src/corelib/doc/images/qimage-scaling.png diff --git a/doc/src/images/qline-coordinates.png b/src/corelib/doc/images/qline-coordinates.png similarity index 100% rename from doc/src/images/qline-coordinates.png rename to src/corelib/doc/images/qline-coordinates.png diff --git a/doc/src/images/qline-point.png b/src/corelib/doc/images/qline-point.png similarity index 100% rename from doc/src/images/qline-point.png rename to src/corelib/doc/images/qline-point.png diff --git a/doc/src/images/qlinef-angle-identicaldirection.png b/src/corelib/doc/images/qlinef-angle-identicaldirection.png similarity index 100% rename from doc/src/images/qlinef-angle-identicaldirection.png rename to src/corelib/doc/images/qlinef-angle-identicaldirection.png diff --git a/doc/src/images/qlinef-angle-oppositedirection.png b/src/corelib/doc/images/qlinef-angle-oppositedirection.png similarity index 100% rename from doc/src/images/qlinef-angle-oppositedirection.png rename to src/corelib/doc/images/qlinef-angle-oppositedirection.png diff --git a/doc/src/images/qlinef-bounded.png b/src/corelib/doc/images/qlinef-bounded.png similarity index 100% rename from doc/src/images/qlinef-bounded.png rename to src/corelib/doc/images/qlinef-bounded.png diff --git a/doc/src/images/qlinef-normalvector.png b/src/corelib/doc/images/qlinef-normalvector.png similarity index 100% rename from doc/src/images/qlinef-normalvector.png rename to src/corelib/doc/images/qlinef-normalvector.png diff --git a/doc/src/images/qlinef-unbounded.png b/src/corelib/doc/images/qlinef-unbounded.png similarity index 100% rename from doc/src/images/qlinef-unbounded.png rename to src/corelib/doc/images/qlinef-unbounded.png diff --git a/doc/src/images/qpen-bevel.png b/src/corelib/doc/images/qpen-bevel.png similarity index 100% rename from doc/src/images/qpen-bevel.png rename to src/corelib/doc/images/qpen-bevel.png diff --git a/doc/src/images/qpen-custom.png b/src/corelib/doc/images/qpen-custom.png similarity index 100% rename from doc/src/images/qpen-custom.png rename to src/corelib/doc/images/qpen-custom.png diff --git a/doc/src/images/qpen-dash.png b/src/corelib/doc/images/qpen-dash.png similarity index 100% rename from doc/src/images/qpen-dash.png rename to src/corelib/doc/images/qpen-dash.png diff --git a/doc/src/images/qpen-dashdot.png b/src/corelib/doc/images/qpen-dashdot.png similarity index 100% rename from doc/src/images/qpen-dashdot.png rename to src/corelib/doc/images/qpen-dashdot.png diff --git a/doc/src/images/qpen-dashdotdot.png b/src/corelib/doc/images/qpen-dashdotdot.png similarity index 100% rename from doc/src/images/qpen-dashdotdot.png rename to src/corelib/doc/images/qpen-dashdotdot.png diff --git a/doc/src/images/qpen-dot.png b/src/corelib/doc/images/qpen-dot.png similarity index 100% rename from doc/src/images/qpen-dot.png rename to src/corelib/doc/images/qpen-dot.png diff --git a/doc/src/images/qpen-flat.png b/src/corelib/doc/images/qpen-flat.png similarity index 100% rename from doc/src/images/qpen-flat.png rename to src/corelib/doc/images/qpen-flat.png diff --git a/doc/src/images/qpen-miter.png b/src/corelib/doc/images/qpen-miter.png similarity index 100% rename from doc/src/images/qpen-miter.png rename to src/corelib/doc/images/qpen-miter.png diff --git a/doc/src/images/qpen-roundcap.png b/src/corelib/doc/images/qpen-roundcap.png similarity index 100% rename from doc/src/images/qpen-roundcap.png rename to src/corelib/doc/images/qpen-roundcap.png diff --git a/doc/src/images/qpen-roundjoin.png b/src/corelib/doc/images/qpen-roundjoin.png similarity index 100% rename from doc/src/images/qpen-roundjoin.png rename to src/corelib/doc/images/qpen-roundjoin.png diff --git a/doc/src/images/qpen-solid.png b/src/corelib/doc/images/qpen-solid.png similarity index 100% rename from doc/src/images/qpen-solid.png rename to src/corelib/doc/images/qpen-solid.png diff --git a/doc/src/images/qpen-square.png b/src/corelib/doc/images/qpen-square.png similarity index 100% rename from doc/src/images/qpen-square.png rename to src/corelib/doc/images/qpen-square.png diff --git a/doc/src/images/qrect-coordinates.png b/src/corelib/doc/images/qrect-coordinates.png similarity index 100% rename from doc/src/images/qrect-coordinates.png rename to src/corelib/doc/images/qrect-coordinates.png diff --git a/doc/src/images/qrect-diagram-one.png b/src/corelib/doc/images/qrect-diagram-one.png similarity index 100% rename from doc/src/images/qrect-diagram-one.png rename to src/corelib/doc/images/qrect-diagram-one.png diff --git a/doc/src/images/qrect-diagram-three.png b/src/corelib/doc/images/qrect-diagram-three.png similarity index 100% rename from doc/src/images/qrect-diagram-three.png rename to src/corelib/doc/images/qrect-diagram-three.png diff --git a/doc/src/images/qrect-diagram-two.png b/src/corelib/doc/images/qrect-diagram-two.png similarity index 100% rename from doc/src/images/qrect-diagram-two.png rename to src/corelib/doc/images/qrect-diagram-two.png diff --git a/doc/src/images/qrect-diagram-zero.png b/src/corelib/doc/images/qrect-diagram-zero.png similarity index 100% rename from doc/src/images/qrect-diagram-zero.png rename to src/corelib/doc/images/qrect-diagram-zero.png diff --git a/doc/src/images/qrect-intersect.png b/src/corelib/doc/images/qrect-intersect.png similarity index 100% rename from doc/src/images/qrect-intersect.png rename to src/corelib/doc/images/qrect-intersect.png diff --git a/doc/src/images/qrect-unite.png b/src/corelib/doc/images/qrect-unite.png similarity index 100% rename from doc/src/images/qrect-unite.png rename to src/corelib/doc/images/qrect-unite.png diff --git a/doc/src/images/qrectf-coordinates.png b/src/corelib/doc/images/qrectf-coordinates.png similarity index 100% rename from doc/src/images/qrectf-coordinates.png rename to src/corelib/doc/images/qrectf-coordinates.png diff --git a/doc/src/images/qrectf-diagram-one.png b/src/corelib/doc/images/qrectf-diagram-one.png similarity index 100% rename from doc/src/images/qrectf-diagram-one.png rename to src/corelib/doc/images/qrectf-diagram-one.png diff --git a/doc/src/images/qrectf-diagram-three.png b/src/corelib/doc/images/qrectf-diagram-three.png similarity index 100% rename from doc/src/images/qrectf-diagram-three.png rename to src/corelib/doc/images/qrectf-diagram-three.png diff --git a/doc/src/images/qrectf-diagram-two.png b/src/corelib/doc/images/qrectf-diagram-two.png similarity index 100% rename from doc/src/images/qrectf-diagram-two.png rename to src/corelib/doc/images/qrectf-diagram-two.png diff --git a/doc/src/images/qsortfilterproxymodel-sorting.png b/src/corelib/doc/images/qsortfilterproxymodel-sorting.png similarity index 100% rename from doc/src/images/qsortfilterproxymodel-sorting.png rename to src/corelib/doc/images/qsortfilterproxymodel-sorting.png diff --git a/doc/src/images/qurl-authority.png b/src/corelib/doc/images/qurl-authority.png similarity index 100% rename from doc/src/images/qurl-authority.png rename to src/corelib/doc/images/qurl-authority.png diff --git a/doc/src/images/qurl-authority2.png b/src/corelib/doc/images/qurl-authority2.png similarity index 100% rename from doc/src/images/qurl-authority2.png rename to src/corelib/doc/images/qurl-authority2.png diff --git a/doc/src/images/qurl-authority3.png b/src/corelib/doc/images/qurl-authority3.png similarity index 100% rename from doc/src/images/qurl-authority3.png rename to src/corelib/doc/images/qurl-authority3.png diff --git a/doc/src/images/qurl-fragment.png b/src/corelib/doc/images/qurl-fragment.png similarity index 100% rename from doc/src/images/qurl-fragment.png rename to src/corelib/doc/images/qurl-fragment.png diff --git a/doc/src/images/qurl-ftppath.png b/src/corelib/doc/images/qurl-ftppath.png similarity index 100% rename from doc/src/images/qurl-ftppath.png rename to src/corelib/doc/images/qurl-ftppath.png diff --git a/doc/src/images/qurl-mailtopath.png b/src/corelib/doc/images/qurl-mailtopath.png similarity index 100% rename from doc/src/images/qurl-mailtopath.png rename to src/corelib/doc/images/qurl-mailtopath.png diff --git a/doc/src/images/qurl-querystring.png b/src/corelib/doc/images/qurl-querystring.png similarity index 100% rename from doc/src/images/qurl-querystring.png rename to src/corelib/doc/images/qurl-querystring.png diff --git a/doc/src/images/stliterators1.png b/src/corelib/doc/images/stliterators1.png similarity index 100% rename from doc/src/images/stliterators1.png rename to src/corelib/doc/images/stliterators1.png diff --git a/doc/src/images/thread_clock.png b/src/corelib/doc/images/thread_clock.png similarity index 100% rename from doc/src/images/thread_clock.png rename to src/corelib/doc/images/thread_clock.png diff --git a/doc/src/images/threadsandobjects.png b/src/corelib/doc/images/threadsandobjects.png similarity index 100% rename from doc/src/images/threadsandobjects.png rename to src/corelib/doc/images/threadsandobjects.png diff --git a/doc/src/images/threadvisual-example.png b/src/corelib/doc/images/threadvisual-example.png similarity index 100% rename from doc/src/images/threadvisual-example.png rename to src/corelib/doc/images/threadvisual-example.png diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf new file mode 100644 index 0000000..31b53c9 --- /dev/null +++ b/src/corelib/doc/qtcore.qdocconf @@ -0,0 +1,90 @@ +include(../../../doc/global/qt-cpp-ignore.qdocconf) + +project = QtCore +description = Qt Core Reference Documentation +url = http://qt-project.org/doc/qt-5.0/qtcore +version = 5.0.0 + +sourceencoding = UTF-8 +outputencoding = UTF-8 +naturallanguage = en_US +qhp.projects = QtCore + +qhp.QtCore.file = qtcore.qhp +qhp.Qt.namespace = org.qt-project.qtcore.500 +qhp.Qt.virtualFolder = qdoc +qhp.Qt.indexTitle = Qt Core Reference Documentation +qhp.Qt.indexRoot = + +qhp.Qt.filterAttributes = qtcore 5.0.0 qtrefdoc +qhp.Qt.customFilters.Qt.name = QtCore 5.0.0 +qhp.Qt.customFilters.Qt.filterAttributes = qtcore 5.0.0 +qhp.Qt.subprojects = classes overviews examples +qhp.Qt.subprojects.classes.title = Classes +qhp.Qt.subprojects.classes.indexTitle = Qt Core's Classes +qhp.Qt.subprojects.classes.selectors = class fake:headerfile +qhp.Qt.subprojects.classes.sortPages = true +qhp.Qt.subprojects.overviews.title = Overviews +qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs +qhp.Qt.subprojects.overviews.selectors = fake:page,group,module +qhp.Qt.subprojects.examples.title = Qt Core Tutorials and Examples +qhp.Qt.subprojects.examples.indexTitle = Qt Core Examples +qhp.Qt.subprojects.examples.selectors = fake:example + +dita.metadata.default.author = Qt Project +dita.metadata.default.permissions = all +dita.metadata.default.publisher = Qt Project +dita.metadata.default.copyryear = 2012 +dita.metadata.default.copyrholder = Nokia +dita.metadata.default.audience = programmer + +sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc" +headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx" + +examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css" +examples.imageextensions = "*.png" + +outputdir = ../../../doc/qtcore +tagfile = ../../../doc/qtcore/qtcore.tags + +HTML.generatemacrefs = "true" +HTML.nobreadcrumbs = "true" + +HTML.templatedir = . + +HTML.stylesheets = ../../../doc/global/style/offline.css + +HTML.headerstyles = \ + " \n" + +HTML.endheader = \ + "\n" \ + +defines = Q_QDOC \ + QT_.*_SUPPORT \ + QT_.*_LIB \ + QT_COMPAT \ + QT_KEYPAD_NAVIGATION \ + QT_NO_EGL \ + Q_WS_.* \ + Q_OS_.* \ + Q_BYTE_ORDER \ + QT_DEPRECATED \ + QT_DEPRECATED_* \ + Q_NO_USING_KEYWORD \ + __cplusplus \ + Q_COMPILER_INITIALIZER_LISTS + +versionsym = QT_VERSION_STR + +codeindent = 1 + +headerdirs += .. + +sourcedirs += .. + +exampledirs += ../../../examples \ + ../ \ + snippets + +imagedirs += images diff --git a/doc/src/snippets/buffer/buffer.cpp b/src/corelib/doc/snippets/buffer/buffer.cpp similarity index 100% rename from doc/src/snippets/buffer/buffer.cpp rename to src/corelib/doc/snippets/buffer/buffer.cpp diff --git a/doc/src/snippets/code/doc_src_containers.cpp b/src/corelib/doc/snippets/code/doc_src_containers.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_containers.cpp rename to src/corelib/doc/snippets/code/doc_src_containers.cpp diff --git a/doc/src/snippets/code/doc_src_groups.cpp b/src/corelib/doc/snippets/code/doc_src_groups.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_groups.cpp rename to src/corelib/doc/snippets/code/doc_src_groups.cpp diff --git a/doc/src/snippets/code/doc_src_objecttrees.cpp b/src/corelib/doc/snippets/code/doc_src_objecttrees.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_objecttrees.cpp rename to src/corelib/doc/snippets/code/doc_src_objecttrees.cpp diff --git a/doc/src/snippets/code/doc_src_properties.cpp b/src/corelib/doc/snippets/code/doc_src_properties.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_properties.cpp rename to src/corelib/doc/snippets/code/doc_src_properties.cpp diff --git a/doc/src/snippets/code/doc_src_qalgorithms.cpp b/src/corelib/doc/snippets/code/doc_src_qalgorithms.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qalgorithms.cpp rename to src/corelib/doc/snippets/code/doc_src_qalgorithms.cpp diff --git a/doc/src/snippets/code/doc_src_qcache.cpp b/src/corelib/doc/snippets/code/doc_src_qcache.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qcache.cpp rename to src/corelib/doc/snippets/code/doc_src_qcache.cpp diff --git a/doc/src/snippets/code/doc_src_qiterator.cpp b/src/corelib/doc/snippets/code/doc_src_qiterator.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qiterator.cpp rename to src/corelib/doc/snippets/code/doc_src_qiterator.cpp diff --git a/doc/src/snippets/code/doc_src_qnamespace.cpp b/src/corelib/doc/snippets/code/doc_src_qnamespace.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qnamespace.cpp rename to src/corelib/doc/snippets/code/doc_src_qnamespace.cpp diff --git a/doc/src/snippets/code/doc_src_qnamespace.qdoc b/src/corelib/doc/snippets/code/doc_src_qnamespace.qdoc similarity index 100% rename from doc/src/snippets/code/doc_src_qnamespace.qdoc rename to src/corelib/doc/snippets/code/doc_src_qnamespace.qdoc diff --git a/doc/src/snippets/code/doc_src_qpair.cpp b/src/corelib/doc/snippets/code/doc_src_qpair.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qpair.cpp rename to src/corelib/doc/snippets/code/doc_src_qpair.cpp diff --git a/doc/src/snippets/code/doc_src_qplugin.cpp b/src/corelib/doc/snippets/code/doc_src_qplugin.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qplugin.cpp rename to src/corelib/doc/snippets/code/doc_src_qplugin.cpp diff --git a/doc/src/snippets/code/doc_src_qplugin.pro b/src/corelib/doc/snippets/code/doc_src_qplugin.pro similarity index 100% rename from doc/src/snippets/code/doc_src_qplugin.pro rename to src/corelib/doc/snippets/code/doc_src_qplugin.pro diff --git a/doc/src/snippets/code/doc_src_qset.cpp b/src/corelib/doc/snippets/code/doc_src_qset.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qset.cpp rename to src/corelib/doc/snippets/code/doc_src_qset.cpp diff --git a/doc/src/snippets/code/doc_src_qtcore.cpp b/src/corelib/doc/snippets/code/doc_src_qtcore.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qtcore.cpp rename to src/corelib/doc/snippets/code/doc_src_qtcore.cpp diff --git a/doc/src/snippets/code/doc_src_qvarlengtharray.cpp b/src/corelib/doc/snippets/code/doc_src_qvarlengtharray.cpp similarity index 100% rename from doc/src/snippets/code/doc_src_qvarlengtharray.cpp rename to src/corelib/doc/snippets/code/doc_src_qvarlengtharray.cpp diff --git a/doc/src/snippets/qlogging/qloggingsnippet.cpp b/src/corelib/doc/snippets/code/qlogging/qlogging.cpp similarity index 100% rename from doc/src/snippets/qlogging/qloggingsnippet.cpp rename to src/corelib/doc/snippets/code/qlogging/qlogging.cpp diff --git a/doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp b/src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_codecs_qtextcodec.cpp rename to src/corelib/doc/snippets/code/src_corelib_codecs_qtextcodec.cpp diff --git a/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp b/src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp rename to src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp diff --git a/doc/src/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_global_qglobal.cpp rename to src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qabstractfileengine.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qabstractfileengine.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qdatastream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdatastream.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qdatastream.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qdatastream.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qdir.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qdir.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qdir.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qdiriterator.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qdiriterator.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qdiriterator.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qfile.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qfile.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qfile.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qfile.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qfileinfo.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qfileinfo.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qfileinfo.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qiodevice.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qiodevice.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qiodevice.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qiodevice.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qprocess.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qprocess.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qsettings.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qsettings.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qtemporarydir.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtemporarydir.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qtemporarydir.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qtemporarydir.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtemporaryfile.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qtemporaryfile.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qtextstream.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qtextstream.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qtextstream.cpp diff --git a/doc/src/snippets/code/src_corelib_io_qurl.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_io_qurl.cpp rename to src/corelib/doc/snippets/code/src_corelib_io_qurl.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qcoreapplication.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qmetatype.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qmetatype.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qmimedata.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qobject.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qtimer.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qtimer.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qtimer.cpp diff --git a/doc/src/snippets/code/src_corelib_kernel_qvariant.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_kernel_qvariant.cpp rename to src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp diff --git a/doc/src/snippets/code/src_corelib_mimetype_qmimedatabase.cpp b/src/corelib/doc/snippets/code/src_corelib_mimetype_qmimedatabase.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_mimetype_qmimedatabase.cpp rename to src/corelib/doc/snippets/code/src_corelib_mimetype_qmimedatabase.cpp diff --git a/doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp b/src/corelib/doc/snippets/code/src_corelib_plugin_qlibrary.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp rename to src/corelib/doc/snippets/code/src_corelib_plugin_qlibrary.cpp diff --git a/doc/src/snippets/code/src_corelib_plugin_quuid.cpp b/src/corelib/doc/snippets/code/src_corelib_plugin_quuid.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_plugin_quuid.cpp rename to src/corelib/doc/snippets/code/src_corelib_plugin_quuid.cpp diff --git a/doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp b/src/corelib/doc/snippets/code/src_corelib_statemachine_qstatemachine.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp rename to src/corelib/doc/snippets/code/src_corelib_statemachine_qstatemachine.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qatomic.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qatomic.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qatomic.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qatomic.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qmutex.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qmutex.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qmutex.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qmutexpool.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qmutexpool.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qreadwritelock.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qreadwritelock.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qsemaphore.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qsemaphore.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qthread.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qthread.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qthread.cpp diff --git a/doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp b/src/corelib/doc/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp rename to src/corelib/doc/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qbitarray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qbitarray.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qbitarray.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qbytearray.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qdatetime.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qdatetime.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qdatetime.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qeasingcurve.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qhash.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qhash.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qhash.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qlinkedlist.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qlistdata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qlistdata.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qlistdata.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qlocale.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qlocale.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qlocale.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qmap.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qmap.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qmap.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qpoint.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qpoint.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qpoint.cpp diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp new file mode 100644 index 0000000..3a1cf7c --- /dev/null +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qqueue.cpp @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +QQueue queue; +queue.enqueue(1); +queue.enqueue(2); +queue.enqueue(3); +while (!queue.isEmpty()) + cout << queue.dequeue() << endl; +//! [0] diff --git a/doc/src/snippets/code/src_corelib_tools_qrect.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qrect.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qrect.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qrect.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qregexp.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qregexp.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qregexp.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qregexp.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qregularexpression.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qscopedpointer.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qsize.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qsize.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qsize.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qsize.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qstring.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qstring.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qstring.cpp diff --git a/doc/src/snippets/code/src_corelib_tools_qtimeline.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qtimeline.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_tools_qtimeline.cpp rename to src/corelib/doc/snippets/code/src_corelib_tools_qtimeline.cpp diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp new file mode 100644 index 0000000..b3f9a7e --- /dev/null +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qvector.cpp @@ -0,0 +1,183 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +QVector integerVector; +QVector stringVector; +//! [0] + + +//! [1] +QVector vector(200); +//! [1] + + +//! [2] +QVector vector(200, "Pass"); +//! [2] + + +//! [3] +if (vector[0] == "Liz") + vector[0] = "Elizabeth"; +//! [3] + + +//! [4] +for (int i = 0; i < vector.size(); ++i) { + if (vector.at(i) == "Alfonso") + cout << "Found Alfonso at position " << i << endl; +} +//! [4] + + +//! [5] +int i = vector.indexOf("Harumi"); +if (i != -1) + cout << "First occurrence of Harumi is at position " << i << endl; +//! [5] + + +//! [6] +QVector vector(10); +int *data = vector.data(); +for (int i = 0; i < 10; ++i) + data[i] = 2 * i; +//! [6] + + +//! [7] +QVector vector(0); +vector.append("one"); +vector.append("two"); +vector.append("three"); +// vector: ["one", "two", "three"] +//! [7] + + +//! [8] +QVector vector; +vector.prepend("one"); +vector.prepend("two"); +vector.prepend("three"); +// vector: ["three", "two", "one"] +//! [8] + + +//! [9] +QVector vector; +vector << "alpha" << "beta" << "delta"; +vector.insert(2, "gamma"); +// vector: ["alpha", "beta", "gamma", "delta"] +//! [9] + + +//! [10] +QVector vector; +vector << 2.718 << 1.442 << 0.4342; +vector.insert(1, 3, 9.9); +// vector: [2.718, 9.9, 9.9, 9.9, 1.442, 0.4342] +//! [10] + + +//! [11] +QVector vector(3); +vector.fill("Yes"); +// vector: ["Yes", "Yes", "Yes"] + +vector.fill("oh", 5); +// vector: ["oh", "oh", "oh", "oh", "oh"] +//! [11] + + +//! [12] +QVector vector; +vector << "A" << "B" << "C" << "B" << "A"; +vector.indexOf("B"); // returns 1 +vector.indexOf("B", 1); // returns 1 +vector.indexOf("B", 2); // returns 3 +vector.indexOf("X"); // returns -1 +//! [12] + + +//! [13] +QList vector; +vector << "A" << "B" << "C" << "B" << "A"; +vector.lastIndexOf("B"); // returns 3 +vector.lastIndexOf("B", 3); // returns 3 +vector.lastIndexOf("B", 2); // returns 1 +vector.lastIndexOf("X"); // returns -1 +//! [13] + + +//! [14] +QVector vect; +vect << "red" << "green" << "blue" << "black"; + +QList list = vect.toList(); +// list: ["red", "green", "blue", "black"] +//! [14] + + +//! [15] +QStringList list; +list << "Sven" << "Kim" << "Ola"; + +QVector vect = QVector::fromList(list); +// vect: ["Sven", "Kim", "Ola"] +//! [15] + + +//! [16] +std::vector stdvector; +vector.push_back(1.2); +vector.push_back(0.5); +vector.push_back(3.14); + +QVector vector = QVector::fromStdVector(stdvector); +//! [16] + + +//! [17] +QVector vector; +vector << 1.2 << 0.5 << 3.14; + +std::vector stdvector = vector.toStdVector(); +//! [17] diff --git a/doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp b/src/corelib/doc/snippets/code/src_corelib_xml_qxmlstream.cpp similarity index 100% rename from doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp rename to src/corelib/doc/snippets/code/src_corelib_xml_qxmlstream.cpp diff --git a/doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp b/src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp similarity index 100% rename from doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp rename to src/corelib/doc/snippets/code/src_gui_dialogs_qmessagebox.cpp diff --git a/doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp b/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp similarity index 100% rename from doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp rename to src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp diff --git a/doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp b/src/corelib/doc/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp similarity index 100% rename from doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp rename to src/corelib/doc/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp diff --git a/doc/src/snippets/file/file.cpp b/src/corelib/doc/snippets/file/file.cpp similarity index 100% rename from doc/src/snippets/file/file.cpp rename to src/corelib/doc/snippets/file/file.cpp diff --git a/doc/src/snippets/fileinfo/main.cpp b/src/corelib/doc/snippets/fileinfo/main.cpp similarity index 100% rename from doc/src/snippets/fileinfo/main.cpp rename to src/corelib/doc/snippets/fileinfo/main.cpp diff --git a/doc/src/snippets/ntfsp.cpp b/src/corelib/doc/snippets/ntfsp.cpp similarity index 100% rename from doc/src/snippets/ntfsp.cpp rename to src/corelib/doc/snippets/ntfsp.cpp diff --git a/src/corelib/doc/snippets/pointer/pointer.cpp b/src/corelib/doc/snippets/pointer/pointer.cpp new file mode 100644 index 0000000..dd2bc82 --- /dev/null +++ b/src/corelib/doc/snippets/pointer/pointer.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + +//! [0] + QPointer label = new QLabel; + label->setText("&Status:"); +//! [0] + +//! [1] + if (label) +//! [1] //! [2] + label->show(); +//! [2] + return 0; +} diff --git a/doc/src/snippets/process/process.cpp b/src/corelib/doc/snippets/process/process.cpp similarity index 100% rename from doc/src/snippets/process/process.cpp rename to src/corelib/doc/snippets/process/process.cpp diff --git a/doc/src/snippets/qdebug/qdebugsnippet.cpp b/src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp similarity index 100% rename from doc/src/snippets/qdebug/qdebugsnippet.cpp rename to src/corelib/doc/snippets/qdebug/qdebugsnippet.cpp diff --git a/doc/src/snippets/qdir-listfiles/main.cpp b/src/corelib/doc/snippets/qdir-listfiles/main.cpp similarity index 100% rename from doc/src/snippets/qdir-listfiles/main.cpp rename to src/corelib/doc/snippets/qdir-listfiles/main.cpp diff --git a/doc/src/snippets/qdir-namefilters/main.cpp b/src/corelib/doc/snippets/qdir-namefilters/main.cpp similarity index 100% rename from doc/src/snippets/qdir-namefilters/main.cpp rename to src/corelib/doc/snippets/qdir-namefilters/main.cpp diff --git a/doc/src/snippets/qelapsedtimer/main.cpp b/src/corelib/doc/snippets/qelapsedtimer/main.cpp similarity index 100% rename from doc/src/snippets/qelapsedtimer/main.cpp rename to src/corelib/doc/snippets/qelapsedtimer/main.cpp diff --git a/doc/src/snippets/qmetaobject-invokable/main.cpp b/src/corelib/doc/snippets/qmetaobject-invokable/main.cpp similarity index 100% rename from doc/src/snippets/qmetaobject-invokable/main.cpp rename to src/corelib/doc/snippets/qmetaobject-invokable/main.cpp diff --git a/doc/src/snippets/qmetaobject-invokable/qmetaobject-invokable.pro b/src/corelib/doc/snippets/qmetaobject-invokable/qmetaobject-invokable.pro similarity index 100% rename from doc/src/snippets/qmetaobject-invokable/qmetaobject-invokable.pro rename to src/corelib/doc/snippets/qmetaobject-invokable/qmetaobject-invokable.pro diff --git a/doc/src/snippets/qmetaobject-invokable/window.cpp b/src/corelib/doc/snippets/qmetaobject-invokable/window.cpp similarity index 100% rename from doc/src/snippets/qmetaobject-invokable/window.cpp rename to src/corelib/doc/snippets/qmetaobject-invokable/window.cpp diff --git a/doc/src/snippets/qmetaobject-invokable/window.h b/src/corelib/doc/snippets/qmetaobject-invokable/window.h similarity index 100% rename from doc/src/snippets/qmetaobject-invokable/window.h rename to src/corelib/doc/snippets/qmetaobject-invokable/window.h diff --git a/doc/src/snippets/qprocess-environment/main.cpp b/src/corelib/doc/snippets/qprocess-environment/main.cpp similarity index 100% rename from doc/src/snippets/qprocess-environment/main.cpp rename to src/corelib/doc/snippets/qprocess-environment/main.cpp diff --git a/doc/src/snippets/qprocess/qprocess-simpleexecution.cpp b/src/corelib/doc/snippets/qprocess/qprocess-simpleexecution.cpp similarity index 100% rename from doc/src/snippets/qprocess/qprocess-simpleexecution.cpp rename to src/corelib/doc/snippets/qprocess/qprocess-simpleexecution.cpp diff --git a/doc/src/snippets/qsignalmapper/buttonwidget.cpp b/src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp similarity index 100% rename from doc/src/snippets/qsignalmapper/buttonwidget.cpp rename to src/corelib/doc/snippets/qsignalmapper/buttonwidget.cpp diff --git a/doc/src/snippets/qsignalmapper/buttonwidget.h b/src/corelib/doc/snippets/qsignalmapper/buttonwidget.h similarity index 100% rename from doc/src/snippets/qsignalmapper/buttonwidget.h rename to src/corelib/doc/snippets/qsignalmapper/buttonwidget.h diff --git a/doc/src/snippets/qsortfilterproxymodel-details/main.cpp b/src/corelib/doc/snippets/qsortfilterproxymodel-details/main.cpp similarity index 100% rename from doc/src/snippets/qsortfilterproxymodel-details/main.cpp rename to src/corelib/doc/snippets/qsortfilterproxymodel-details/main.cpp diff --git a/doc/src/snippets/qstack/main.cpp b/src/corelib/doc/snippets/qstack/main.cpp similarity index 100% rename from doc/src/snippets/qstack/main.cpp rename to src/corelib/doc/snippets/qstack/main.cpp diff --git a/doc/src/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp similarity index 100% rename from doc/src/snippets/qstring/main.cpp rename to src/corelib/doc/snippets/qstring/main.cpp diff --git a/doc/src/snippets/qstring/stringbuilder.cpp b/src/corelib/doc/snippets/qstring/stringbuilder.cpp similarity index 100% rename from doc/src/snippets/qstring/stringbuilder.cpp rename to src/corelib/doc/snippets/qstring/stringbuilder.cpp diff --git a/doc/src/snippets/qstringlist/main.cpp b/src/corelib/doc/snippets/qstringlist/main.cpp similarity index 100% rename from doc/src/snippets/qstringlist/main.cpp rename to src/corelib/doc/snippets/qstringlist/main.cpp diff --git a/doc/src/snippets/qstringlistmodel/main.cpp b/src/corelib/doc/snippets/qstringlistmodel/main.cpp similarity index 100% rename from doc/src/snippets/qstringlistmodel/main.cpp rename to src/corelib/doc/snippets/qstringlistmodel/main.cpp diff --git a/doc/src/snippets/qtcast/qtcast.cpp b/src/corelib/doc/snippets/qtcast/qtcast.cpp similarity index 100% rename from doc/src/snippets/qtcast/qtcast.cpp rename to src/corelib/doc/snippets/qtcast/qtcast.cpp diff --git a/doc/src/snippets/qxmlstreamwriter/main.cpp b/src/corelib/doc/snippets/qxmlstreamwriter/main.cpp similarity index 100% rename from doc/src/snippets/qxmlstreamwriter/main.cpp rename to src/corelib/doc/snippets/qxmlstreamwriter/main.cpp diff --git a/doc/src/snippets/settings/settings.cpp b/src/corelib/doc/snippets/settings/settings.cpp similarity index 100% rename from doc/src/snippets/settings/settings.cpp rename to src/corelib/doc/snippets/settings/settings.cpp diff --git a/doc/src/snippets/sharedemployee/employee.h b/src/corelib/doc/snippets/sharedemployee/employee.h similarity index 100% rename from doc/src/snippets/sharedemployee/employee.h rename to src/corelib/doc/snippets/sharedemployee/employee.h diff --git a/doc/src/snippets/sharedemployee/main.cpp b/src/corelib/doc/snippets/sharedemployee/main.cpp similarity index 100% rename from doc/src/snippets/sharedemployee/main.cpp rename to src/corelib/doc/snippets/sharedemployee/main.cpp diff --git a/doc/src/snippets/signalmapper/filereader.cpp b/src/corelib/doc/snippets/signalmapper/filereader.cpp similarity index 100% rename from doc/src/snippets/signalmapper/filereader.cpp rename to src/corelib/doc/snippets/signalmapper/filereader.cpp diff --git a/doc/src/snippets/signalsandslots/lcdnumber.h b/src/corelib/doc/snippets/signalsandslots/lcdnumber.h similarity index 100% rename from doc/src/snippets/signalsandslots/lcdnumber.h rename to src/corelib/doc/snippets/signalsandslots/lcdnumber.h diff --git a/doc/src/snippets/signalsandslots/signalsandslots.cpp b/src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp similarity index 100% rename from doc/src/snippets/signalsandslots/signalsandslots.cpp rename to src/corelib/doc/snippets/signalsandslots/signalsandslots.cpp diff --git a/doc/src/snippets/signalsandslots/signalsandslots.h b/src/corelib/doc/snippets/signalsandslots/signalsandslots.h similarity index 100% rename from doc/src/snippets/signalsandslots/signalsandslots.h rename to src/corelib/doc/snippets/signalsandslots/signalsandslots.h diff --git a/doc/src/snippets/streaming/main.cpp b/src/corelib/doc/snippets/streaming/main.cpp similarity index 100% rename from doc/src/snippets/streaming/main.cpp rename to src/corelib/doc/snippets/streaming/main.cpp diff --git a/doc/src/snippets/streaming/streaming.pro b/src/corelib/doc/snippets/streaming/streaming.pro similarity index 100% rename from doc/src/snippets/streaming/streaming.pro rename to src/corelib/doc/snippets/streaming/streaming.pro diff --git a/doc/src/snippets/threads/threads.cpp b/src/corelib/doc/snippets/threads/threads.cpp similarity index 100% rename from doc/src/snippets/threads/threads.cpp rename to src/corelib/doc/snippets/threads/threads.cpp diff --git a/doc/src/snippets/threads/threads.h b/src/corelib/doc/snippets/threads/threads.h similarity index 100% rename from doc/src/snippets/threads/threads.h rename to src/corelib/doc/snippets/threads/threads.h diff --git a/doc/src/snippets/timers/timers.cpp b/src/corelib/doc/snippets/timers/timers.cpp similarity index 100% rename from doc/src/snippets/timers/timers.cpp rename to src/corelib/doc/snippets/timers/timers.cpp diff --git a/doc/src/corelib/containers.qdoc b/src/corelib/doc/src/containers.qdoc similarity index 95% rename from doc/src/corelib/containers.qdoc rename to src/corelib/doc/src/containers.qdoc index b63cc9d..8419a92 100644 --- a/doc/src/corelib/containers.qdoc +++ b/src/corelib/doc/src/containers.qdoc @@ -205,7 +205,7 @@ Here's an example custom data type that meets the requirement of an assignable data type: - \snippet doc/src/snippets/code/doc_src_containers.cpp 0 + \snippet code/doc_src_containers.cpp 0 If we don't provide a copy constructor or an assignment operator, C++ provides a default implementation that performs a @@ -216,7 +216,7 @@ explicit constructors or assignment operator, the following data type can be stored in a container: - \snippet doc/src/snippets/streaming/main.cpp 0 + \snippet streaming/main.cpp 0 Some containers have additional requirements for the data types they can store. For example, the Key type of a QMap must @@ -233,9 +233,9 @@ straightforward; here's how we could do it for the Movie struct above: - \snippet doc/src/snippets/streaming/main.cpp 1 + \snippet streaming/main.cpp 1 \codeline - \snippet doc/src/snippets/streaming/main.cpp 2 + \snippet streaming/main.cpp 2 \keyword default-constructed values @@ -301,12 +301,12 @@ iterator positions as red arrows for a list containing four items: - \img javaiterators1.png + \image javaiterators1.png Here's a typical loop for iterating through all the elements of a QList in order and printing them to the console: - \snippet doc/src/snippets/code/doc_src_containers.cpp 1 + \snippet code/doc_src_containers.cpp 1 It works as follows: The QList to iterate over is passed to the QListIterator constructor. At that point, the iterator is located @@ -319,7 +319,7 @@ Here's how to iterate backward in a QList: - \snippet doc/src/snippets/code/doc_src_containers.cpp 2 + \snippet code/doc_src_containers.cpp 2 The code is symmetric with iterating forward, except that we start by calling \l{QListIterator::toBack()}{toBack()} @@ -329,7 +329,7 @@ \l{QListIterator::next()}{next()} and \l{QListIterator::previous()}{previous()} on an iterator: - \img javaiterators2.png + \image javaiterators2.png The following table summarizes the QListIterator API: @@ -358,7 +358,7 @@ QMutableListIterator. Here's an example where we remove all odd numbers from a QList using QMutableListIterator: - \snippet doc/src/snippets/code/doc_src_containers.cpp 3 + \snippet code/doc_src_containers.cpp 3 The next() call in the loop is made every time. It jumps over the next item in the list. The @@ -368,13 +368,13 @@ the iterator, so it is safe to continue using it. This works just as well when iterating backward: - \snippet doc/src/snippets/code/doc_src_containers.cpp 4 + \snippet code/doc_src_containers.cpp 4 If we just want to modify the value of an existing item, we can use \l{QMutableListIterator::setValue()}{setValue()}. In the code below, we replace any value larger than 128 with 128: - \snippet doc/src/snippets/code/doc_src_containers.cpp 5 + \snippet code/doc_src_containers.cpp 5 Just like \l{QMutableListIterator::remove()}{remove()}, \l{QMutableListIterator::setValue()}{setValue()} operates on the @@ -387,7 +387,7 @@ operations, we don't even need \l{QMutableListIterator::setValue()}{setValue()}: - \snippet doc/src/snippets/code/doc_src_containers.cpp 6 + \snippet code/doc_src_containers.cpp 6 As mentioned above, QLinkedList's, QVector's, and QSet's iterator classes have exactly the same API as QList's. We will now turn to @@ -410,7 +410,7 @@ The following example removes all (capital, country) pairs where the capital's name ends with "City": - \snippet doc/src/snippets/code/doc_src_containers.cpp 7 + \snippet code/doc_src_containers.cpp 7 QMapIterator also provides a key() and a value() function that operate directly on the iterator and that return the key and @@ -418,7 +418,7 @@ example, the following code copies the contents of a QMap into a QHash: - \snippet doc/src/snippets/code/doc_src_containers.cpp 8 + \snippet code/doc_src_containers.cpp 8 If we want to iterate through all the items with the same value, we can use \l{QMapIterator::findNext()}{findNext()} @@ -426,7 +426,7 @@ Here's an example where we remove all the items with a particular value: - \snippet doc/src/snippets/code/doc_src_containers.cpp 9 + \snippet code/doc_src_containers.cpp 9 \section2 STL-Style Iterators @@ -473,7 +473,7 @@ Here's a typical loop for iterating through all the elements of a QList in order and converting them to lowercase: - \snippet doc/src/snippets/code/doc_src_containers.cpp 10 + \snippet code/doc_src_containers.cpp 10 Unlike \l{Java-style iterators}, STL-style iterators point directly at items. The begin() function of a container returns an @@ -487,13 +487,13 @@ The diagram below shows the valid iterator positions as red arrows for a vector containing four items: - \img stliterators1.png + \image stliterators1.png Iterating backward with an STL-style iterator requires us to decrement the iterator \e before we access the item. This requires a \c while loop: - \snippet doc/src/snippets/code/doc_src_containers.cpp 11 + \snippet code/doc_src_containers.cpp 11 In the code snippets so far, we used the unary \c * operator to retrieve the item (of type QString) stored at a certain iterator @@ -504,7 +504,7 @@ For read-only access, you can use const_iterator, constBegin(), and constEnd(). For example: - \snippet doc/src/snippets/code/doc_src_containers.cpp 12 + \snippet code/doc_src_containers.cpp 12 The following table summarizes the STL-style iterators' API: @@ -536,7 +536,7 @@ value() function to retrieve the value. For example, here's how we would print all items in a QMap to the console: - \snippet doc/src/snippets/code/doc_src_containers.cpp 13 + \snippet code/doc_src_containers.cpp 13 Thanks to \l{implicit sharing}, it is very inexpensive for a function to return a container per value. The Qt API contains @@ -545,7 +545,7 @@ using an STL iterator, you should always take a copy of the container and iterate over the copy. For example: - \snippet doc/src/snippets/code/doc_src_containers.cpp 14 + \snippet code/doc_src_containers.cpp 14 This problem doesn't occur with functions that return a const or non-const reference to a container. @@ -567,35 +567,35 @@ statement. For example, here's how to use \c foreach to iterate over a QLinkedList: - \snippet doc/src/snippets/code/doc_src_containers.cpp 15 + \snippet code/doc_src_containers.cpp 15 The \c foreach code is significantly shorter than the equivalent code that uses iterators: - \snippet doc/src/snippets/code/doc_src_containers.cpp 16 + \snippet code/doc_src_containers.cpp 16 Unless the data type contains a comma (e.g., \c{QPair}), the variable used for iteration can be defined within the \c foreach statement: - \snippet doc/src/snippets/code/doc_src_containers.cpp 17 + \snippet code/doc_src_containers.cpp 17 And like any other C++ loop construct, you can use braces around the body of a \c foreach loop, and you can use \c break to leave the loop: - \snippet doc/src/snippets/code/doc_src_containers.cpp 18 + \snippet code/doc_src_containers.cpp 18 With QMap and QHash, \c foreach accesses the value component of the (key, value) pairs. If you want to iterate over both the keys and the values, you can use iterators (which are fastest), or you can write code like this: - \snippet doc/src/snippets/code/doc_src_containers.cpp 19 + \snippet code/doc_src_containers.cpp 19 For a multi-valued map: - \snippet doc/src/snippets/code/doc_src_containers.cpp 20 + \snippet code/doc_src_containers.cpp 20 Qt automatically takes a copy of the container when it enters a \c foreach loop. If you modify the container as you are @@ -611,12 +611,12 @@ In addition to \c foreach, Qt also provides a \c forever pseudo-keyword for infinite loops: - \snippet doc/src/snippets/code/doc_src_containers.cpp 21 + \snippet code/doc_src_containers.cpp 21 If you're worried about namespace pollution, you can disable these macros by adding the following line to your \c .pro file: - \snippet doc/src/snippets/code/doc_src_containers.cpp 22 + \snippet code/doc_src_containers.cpp 22 \section1 Other Container-Like Classes @@ -736,7 +736,7 @@ Consider the following code, which builds a QString from another QString: - \snippet doc/src/snippets/code/doc_src_containers.cpp 23 + \snippet code/doc_src_containers.cpp 23 We build the string \c out dynamically by appending one character to it at a time. Let's assume that we append 15000 characters to diff --git a/doc/src/network/files-and-resources/datastreamformat.qdoc b/src/corelib/doc/src/datastreamformat.qdoc similarity index 100% rename from doc/src/network/files-and-resources/datastreamformat.qdoc rename to src/corelib/doc/src/datastreamformat.qdoc diff --git a/doc/src/corelib/implicit-sharing.qdoc b/src/corelib/doc/src/implicit-sharing.qdoc similarity index 97% rename from doc/src/corelib/implicit-sharing.qdoc rename to src/corelib/doc/src/implicit-sharing.qdoc index e652e21..6fc60de 100644 --- a/doc/src/corelib/implicit-sharing.qdoc +++ b/src/corelib/doc/src/implicit-sharing.qdoc @@ -109,7 +109,7 @@ data in all member functions that change the internal data. Code fragment: - \snippet doc/src/snippets/code/doc_src_groups.cpp 0 + \snippet code/doc_src_groups.cpp 0 \section1 List of Classes @@ -124,7 +124,7 @@ concern for the copying overhead. Example: - \snippet doc/src/snippets/code/doc_src_groups.cpp 1 + \snippet code/doc_src_groups.cpp 1 In this example, \c p1 and \c p2 share data until QPainter::begin() is called for \c p2, because painting a pixmap will modify it. diff --git a/doc/src/corelib/json.qdoc b/src/corelib/doc/src/json.qdoc similarity index 97% rename from doc/src/corelib/json.qdoc rename to src/corelib/doc/src/json.qdoc index 88b5377..406135c 100644 --- a/doc/src/corelib/json.qdoc +++ b/src/corelib/doc/src/json.qdoc @@ -49,7 +49,7 @@ data in a binary format that is directly mmap'able and very fast to access. - More details about the JSON data format can be found at \link json.org + More details about the JSON data format can be found at \l{http://json.org}{json.org} and in \l{http://tools.ietf.org/html/rfc4627}{RFC-4627}. \tableofcontents diff --git a/doc/src/corelib/objectmodel/metaobjects.qdoc b/src/corelib/doc/src/objectmodel/metaobjects.qdoc similarity index 93% rename from doc/src/corelib/objectmodel/metaobjects.qdoc rename to src/corelib/doc/src/objectmodel/metaobjects.qdoc index c92f6f2..8e071be 100644 --- a/doc/src/corelib/objectmodel/metaobjects.qdoc +++ b/src/corelib/doc/src/objectmodel/metaobjects.qdoc @@ -92,32 +92,32 @@ For example, let's assume \c MyWidget inherits from QWidget and is declared with the Q_OBJECT macro: - \snippet doc/src/snippets/qtcast/qtcast.cpp 0 + \snippet qtcast/qtcast.cpp 0 The \c obj variable, of type \c{QObject *}, actually refers to a \c MyWidget object, so we can cast it appropriately: - \snippet doc/src/snippets/qtcast/qtcast.cpp 1 + \snippet qtcast/qtcast.cpp 1 The cast from QObject to QWidget is successful, because the object is actually a \c MyWidget, which is a subclass of QWidget. Since we know that \c obj is a \c MyWidget, we can also cast it to \c{MyWidget *}: - \snippet doc/src/snippets/qtcast/qtcast.cpp 2 + \snippet qtcast/qtcast.cpp 2 The cast to \c MyWidget is successful because qobject_cast() makes no distinction between built-in Qt types and custom types. - \snippet doc/src/snippets/qtcast/qtcast.cpp 3 - \snippet doc/src/snippets/qtcast/qtcast.cpp 4 + \snippet qtcast/qtcast.cpp 3 + \snippet qtcast/qtcast.cpp 4 The cast to QLabel, on the other hand, fails. The pointer is then set to 0. This makes it possible to handle objects of different types differently at run-time, based on the type: - \snippet doc/src/snippets/qtcast/qtcast.cpp 5 - \snippet doc/src/snippets/qtcast/qtcast.cpp 6 + \snippet qtcast/qtcast.cpp 5 + \snippet qtcast/qtcast.cpp 6 While it is possible to use QObject as a base class without the Q_OBJECT macro and without meta-object code, neither signals diff --git a/doc/src/corelib/objectmodel/object.qdoc b/src/corelib/doc/src/objectmodel/object.qdoc similarity index 100% rename from doc/src/corelib/objectmodel/object.qdoc rename to src/corelib/doc/src/objectmodel/object.qdoc diff --git a/doc/src/corelib/objectmodel/objecttrees.qdoc b/src/corelib/doc/src/objectmodel/objecttrees.qdoc similarity index 97% rename from doc/src/corelib/objectmodel/objecttrees.qdoc rename to src/corelib/doc/src/objectmodel/objecttrees.qdoc index 3e51eeb..e03a93a 100644 --- a/doc/src/corelib/objectmodel/objecttrees.qdoc +++ b/src/corelib/doc/src/objectmodel/objecttrees.qdoc @@ -77,7 +77,7 @@ behavior applies. Normally, the order of destruction still doesn't present a problem. Consider the following snippet: - \snippet doc/src/snippets/code/doc_src_objecttrees.cpp 0 + \snippet code/doc_src_objecttrees.cpp 0 The parent, \c window, and the child, \c quit, are both \l {QObject} {QObjects} because QPushButton inherits QWidget, and QWidget inherits @@ -91,7 +91,7 @@ But now consider what happens if we swap the order of construction, as shown in this second snippet: - \snippet doc/src/snippets/code/doc_src_objecttrees.cpp 1 + \snippet code/doc_src_objecttrees.cpp 1 In this case, the order of destruction causes a problem. The parent's destructor is called first because it was created last. It then calls diff --git a/doc/src/corelib/objectmodel/properties.qdoc b/src/corelib/doc/src/objectmodel/properties.qdoc similarity index 96% rename from doc/src/corelib/objectmodel/properties.qdoc rename to src/corelib/doc/src/objectmodel/properties.qdoc index 4d090af..9d248f0 100644 --- a/doc/src/corelib/objectmodel/properties.qdoc +++ b/src/corelib/doc/src/objectmodel/properties.qdoc @@ -46,12 +46,12 @@ To declare a property, use the \l {Q_PROPERTY()} {Q_PROPERTY()} macro in a class that inherits QObject. - \snippet doc/src/snippets/code/doc_src_properties.cpp 0 + \snippet code/doc_src_properties.cpp 0 Here are some typical examples of property declarations taken from class QWidget. - \snippet doc/src/snippets/code/doc_src_properties.cpp 1 + \snippet code/doc_src_properties.cpp 1 A property behaves like a class data member, but it has additional features accessible through the \l {Meta-Object System}. @@ -135,7 +135,7 @@ be a user-defined type. In this example, class QDate is considered to be a user-defined type. - \snippet doc/src/snippets/code/doc_src_properties.cpp 2 + \snippet code/doc_src_properties.cpp 2 Because QDate is user-defined, you must include the \c{} header file with the property declaration. @@ -156,7 +156,7 @@ the code snippet below, the call to QAbstractButton::setDown() and the call to QObject::setProperty() both set property "down". - \snippet doc/src/snippets/code/doc_src_properties.cpp 3 + \snippet code/doc_src_properties.cpp 3 Accessing a property through its \c WRITE accessor is the better of the two, because it is faster and gives better diagnostics at @@ -166,7 +166,7 @@ can \e discover a class's properties at run time by querying its QObject, QMetaObject, and \l {QMetaProperty} {QMetaProperties}. - \snippet doc/src/snippets/code/doc_src_properties.cpp 4 + \snippet code/doc_src_properties.cpp 4 In the above snippet, QMetaObject::property() is used to get \l {QMetaProperty} {metadata} about each property defined in some @@ -193,7 +193,7 @@ for the \c READ and \c WRITE functions. The declaration of MyClass then might look like this: - \snippet doc/src/snippets/code/doc_src_properties.cpp 5 + \snippet code/doc_src_properties.cpp 5 The \c READ function is const and returns the property type. The \c WRITE function returns void and has exactly one parameter of @@ -204,7 +204,7 @@ QObject that is an instance of MyClass, we have two ways to set its priority property: - \snippet doc/src/snippets/code/doc_src_properties.cpp 6 + \snippet code/doc_src_properties.cpp 6 In the example, the enumeration type that is the property type is declared in MyClass and registered with the \l{Meta-Object System} @@ -266,7 +266,7 @@ Q_CLASSINFO(), that can be used to attach additional \e{name}--\e{value} pairs to a class's meta-object, for example: - \snippet doc/src/snippets/code/doc_src_properties.cpp 7 + \snippet code/doc_src_properties.cpp 7 Like other meta-data, class information is accessible at run-time through the meta-object; see QMetaObject::classInfo() for details. diff --git a/doc/src/corelib/objectmodel/signalsandslots.qdoc b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc similarity index 90% rename from doc/src/corelib/objectmodel/signalsandslots.qdoc rename to src/corelib/doc/src/objectmodel/signalsandslots.qdoc index 9100980..0f12c9c 100644 --- a/doc/src/corelib/objectmodel/signalsandslots.qdoc +++ b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc @@ -44,7 +44,7 @@ In GUI programming, when we change one widget, we often want another widget to be notified. More generally, we want objects of any kind to be able to communicate with one another. For example, - if a user clicks a \gui{Close} button, we probably want the + if a user clicks a \uicontrol{Close} button, we probably want the window's \l{QWidget::close()}{close()} function to be called. Older toolkits achieve this kind of communication using @@ -70,7 +70,7 @@ practice to subclass widgets and add your own slots so that you can handle the signals that you are interested in. - \img abstract-connections.png + \image abstract-connections.png \omit \caption An abstract view of some signals and slots connections \endomit @@ -113,14 +113,14 @@ A minimal C++ class declaration might read: - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 0 + \snippet signalsandslots/signalsandslots.h 0 A small QObject-based class might read: - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 1 + \snippet signalsandslots/signalsandslots.h 1 \codeline - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 2 - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 3 + \snippet signalsandslots/signalsandslots.h 2 + \snippet signalsandslots/signalsandslots.h 3 The QObject-based version has the same internal state, and provides public methods to access the state, but in addition it has support @@ -137,7 +137,7 @@ Here is a possible implementation of the \c{Counter::setValue()} slot: - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 0 + \snippet signalsandslots/signalsandslots.cpp 0 The \c{emit} line emits the signal \c valueChanged() from the object, with the new value as argument. @@ -146,11 +146,11 @@ and connect the first object's \c valueChanged() signal to the second object's \c setValue() slot using QObject::connect(): - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 1 - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 2 + \snippet signalsandslots/signalsandslots.cpp 1 + \snippet signalsandslots/signalsandslots.cpp 2 \codeline - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 3 - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 4 + \snippet signalsandslots/signalsandslots.cpp 3 + \snippet signalsandslots/signalsandslots.cpp 4 Calling \c{a.setValue(12)} makes \c{a} emit a \c{valueChanged(12)} signal, which \c{b} will receive in its @@ -276,13 +276,13 @@ also check if an object \link QObject::inherits() inherits\endlink a specific class, for example: - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 5 - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 6 + \snippet signalsandslots/signalsandslots.cpp 5 + \snippet signalsandslots/signalsandslots.cpp 6 The meta-object information is also used by qobject_cast(), which is similar to QObject::inherits() but is less error-prone: - \snippet doc/src/snippets/signalsandslots/signalsandslots.cpp 7 + \snippet signalsandslots/signalsandslots.cpp 7 See \l{Meta-Object System} for more information. @@ -290,14 +290,14 @@ Here is a simple commented example of a widget. - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 0 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 1 + \snippet signalsandslots/lcdnumber.h 0 + \snippet signalsandslots/lcdnumber.h 1 \codeline - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 2 + \snippet signalsandslots/lcdnumber.h 2 \codeline - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 3 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 4 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 5 + \snippet signalsandslots/lcdnumber.h 3 + \snippet signalsandslots/lcdnumber.h 4 + \snippet signalsandslots/lcdnumber.h 5 \c LcdNumber inherits QObject, which has most of the signal-slot knowledge, via QFrame and QWidget. It is somewhat similar to the @@ -310,8 +310,8 @@ \l{moc}{run the moc} or to include the moc output in the link command. - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 6 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 7 + \snippet signalsandslots/lcdnumber.h 6 + \snippet signalsandslots/lcdnumber.h 7 It's not obviously relevant to the moc, but if you inherit QWidget you almost certainly want to have the \c parent argument @@ -320,8 +320,8 @@ Some destructors and member functions are omitted here; the \c moc ignores member functions. - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 8 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 9 + \snippet signalsandslots/lcdnumber.h 8 + \snippet signalsandslots/lcdnumber.h 9 \c LcdNumber emits a signal when it is asked to show an impossible value. @@ -334,11 +334,11 @@ functions when the number overflows, simply connect the signal to two different slots. Qt will call both (in the order they were connected). - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 10 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 11 - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 12 + \snippet signalsandslots/lcdnumber.h 10 + \snippet signalsandslots/lcdnumber.h 11 + \snippet signalsandslots/lcdnumber.h 12 \codeline - \snippet doc/src/snippets/signalsandslots/lcdnumber.h 13 + \snippet signalsandslots/lcdnumber.h 13 A slot is a receiving function used to get information about state changes in other widgets. \c LcdNumber uses it, as the code @@ -440,13 +440,13 @@ map all the clicked() signals to a QSignalMapper object. Then you connect the file's QPushButton::clicked() signal to the QSignalMapper::map() slot. - \snippet doc/src/snippets/signalmapper/filereader.cpp 0 + \snippet signalmapper/filereader.cpp 0 Then, you connect the \l{QSignalMapper::}{mapped()} signal to \c{readFile()} where a different file will be opened, depending on which push button is pressed. - \snippet doc/src/snippets/signalmapper/filereader.cpp 1 + \snippet signalmapper/filereader.cpp 1 \sa {Meta-Object System}, {Qt's Property System} @@ -457,7 +457,7 @@ You can even use both mechanisms in the same project. Just add the following line to your qmake project (.pro) file. - \snippet doc/src/snippets/code/doc_src_containers.cpp 22 + \snippet code/doc_src_containers.cpp 22 It tells Qt not to define the moc keywords \c{signals}, \c{slots}, and \c{emit}, because these names will be used by a 3rd party diff --git a/doc/src/corelib/qtcore.qdoc b/src/corelib/doc/src/qtcore.qdoc similarity index 95% rename from doc/src/corelib/qtcore.qdoc rename to src/corelib/doc/src/qtcore.qdoc index 36d128e..66c8704 100644 --- a/doc/src/corelib/qtcore.qdoc +++ b/src/corelib/doc/src/qtcore.qdoc @@ -37,6 +37,6 @@ All other Qt modules rely on this module. To include the definitions of the module's classes, use the following directive: - \snippet doc/src/snippets/code/doc_src_qtcore.cpp 0 + \snippet code/doc_src_qtcore.cpp 0 */ diff --git a/doc/src/corelib/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc similarity index 97% rename from doc/src/corelib/threads-basics.qdoc rename to src/corelib/doc/src/threads-basics.qdoc index e54f8a7..0f455c0 100644 --- a/doc/src/corelib/threads-basics.qdoc +++ b/src/corelib/doc/src/threads-basics.qdoc @@ -44,7 +44,7 @@ player reveals that there are again things going on in parallel within one single process. While the media player is sending music to the audio driver, the user interface with all its bells and whistles is being constantly - updated. This is what threads are for \mdash concurrency within one single + updated. This is what threads are for -- concurrency within one single process. So how is concurrency implemented? Parallel work on single core CPUs is an @@ -244,18 +244,18 @@ code that generates another thread which says hello in that thread and then exits. - \snippet examples/tutorials/threads/hellothread/hellothread.h 1 + \snippet tutorials/threads/hellothread/hellothread.h 1 We derive a class from QThread and reimplement the \l{QThread::}{run()} method. - \snippet examples/tutorials/threads/hellothread/hellothread.cpp 1 + \snippet tutorials/threads/hellothread/hellothread.cpp 1 The run method contains the code that will be run in a separate thread. In this example, a message containing the thread ID will be printed. QThread::start() will call the method in another thread. - \snippet examples/tutorials/threads/hellothread/main.cpp 1 + \snippet tutorials/threads/hellothread/main.cpp 1 To start the thread, our thread object needs to be instantiated. The \l{QThread::}{start()} method creates a new thread and calls the @@ -453,7 +453,7 @@ another thread needs to be placed in the reimplemented QRunnable::run() method. - \snippet examples/tutorials/threads/hellothreadpool/hellothreadpool.cpp 1 + \snippet tutorials/threads/hellothreadpool/hellothreadpool.cpp 1 We instantiate Work in main(), locate the global thread pool and use the QThreadPool::start() method. Now the thread pool runs our worker in another @@ -463,7 +463,7 @@ \section2 Example 2: Using QtConcurrent - \snippet examples/tutorials/threads/helloconcurrent/helloconcurrent.cpp 1 + \snippet tutorials/threads/helloconcurrent/helloconcurrent.cpp 1 We write a global function hello() to implement the work. QtConcurrent::run() is used to run the function in another thread. The result is a QFuture. @@ -499,17 +499,17 @@ Communication from the GUI to the worker thread is shown in the next example. - \snippet examples/tutorials/threads/clock/main.cpp 1 + \snippet tutorials/threads/clock/main.cpp 1 We've connected the \c clockThread with the label. The connection must be a queued signal-slot connection because we want to put the call in the event loop. - \snippet examples/tutorials/threads/clock/clockthread.h 1 + \snippet tutorials/threads/clock/clockthread.h 1 We have derived a class from QThread and declared the \c sendTime() signal. - \snippet examples/tutorials/threads/clock/clockthread.cpp 1 + \snippet tutorials/threads/clock/clockthread.cpp 1 The trickiest part of this example is that the timer is connected to its slot via a direct connection. A default connection would produce a queued @@ -541,7 +541,7 @@ The \c Thread class's code is short but somewhat involved, so we only show how to use the class. - \snippet examples/tutorials/threads/movedobject/main.cpp 1 + \snippet tutorials/threads/movedobject/main.cpp 1 QMetaObject::invokeMethod() calls a slot via the event loop. The worker object's methods should not be called directly after the object has been diff --git a/doc/src/corelib/threads.qdoc b/src/corelib/doc/src/threads.qdoc similarity index 98% rename from doc/src/corelib/threads.qdoc rename to src/corelib/doc/src/threads.qdoc index 04a5379..80c9445 100644 --- a/doc/src/corelib/threads.qdoc +++ b/src/corelib/doc/src/threads.qdoc @@ -129,12 +129,12 @@ To create a thread, subclass QThread and reimplement its \l{QThread::run()}{run()} function. For example: - \snippet doc/src/snippets/threads/threads.h 0 + \snippet threads/threads.h 0 \codeline - \snippet doc/src/snippets/threads/threads.cpp 0 - \snippet doc/src/snippets/threads/threads.cpp 1 + \snippet threads/threads.cpp 0 + \snippet threads/threads.cpp 1 \dots - \snippet doc/src/snippets/threads/threads.cpp 2 + \snippet threads/threads.cpp 2 \section1 Starting a Thread @@ -258,8 +258,8 @@ a member function on the \e{same} instance of the class at the same time. For example, the \c Counter class below is reentrant: - \snippet doc/src/snippets/threads/threads.cpp 3 - \snippet doc/src/snippets/threads/threads.cpp 4 + \snippet threads/threads.cpp 3 + \snippet threads/threads.cpp 4 The class isn't thread-safe, because if multiple threads try to modify the data member \c n, the result is undefined. This is @@ -285,8 +285,8 @@ the class thread-safe is to protect all access to the data members with a QMutex: - \snippet doc/src/snippets/threads/threads.cpp 5 - \snippet doc/src/snippets/threads/threads.cpp 6 + \snippet threads/threads.cpp 5 + \snippet threads/threads.cpp 6 The QMutexLocker class automatically locks the mutex in its constructor and unlocks it when the destructor is invoked, at the diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 2f7611f..99078b1 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -126,7 +126,7 @@ QT_BEGIN_NAMESPACE Qt::Alignment parameter, which means that any combination of Qt::AlignmentFlag values,or 0, is legal: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 0 + \snippet code/src_corelib_global_qglobal.cpp 0 If you try to pass a value from another enum or just a plain integer other than 0, the compiler will report an error. If you @@ -138,7 +138,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 1 + \snippet code/src_corelib_global_qglobal.cpp 1 You can then use the \c MyClass::Options type to store combinations of \c MyClass::Option values. @@ -150,7 +150,7 @@ QT_BEGIN_NAMESPACE To make the flags available for these purposes, the Q_FLAGS() macro must be used: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp meta-object flags + \snippet code/src_corelib_global_qglobal.cpp meta-object flags \section1 Naming Convention @@ -353,18 +353,18 @@ QT_BEGIN_NAMESPACE The curious user will have seen that the Qt classes derived from QObject typically include this macro in a private section: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 43 + \snippet code/src_corelib_global_qglobal.cpp 43 It declares a copy constructor and an assignment operator in the private section, so that if you use them by mistake, the compiler will report an error. - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 44 + \snippet code/src_corelib_global_qglobal.cpp 44 But even this might not catch absolutely every case. You might be tempted to do something like this: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 45 + \snippet code/src_corelib_global_qglobal.cpp 45 First of all, don't do that. Most compilers will generate code that uses the copy constructor, so the privacy violation error will be @@ -382,7 +382,7 @@ QT_BEGIN_NAMESPACE The Q_DECLARE_FLAGS() macro expands to - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 2 + \snippet code/src_corelib_global_qglobal.cpp 2 \a Enum is the name of an existing enum type, whereas \a Flags is the name of the QFlags<\e{Enum}> typedef. @@ -461,7 +461,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 3 + \snippet code/src_corelib_global_qglobal.cpp 3 also contains functions that generate messages from the given string argument: qCritical(), qDebug(), qFatal() and @@ -470,7 +470,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 4 + \snippet code/src_corelib_global_qglobal.cpp 4 The remaining functions are qRound() and qRound64(), which both accept a \l qreal value as their argument returning the value @@ -532,22 +532,6 @@ QT_BEGIN_NAMESPACE Convenience typedef for \c{unsigned char}. */ -/*! - \fn qt_set_sequence_auto_mnemonic(bool on) - \relates - - Enables automatic mnemonics on Mac if \a on is true; otherwise - this feature is disabled. - - Note that this function is only available on Mac where mnemonics - are disabled by default. - - To access to this function, use an extern declaration: - extern void qt_set_sequence_auto_mnemonic(bool b); - - \sa {QShortcut#mnemonic}{QShortcut} -*/ - /*! \typedef ushort \relates @@ -619,7 +603,7 @@ QT_BEGIN_NAMESPACE Literals of this type can be created using the Q_INT64_C() macro: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 5 + \snippet code/src_corelib_global_qglobal.cpp 5 \sa Q_INT64_C(), quint64, qlonglong */ @@ -635,7 +619,7 @@ QT_BEGIN_NAMESPACE Literals of this type can be created using the Q_UINT64_C() macro: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 6 + \snippet code/src_corelib_global_qglobal.cpp 6 \sa Q_UINT64_C(), qint64, qulonglong */ @@ -712,7 +696,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 8 + \snippet code/src_corelib_global_qglobal.cpp 8 \sa qint64, Q_UINT64_C() */ @@ -725,7 +709,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 9 + \snippet code/src_corelib_global_qglobal.cpp 9 \sa quint64, Q_INT64_C() */ @@ -758,7 +742,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 10 + \snippet code/src_corelib_global_qglobal.cpp 10 */ /*! \fn int qRound(qreal value) @@ -768,7 +752,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 11 + \snippet code/src_corelib_global_qglobal.cpp 11 */ /*! \fn qint64 qRound64(qreal value) @@ -778,7 +762,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 12 + \snippet code/src_corelib_global_qglobal.cpp 12 */ /*! \fn const T &qMin(const T &value1, const T &value2) @@ -788,7 +772,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 13 + \snippet code/src_corelib_global_qglobal.cpp 13 \sa qMax(), qBound() */ @@ -800,7 +784,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 14 + \snippet code/src_corelib_global_qglobal.cpp 14 \sa qMin(), qBound() */ @@ -813,7 +797,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 15 + \snippet code/src_corelib_global_qglobal.cpp 15 \sa qMin(), qMax() */ @@ -843,7 +827,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 16 + \snippet code/src_corelib_global_qglobal.cpp 16 \sa QT_VERSION_STR, qVersion() */ @@ -1769,12 +1753,12 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 17 + \snippet code/src_corelib_global_qglobal.cpp 17 If \c b is zero, the Q_ASSERT statement will output the following message using the qFatal() function: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 18 + \snippet code/src_corelib_global_qglobal.cpp 18 \sa Q_ASSERT_X(), qFatal(), {Debugging Techniques} */ @@ -1792,12 +1776,12 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 19 + \snippet code/src_corelib_global_qglobal.cpp 19 If \c b is zero, the Q_ASSERT_X statement will output the following message using the qFatal() function: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 20 + \snippet code/src_corelib_global_qglobal.cpp 20 \sa Q_ASSERT(), qFatal(), {Debugging Techniques} */ @@ -1812,7 +1796,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() conditions that it would not otherwise know about. However, there is no guarantee that the compiler will actually use those hints. - This macro could be considered a "lighter" version of \ref Q_ASSERT. While + This macro could be considered a "lighter" version of \l{Q_ASSERT}. While Q_ASSERT will abort the program's execution if the condition is false, Q_ASSUME will tell the compiler not to generate code for those conditions. Therefore, it is important that the assumptions always hold, otherwise @@ -1841,11 +1825,11 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() This macro is useful to mark impossible conditions. For example, given the following enum: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunreachable-enum + \snippet code/src_corelib_global_qglobal.cpp qunreachable-enum One can write a switch table like so: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunreachable-switch + \snippet code/src_corelib_global_qglobal.cpp qunreachable-switch The advantage of inserting Q_UNREACHABLE() at that point is that the compiler is told not to generate code for a shape variable containing that @@ -1872,7 +1856,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 21 + \snippet code/src_corelib_global_qglobal.cpp 21 \sa qWarning(), {Debugging Techniques} */ @@ -1896,7 +1880,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion() Q_FUNC_INFO can be conveniently used with qDebug(). For example, this function: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 22 + \snippet code/src_corelib_global_qglobal.cpp 22 when instantiated with the integer type, will with the GCC compiler produce: @@ -2217,14 +2201,14 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 31 + \snippet code/src_corelib_global_qglobal.cpp 31 It is equivalent to \c{for (;;)}. If you're worried about namespace pollution, you can disable this macro by adding the following line to your \c .pro file: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 32 + \snippet code/src_corelib_global_qglobal.cpp 32 \sa Q_FOREVER */ @@ -2254,7 +2238,7 @@ int qrand() If you're worried about namespace pollution, you can disable this macro by adding the following line to your \c .pro file: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 33 + \snippet code/src_corelib_global_qglobal.cpp 33 \sa Q_FOREACH() */ @@ -2283,7 +2267,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 34 + \snippet code/src_corelib_global_qglobal.cpp 34 The macro QT_TR_NOOP_UTF8() is identical except that it tells lupdate that the source string is encoded in UTF-8. Corresponding variants @@ -2305,7 +2289,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 35 + \snippet code/src_corelib_global_qglobal.cpp 35 \sa QT_TR_NOOP(), QT_TRANSLATE_NOOP3(), {Internationalization with Qt} */ @@ -2326,7 +2310,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 36 + \snippet code/src_corelib_global_qglobal.cpp 36 \sa QT_TR_NOOP(), QT_TRANSLATE_NOOP(), {Internationalization with Qt} */ @@ -2354,11 +2338,11 @@ int qrand() or - \tt{\begincomment% \endcomment} + \tt{\\begincomment% \\endcomment} Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qttrid + \snippet code/src_corelib_global_qglobal.cpp qttrid Creating QM files suitable for use with this function requires passing the \c -idbased option to the \c lrelease tool. @@ -2385,7 +2369,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qttrid_noop + \snippet code/src_corelib_global_qglobal.cpp qttrid_noop \sa qtTrId(), {Internationalization with Qt} */ @@ -2402,7 +2386,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qlikely + \snippet code/src_corelib_global_qglobal.cpp qlikely \sa Q_UNLIKELY() */ @@ -2419,7 +2403,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunlikely + \snippet code/src_corelib_global_qglobal.cpp qunlikely \sa Q_LIKELY() */ @@ -2496,7 +2480,7 @@ int qrand() Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 37 + \snippet code/src_corelib_global_qglobal.cpp 37 \sa qDebug(), qWarning(), qCritical(), qFatal() @@ -2528,7 +2512,7 @@ int qrand() Example of a "primitive" type: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 38 + \snippet code/src_corelib_global_qglobal.cpp 38 An example of a non-POD "primitive" type is QUuid: Even though QUuid has constructors (and therefore isn't POD), every bit @@ -2537,7 +2521,7 @@ int qrand() Example of a movable type: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 39 + \snippet code/src_corelib_global_qglobal.cpp 39 */ /*! @@ -2607,7 +2591,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Use this macro as in the following examples. - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 40 + \snippet code/src_corelib_global_qglobal.cpp 40 \sa Q_BIG_ENDIAN, Q_LITTLE_ENDIAN */ @@ -2622,7 +2606,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) lowest address. The other bytes follow in increasing order of significance. - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 41 + \snippet code/src_corelib_global_qglobal.cpp 41 \sa Q_BYTE_ORDER, Q_BIG_ENDIAN */ @@ -2637,7 +2621,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) lowest address. The other bytes follow in decreasing order of significance. - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 42 + \snippet code/src_corelib_global_qglobal.cpp 42 \sa Q_BYTE_ORDER, Q_LITTLE_ENDIAN */ @@ -2720,7 +2704,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) This macro expands to - \snippet snippets/code/src_corelib_global_qglobal.cpp begin namespace macro + \snippet code/src_corelib_global_qglobal.cpp begin namespace macro if \c QT_NAMESPACE is defined and nothing otherwise. If should always appear in the file-level scope and be followed by \c QT_END_NAMESPACE @@ -2754,7 +2738,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) This macro expands to - \snippet snippets/code/src_corelib_global_qglobal.cpp end namespace macro + \snippet code/src_corelib_global_qglobal.cpp end namespace macro if \c QT_NAMESPACE is defined and nothing otherwise. It is used to cancel the effect of \c QT_BEGIN_NAMESPACE. @@ -2821,7 +2805,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Note that comparing values where either \a p1 or \a p2 is 0.0 will not work. The solution to this is to compare against values greater than or equal to 1.0. - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 46 + \snippet code/src_corelib_global_qglobal.cpp 46 The two numbers are compared in a relative way, where the exactness is stronger the smaller the numbers are. @@ -2856,7 +2840,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Example: - \snippet doc/src/snippets/code/src_gui_dialogs_qmessagebox.cpp 4 + \snippet code/src_gui_dialogs_qmessagebox.cpp 4 */ /*! @@ -2908,12 +2892,12 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 24 + \snippet code/src_corelib_global_qglobal.cpp 24 If you include \c , a more convenient syntax is also available: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 25 + \snippet code/src_corelib_global_qglobal.cpp 25 With this syntax, the function returns a QDebug object that is configured to use the QtDebugMsg message type. It automatically @@ -2943,12 +2927,12 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) string. Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 26 + \snippet code/src_corelib_global_qglobal.cpp 26 If you include , a more convenient syntax is also available: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 27 + \snippet code/src_corelib_global_qglobal.cpp 27 This syntax inserts a space between each item, and appends a newline at the end. @@ -2973,12 +2957,12 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) string. Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 28 + \snippet code/src_corelib_global_qglobal.cpp 28 If you include , a more convenient syntax is also available: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 29 + \snippet code/src_corelib_global_qglobal.cpp 29 A space is inserted between the items, and a newline is appended at the end. @@ -3007,7 +2991,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) similar to the C printf() function. Example: - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 30 + \snippet code/src_corelib_global_qglobal.cpp 30 To suppress the output at runtime, install your own message handler with qInstallMessageHandler(). @@ -3016,77 +3000,4 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters) {Debugging Techniques} */ -/*! - \typedef QtMsgHandler - \relates - \deprecated - - This is a typedef for a pointer to a function with the following - signature: - - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 7 - - This typedef is deprecated, you should use QMessageHandler instead. - \sa QtMsgType, QMessageHandler, qInstallMsgHandler(), qInstallMessageHandler() -*/ - -/*! - \typedef QMessageHandler - \relates - \since 5.0 - - This is a typedef for a pointer to a function with the following - signature: - - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 49 - - \sa QtMsgType, qInstallMessageHandler() -*/ - -/*! - \fn QMessageHandler qInstallMessageHandler(QMessageHandler handler) - \relates - \since 5.0 - - Installs a Qt message \a handler which has been defined - previously. Returns a pointer to the previous message handler - (which may be 0). - - The message handler is a function that prints out debug messages, - warnings, critical and fatal error messages. The Qt library (debug - mode) contains hundreds of warning messages that are printed - when internal errors (usually invalid function arguments) - occur. Qt built in release mode also contains such warnings unless - QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during - compilation. If you implement your own message handler, you get total - control of these messages. - - The default message handler prints the message to the standard - output under X11 or to the debugger under Windows. If it is a - fatal message, the application aborts immediately. - - Only one message handler can be defined, since this is usually - done on an application-wide basis to control debug output. - - To restore the message handler, call \c qInstallMessageHandler(0). - - Example: - - \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 23 - - \sa QMessageHandler, QtMsgType, qDebug(), qWarning(), qCritical(), qFatal(), - {Debugging Techniques} -*/ - -/*! - \fn QtMsgHandler qInstallMsgHandler(QtMsgHandler handler) - \relates - \deprecated - - Installs a Qt message \a handler which has been defined - previously. This method is deprecated, use qInstallMessageHandler - instead. - \sa QtMsgHandler, qInstallMessageHandler -*/ - QT_END_NAMESPACE diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index afefb11..f30df92 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE One example of direct use is to forward errors that stem from a scripting language, e.g. QML: - \snippet doc/src/snippets/code/qlogging/qloggingsnippet.cpp 1 + \snippet code/qlogging/qlogging.cpp 1 \sa QMessageLogContext, qDebug(), qWarning(), qCritical(), qFatal() */ @@ -132,7 +132,6 @@ static void qt_message(QtMsgType msgType, const QMessageLogContext &context, con } #undef qDebug - void QMessageLogger::debug(const char *msg, ...) { va_list ap; @@ -178,7 +177,6 @@ QDebug QMessageLogger::warning() #endif #undef qCritical - void QMessageLogger::critical(const char *msg, ...) { va_list ap; @@ -198,7 +196,6 @@ QDebug QMessageLogger::critical() #endif #undef qFatal - void QMessageLogger::fatal(const char *msg, ...) { va_list ap; @@ -652,6 +649,79 @@ extern Q_CORE_EXPORT void qWinMessageHandler(QtMsgType t, const QMessageLogConte const char *str); #endif +/*! + \typedef QtMsgHandler + \relates + \deprecated + + This is a typedef for a pointer to a function with the following + signature: + + \snippet code/src_corelib_global_qglobal.cpp 7 + + This typedef is deprecated, you should use QMessageHandler instead. + \sa QtMsgType, QMessageHandler, qInstallMsgHandler(), qInstallMessageHandler() +*/ + +/*! + \fn QtMsgHandler qInstallMsgHandler(QtMsgHandler handler) + \relates + \deprecated + + Installs a Qt message \a handler which has been defined + previously. This method is deprecated, use qInstallMessageHandler + instead. + \sa QtMsgHandler, qInstallMessageHandler +*/ + +/*! + \typedef QMessageHandler + \relates + \since 5.0 + + This is a typedef for a pointer to a function with the following + signature: + + \snippet code/src_corelib_global_qglobal.cpp 49 + + \sa QtMsgType, qInstallMessageHandler() +*/ + +/*! + \fn QMessageHandler qInstallMessageHandler(QMessageHandler handler) + \relates + \since 5.0 + + Installs a Qt message \a handler which has been defined + previously. Returns a pointer to the previous message handler + (which may be 0). + + The message handler is a function that prints out debug messages, + warnings, critical and fatal error messages. The Qt library (debug + mode) contains hundreds of warning messages that are printed + when internal errors (usually invalid function arguments) + occur. Qt built in release mode also contains such warnings unless + QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during + compilation. If you implement your own message handler, you get total + control of these messages. + + The default message handler prints the message to the standard + output under X11 or to the debugger under Windows. If it is a + fatal message, the application aborts immediately. + + Only one message handler can be defined, since this is usually + done on an application-wide basis to control debug output. + + To restore the message handler, call \c qInstallMessageHandler(0). + + Example: + + \snippet code/src_corelib_global_qglobal.cpp 23 + + \sa qDebug(), qWarning(), qCritical(), qFatal(), QtMsgType, + {Debugging Techniques} +*/ + QMessageHandler qInstallMessageHandler(QMessageHandler h) { if (!messageHandler) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 881b550..76ad61d 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -230,7 +230,7 @@ actual 'Mouse Buttons', the device must be re-configured (using the vendor's configuration tool). - \sa KeyboardModifier Modifier + \sa KeyboardModifier, Modifier */ /*! @@ -257,7 +257,7 @@ \note On Windows Keyboards, Qt::MetaModifier and Qt::Key_Meta are mapped to the Windows key. - \sa MouseButton Modifier + \sa MouseButton, Modifier */ /*! @@ -278,7 +278,7 @@ point, not as a Qt Key. \omitvalue MODIFIER_MASK - \sa KeyboardModifier MouseButton + \sa KeyboardModifier, MouseButton */ /*! @@ -542,7 +542,7 @@ arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message: - \snippet doc/src/snippets/code/doc_src_qnamespace.qdoc 0 + \snippet code/doc_src_qnamespace.qdoc 0 Call qRegisterMetaType() to register the data type before you establish the connection. @@ -1981,8 +1981,6 @@ system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt::FramelessWindowHint. - \br - \br On Mac OS X, tool windows correspond to the \l{http://developer.apple.com/documentation/Carbon/Conceptual/HandlingWindowsControls/hitb-wind_cont_concept/chapter_2_section_2.html}{Floating} class of windows. This means that the window lives on a @@ -2174,9 +2172,7 @@ should be taken over by the target application, i.e., the source application should not delete the data. - \br On X11 this value is used to do a move. - \br TargetMoveAction is not used on the Mac. */ @@ -2643,7 +2639,7 @@ for other strings (e.g., "\l{http://qt.nokia.com/doc/qq/qq09-mac-deployment.html}{Deploying Applications on Ma...}"). - \sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag QTabBar::elideMode + \sa QAbstractItemView::textElideMode, QFontMetrics::elidedText(), AlignmentFlag, QTabBar::elideMode */ /*! @@ -2721,7 +2717,7 @@ INT_MIN, inclusive. For example, you can define custom priorities as being relative to each other: - \snippet doc/src/snippets/code/doc_src_qnamespace.cpp 1 + \snippet code/doc_src_qnamespace.cpp 1 \sa QCoreApplication::postEvent() */ diff --git a/src/corelib/io/qabstractfileengine.cpp b/src/corelib/io/qabstractfileengine.cpp index 0216981..6c10c6c 100644 --- a/src/corelib/io/qabstractfileengine.cpp +++ b/src/corelib/io/qabstractfileengine.cpp @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE For example: - \snippet doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp 0 + \snippet code/src_corelib_io_qabstractfileengine.cpp 0 When the handler is destroyed, it is automatically removed from Qt. @@ -184,7 +184,7 @@ QAbstractFileEngine *qt_custom_file_engine_handler_create(const QString &path) Example: - \snippet doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp 1 + \snippet code/src_corelib_io_qabstractfileengine.cpp 1 \sa QAbstractFileEngine::create() */ @@ -461,7 +461,7 @@ bool QAbstractFileEngine::isSequential() const This virtual function must be reimplemented by all subclasses. - \sa setFileName() rmdir() + \sa setFileName(), rmdir() */ bool QAbstractFileEngine::remove() { @@ -515,7 +515,7 @@ bool QAbstractFileEngine::link(const QString &newName) This virtual function must be reimplemented by all subclasses. - \sa setFileName() rmdir() isRelativePath() + \sa setFileName(), rmdir(), isRelativePath() */ bool QAbstractFileEngine::mkdir(const QString &dirName, bool createParentDirectories) const { @@ -535,7 +535,7 @@ bool QAbstractFileEngine::mkdir(const QString &dirName, bool createParentDirecto This virtual function must be reimplemented by all subclasses. - \sa setFileName() remove() mkdir() isRelativePath() + \sa setFileName(), remove(), mkdir(), isRelativePath() */ bool QAbstractFileEngine::rmdir(const QString &dirName, bool recurseParentDirectories) const { @@ -671,7 +671,7 @@ QString QAbstractFileEngine::fileName(FileName file) const This virtual function must be reimplemented by all subclasses. - \sa owner() setFileName(), FileOwner + \sa owner(), setFileName(), FileOwner */ uint QAbstractFileEngine::ownerId(FileOwner owner) const { @@ -687,7 +687,7 @@ uint QAbstractFileEngine::ownerId(FileOwner owner) const This virtual function must be reimplemented by all subclasses. - \sa ownerId() setFileName(), FileOwner + \sa ownerId(), setFileName(), FileOwner */ QString QAbstractFileEngine::owner(FileOwner owner) const { @@ -821,7 +821,7 @@ bool QAbstractFileEngine::unmap(uchar *address) Example: - \snippet doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp 2 + \snippet code/src_corelib_io_qabstractfileengine.cpp 2 QAbstractFileEngineIterator is associated with a path, name filters, and entry filters. The path is the directory that the iterator lists entries @@ -846,7 +846,7 @@ bool QAbstractFileEngine::unmap(uchar *address) Here is an example of how to implement an iterator that returns each of three fixed entries in sequence. - \snippet doc/src/snippets/code/src_corelib_io_qabstractfileengine.cpp 3 + \snippet code/src_corelib_io_qabstractfileengine.cpp 3 Note: QAbstractFileEngineIterator does not deal with QDir::IteratorFlags; it simply returns entries for a single directory. @@ -1080,7 +1080,7 @@ qint64 QAbstractFileEngine::write(const char *data, qint64 len) } /*! - This function reads one line, terminated by a '\n' character, from the + This function reads one line, terminated by a '\\n' character, from the file info \a data. At most \a maxlen characters will be read. The end-of-line character is included. */ diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp index dfc85a4..af71af1 100644 --- a/src/corelib/io/qbuffer.cpp +++ b/src/corelib/io/qbuffer.cpp @@ -112,7 +112,7 @@ QByteArray QBufferPrivate::peek(qint64 maxSize) interface. The QByteArray is treated just as a standard random-accessed file. Example: - \snippet doc/src/snippets/buffer/buffer.cpp 0 + \snippet buffer/buffer.cpp 0 By default, an internal QByteArray buffer is created for you when you create a QBuffer. You can access this buffer directly by @@ -130,12 +130,12 @@ QByteArray QBufferPrivate::peek(qint64 maxSize) The following code snippet shows how to write data to a QByteArray using QDataStream and QBuffer: - \snippet doc/src/snippets/buffer/buffer.cpp 1 + \snippet buffer/buffer.cpp 1 Effectively, we convert the application's QPalette into a byte array. Here's how to read the data from the QByteArray: - \snippet doc/src/snippets/buffer/buffer.cpp 2 + \snippet buffer/buffer.cpp 2 QTextStream and QDataStream also provide convenience constructors that take a QByteArray and that create a QBuffer behind the @@ -194,7 +194,7 @@ QBuffer::QBuffer(QObject *parent) Example: - \snippet doc/src/snippets/buffer/buffer.cpp 3 + \snippet buffer/buffer.cpp 3 \sa open(), setBuffer(), setData() */ @@ -230,7 +230,7 @@ QBuffer::~QBuffer() Example: - \snippet doc/src/snippets/buffer/buffer.cpp 4 + \snippet buffer/buffer.cpp 4 If \a byteArray is 0, the buffer creates its own internal QByteArray to work on. This byte array is initially empty. diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 1fe2a79..559c5a0 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -81,11 +81,11 @@ QT_BEGIN_NAMESPACE Example (write binary data to a stream): - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 0 + \snippet code/src_corelib_io_qdatastream.cpp 0 Example (read binary data from a stream): - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 1 + \snippet code/src_corelib_io_qdatastream.cpp 1 Each item written to the stream is written in a predefined binary format that varies depending on the item's type. Supported Qt @@ -119,7 +119,7 @@ QT_BEGIN_NAMESPACE compatibility, you can hardcode the version number in the application: - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 2 + \snippet code/src_corelib_io_qdatastream.cpp 2 If you are producing a new binary data format, such as a file format for documents created by your application, you could use a @@ -127,11 +127,11 @@ QT_BEGIN_NAMESPACE would write a brief header containing a magic string and a version number to give yourself room for future expansion. For example: - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 3 + \snippet code/src_corelib_io_qdatastream.cpp 3 Then read it in with: - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 4 + \snippet code/src_corelib_io_qdatastream.cpp 4 You can select which byte order to use when serializing data. The default setting is big endian (MSB first). Changing it to little @@ -187,7 +187,7 @@ QT_BEGIN_NAMESPACE defined, check the \b {Related Non-Members} section of the class's documentation page. - \sa QTextStream QVariant + \sa QTextStream, QVariant */ /*! @@ -421,7 +421,7 @@ bool QDataStream::atEnd() const \since 4.6 - \sa FloatingPointPrecision setFloatingPointPrecision() + \sa FloatingPointPrecision, setFloatingPointPrecision() */ QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const { @@ -455,7 +455,7 @@ void QDataStream::setFloatingPointPrecision(QDataStream::FloatingPointPrecision /*! Returns the status of the data stream. - \sa Status setStatus() resetStatus() + \sa Status, setStatus(), resetStatus() */ QDataStream::Status QDataStream::status() const @@ -466,7 +466,7 @@ QDataStream::Status QDataStream::status() const /*! Resets the status of the data stream. - \sa Status status() setStatus() + \sa Status, status(), setStatus() */ void QDataStream::resetStatus() { @@ -479,7 +479,7 @@ void QDataStream::resetStatus() Subsequent calls to setStatus() are ignored until resetStatus() is called. - \sa Status status() resetStatus() + \sa Status, status(), resetStatus() */ void QDataStream::setStatus(Status status) { @@ -589,7 +589,7 @@ void QDataStream::setByteOrder(ByteOrder bo) The \l Version enum provides symbolic constants for the different versions of Qt. For example: - \snippet doc/src/snippets/code/src_corelib_io_qdatastream.cpp 5 + \snippet code/src_corelib_io_qdatastream.cpp 5 \sa version(), Version */ @@ -813,7 +813,7 @@ QDataStream &QDataStream::operator>>(double &f) /*! \overload - Reads the '\0'-terminated string \a s from the stream and returns + Reads the '\\0'-terminated string \a s from the stream and returns a reference to the stream. Space for the string is allocated using \c new -- the caller must @@ -1094,7 +1094,7 @@ QDataStream &QDataStream::operator<<(double f) /*! \overload - Writes the '\0'-terminated string \a s to the stream and returns a + Writes the '\\0'-terminated string \a s to the stream and returns a reference to the stream. The string is serialized using writeBytes(). diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 6726537..a9d0fd4 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -63,7 +63,7 @@ In the common case, it is useful to call the qDebug() function to obtain a default QDebug object to use for writing debugging information. - \snippet doc/src/snippets/qdebug/qdebugsnippet.cpp 1 + \snippet qdebug/qdebugsnippet.cpp 1 This constructs a QDebug object using the constructor that accepts a QtMsgType value of QtDebugMsg. Similarly, the qWarning(), qCritical() and qFatal() @@ -80,7 +80,7 @@ most Qt value types. To add support for custom types, you need to implement a streaming operator, as in the following example: - \snippet doc/src/snippets/qdebug/qdebugsnippet.cpp 0 + \snippet qdebug/qdebugsnippet.cpp 0 This is described in the \l{Debugging Techniques} and \l{Creating Custom Qt Types#Making the Type Printable}{Creating Custom Qt Types} @@ -251,7 +251,7 @@ /*! \fn QDebug &QDebug::operator<<(const char *s) - Writes the '\0'-terminated string, \a s, to the stream and returns a + Writes the '\\0'-terminated string, \a s, to the stream and returns a reference to the stream. */ diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 23bf3c5..222192b 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -358,14 +358,14 @@ inline void QDirPrivate::initFileEngine() Examples of absolute paths: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 0 + \snippet code/src_corelib_io_qdir.cpp 0 On Windows, the second example above will be translated to \c{C:\Documents and Settings} when used to access files. Examples of relative paths: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 1 + \snippet code/src_corelib_io_qdir.cpp 1 You can use the isRelative() or isAbsolute() functions to check if a QDir is using a relative or an absolute file path. Call @@ -382,7 +382,7 @@ inline void QDirPrivate::initFileEngine() the location of the directory. However, it can also return "." if the QDir represents the current directory. - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 2 + \snippet code/src_corelib_io_qdir.cpp 2 The path for a directory can also be changed with the cd() and cdUp() functions, both of which operate like familiar shell commands. @@ -418,7 +418,7 @@ inline void QDirPrivate::initFileEngine() file or directory. Neither of these functions checks for the existence of files or directory; they only construct paths. - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 3 + \snippet code/src_corelib_io_qdir.cpp 3 Files can be removed by using the remove() function. Directories cannot be removed in the same way as files; use rmdir() to remove @@ -490,19 +490,19 @@ inline void QDirPrivate::initFileEngine() Check if a directory exists: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 4 + \snippet code/src_corelib_io_qdir.cpp 4 (We could also use the static convenience function QFile::exists().) Traversing directories and reading a file: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 5 + \snippet code/src_corelib_io_qdir.cpp 5 A program that lists all the files in the current directory (excluding symbolic links), sorted by size, smallest first: - \snippet doc/src/snippets/qdir-listfiles/main.cpp 0 + \snippet qdir-listfiles/main.cpp 0 \sa QFileInfo, QFile, QFileDialog, QApplication::applicationDirPath(), {Find Files Example} */ @@ -630,7 +630,7 @@ QString QDir::absolutePath() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 6 + \snippet code/src_corelib_io_qdir.cpp 6 \sa path(), absolutePath(), exists(), cleanPath(), dirName(), absoluteFilePath() @@ -669,7 +669,7 @@ QString QDir::dirName() const be relative. Redundant multiple separators or "." and ".." directories in \a fileName are not removed (see cleanPath()). - \sa dirName() absoluteFilePath(), isRelative(), canonicalPath() + \sa dirName(), absoluteFilePath(), isRelative(), canonicalPath() */ QString QDir::filePath(const QString &fileName) const { @@ -692,7 +692,7 @@ QString QDir::filePath(const QString &fileName) const exists(). Redundant multiple separators or "." and ".." directories in \a fileName are not removed (see cleanPath()). - \sa relativeFilePath() filePath() canonicalPath() + \sa relativeFilePath(), filePath(), canonicalPath() */ QString QDir::absoluteFilePath(const QString &fileName) const { @@ -711,9 +711,9 @@ QString QDir::absoluteFilePath(const QString &fileName) const /*! Returns the path to \a fileName relative to the directory. - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 7 + \snippet code/src_corelib_io_qdir.cpp 7 - \sa absoluteFilePath() filePath() canonicalPath() + \sa absoluteFilePath(), filePath(), canonicalPath() */ QString QDir::relativeFilePath(const QString &fileName) const { @@ -941,7 +941,7 @@ QStringList QDir::nameFilters() const to ensure that only files with extensions typically used for C++ source files are listed: - \snippet doc/src/snippets/qdir-namefilters/main.cpp 0 + \snippet qdir-namefilters/main.cpp 0 \sa nameFilters(), setFilter() */ @@ -988,7 +988,7 @@ void QDir::addResourceSearchPath(const QString &path) Qt uses this search path to locate files with a known prefix. The search path entries are tested in order, starting with the first entry. - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 8 + \snippet code/src_corelib_io_qdir.cpp 8 File name prefix must be at least 2 characters long to avoid conflicts with Windows drive letters. @@ -1146,7 +1146,7 @@ void QDir::setFilter(Filters filters) /*! Returns the value set by setSorting() - \sa setSorting() SortFlag + \sa setSorting(), SortFlag */ QDir::SortFlags QDir::sorting() const { @@ -1190,7 +1190,7 @@ QDir::SortFlags QDir::sorting() const The \a sort is specified by OR-ing values from the enum \l{QDir::SortFlag}. - \sa sorting() SortFlag + \sa sorting(), SortFlag */ void QDir::setSorting(SortFlags sort) { @@ -1561,7 +1561,7 @@ bool QDir::exists() const this function returns false. If you want to test for this use canonicalPath(), e.g. - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 9 + \snippet code/src_corelib_io_qdir.cpp 9 \sa root(), rootPath() */ @@ -1578,7 +1578,7 @@ bool QDir::isRoot() const Returns true if the directory's path is absolute; otherwise returns false. See isAbsolutePath(). - \sa isRelative() makeAbsolute() cleanPath() + \sa isRelative(), makeAbsolute(), cleanPath() */ /*! @@ -1587,7 +1587,7 @@ bool QDir::isRoot() const Returns true if \a path is absolute; returns false if it is relative. - \sa isAbsolute() isRelativePath() makeAbsolute() cleanPath() + \sa isAbsolute(), isRelativePath(), makeAbsolute(), cleanPath() */ /*! @@ -1595,7 +1595,7 @@ bool QDir::isRoot() const false. (Under Unix a path is relative if it does not start with a "/"). - \sa makeAbsolute() isAbsolute() isAbsolutePath() cleanPath() + \sa makeAbsolute(), isAbsolute(), isAbsolutePath(), cleanPath() */ bool QDir::isRelative() const { @@ -1610,7 +1610,7 @@ bool QDir::isRelative() const absolute nothing happens. Returns true if the conversion succeeded; otherwise returns false. - \sa isAbsolute() isAbsolutePath() isRelative() cleanPath() + \sa isAbsolute(), isAbsolutePath(), isRelative(), cleanPath() */ bool QDir::makeAbsolute() { @@ -1639,7 +1639,7 @@ bool QDir::makeAbsolute() Example: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 10 + \snippet code/src_corelib_io_qdir.cpp 10 */ bool QDir::operator==(const QDir &dir) const { @@ -1718,7 +1718,7 @@ QDir &QDir::operator=(const QString &path) Example: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 11 + \snippet code/src_corelib_io_qdir.cpp 11 */ /*! @@ -1873,7 +1873,7 @@ QString QDir::currentPath() Under Windows this function will return the directory of the current user's profile. Typically, this is: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 12 + \snippet code/src_corelib_io_qdir.cpp 12 Use the toNativeSeparators() function to convert the separators to the ones that are appropriate for the underlying operating system. @@ -1966,7 +1966,7 @@ QString QDir::rootPath() patterns in the list of \a filters; otherwise returns false. The matching is case insensitive. - \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() + \sa {QRegExp wildcard matching}, QRegExp::exactMatch(), entryList(), entryInfoList() */ bool QDir::match(const QStringList &filters, const QString &fileName) { @@ -1984,7 +1984,7 @@ bool QDir::match(const QStringList &filters, const QString &fileName) contain multiple patterns separated by spaces or semicolons. The matching is case insensitive. - \sa {QRegExp wildcard matching}, QRegExp::exactMatch() entryList() entryInfoList() + \sa {QRegExp wildcard matching}, QRegExp::exactMatch(), entryList(), entryInfoList() */ bool QDir::match(const QString &filter, const QString &fileName) { @@ -2001,7 +2001,7 @@ bool QDir::match(const QString &filter, const QString &fileName) For example, "./local" becomes "local", "local/../bin" becomes "bin" and "/local/usr/../bin" becomes "/local/bin". - \sa absolutePath() canonicalPath() + \sa absolutePath(), canonicalPath() */ QString QDir::cleanPath(const QString &path) { @@ -2129,7 +2129,7 @@ QString QDir::cleanPath(const QString &path) Returns true if \a path is relative; returns false if it is absolute. - \sa isRelative() isAbsolutePath() makeAbsolute() + \sa isRelative(), isAbsolutePath(), makeAbsolute() */ bool QDir::isRelativePath(const QString &path) { @@ -2181,7 +2181,7 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter) initialized at startup by adding this line to your \c main() function: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 13 + \snippet code/src_corelib_io_qdir.cpp 13 If the file name contains characters that cannot be part of a valid C++ function name (such as '-'), they have to be replaced by the underscore character ('_'). @@ -2190,7 +2190,7 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter) main(). If that is not possible, the following workaround can be used to init the resource \c myapp from the function \c{MyNamespace::myFunction}: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 14 + \snippet code/src_corelib_io_qdir.cpp 14 \sa Q_CLEANUP_RESOURCE(), {The Qt Resource System} */ @@ -2213,7 +2213,7 @@ QStringList QDir::nameFiltersFromString(const QString &nameFilter) Example: - \snippet doc/src/snippets/code/src_corelib_io_qdir.cpp 15 + \snippet code/src_corelib_io_qdir.cpp 15 \sa Q_INIT_RESOURCE(), {The Qt Resource System} */ diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp index 56912e8..f2a259b 100644 --- a/src/corelib/io/qdiriterator.cpp +++ b/src/corelib/io/qdiriterator.cpp @@ -55,7 +55,7 @@ argument. After construction, the iterator is located before the first directory entry. Here's how to iterate over all the entries sequentially: - \snippet doc/src/snippets/code/src_corelib_io_qdiriterator.cpp 0 + \snippet code/src_corelib_io_qdiriterator.cpp 0 The next() function returns the path to the next directory entry and advances the iterator. You can also call filePath() to get the current diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 120c5a8..b3e3bdd 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -170,7 +170,7 @@ QAbstractFileEngine *QFilePrivate::engine() const The following example reads a text file line by line: - \snippet doc/src/snippets/file/file.cpp 0 + \snippet file/file.cpp 0 The QIODevice::Text flag passed to open() tells Qt to convert Windows-style line terminators ("\\r\\n") into C++-style @@ -182,7 +182,7 @@ QAbstractFileEngine *QFilePrivate::engine() const The next example uses QTextStream to read a text file line by line: - \snippet doc/src/snippets/file/file.cpp 1 + \snippet file/file.cpp 1 QTextStream takes care of converting the 8-bit data stored on disk into a 16-bit Unicode QString. By default, it assumes that @@ -194,7 +194,7 @@ QAbstractFileEngine *QFilePrivate::engine() const take a QTextStream on the left and various data types (including QString) on the right: - \snippet doc/src/snippets/file/file.cpp 2 + \snippet file/file.cpp 2 QDataStream is similar, in that you can use operator<<() to write data and operator>>() to read it back. See the class @@ -217,7 +217,7 @@ QAbstractFileEngine *QFilePrivate::engine() const read() or readLine() repeatedly until no more data can be read. The next example uses QTextStream to read \c /proc/modules line by line: - \snippet doc/src/snippets/file/file.cpp 3 + \snippet file/file.cpp 3 \section1 Signals @@ -325,7 +325,7 @@ QString QFile::fileName() const \e{at the time of the open()} call. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 0 + \snippet code/src_corelib_io_qfile.cpp 0 Note that the directory separator "/" works for all operating systems supported by Qt. @@ -363,7 +363,7 @@ QFile::setFileName(const QString &name) file names that the user chooses. File names hard-coded into the application should only use 7-bit ASCII filename characters. - \sa decodeName() setEncodingFunction() + \sa decodeName(), setEncodingFunction() */ QByteArray @@ -378,7 +378,7 @@ QFile::encodeName(const QString &fileName) This is a typedef for a pointer to a function with the following signature: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 1 + \snippet code/src_corelib_io_qfile.cpp 1 \sa setEncodingFunction(), encodeName() */ @@ -420,7 +420,7 @@ QFile::setEncodingFunction(EncoderFn f) This is a typedef for a pointer to a function with the following signature: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 2 + \snippet code/src_corelib_io_qfile.cpp 2 \sa setDecodingFunction() */ @@ -485,7 +485,7 @@ QFile::exists(const QString &fileName) This name may not represent an existing file; it is only a string. QFile::exists() returns true if the symlink points to an existing file. - \sa fileName() setFileName() + \sa fileName(), setFileName() */ /*! @@ -896,7 +896,7 @@ bool QFile::open(OpenMode mode) Returns true if successful; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 3 + \snippet code/src_corelib_io_qfile.cpp 3 When a QFile is opened using this function, behaviour of close() is controlled by the AutoCloseHandle flag. @@ -930,7 +930,7 @@ bool QFile::open(OpenMode mode) stdin, stdout and stderr streams at the console. To do this, add the following declaration to your application's project file: - \snippet doc/src/snippets/code/src_corelib_io_qfile.cpp 4 + \snippet code/src_corelib_io_qfile.cpp 4 */ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags) { diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 1805e75..1dcde04 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -244,14 +244,14 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) transparently; similarly, opening a symlink using QFile effectively opens the link's target. For example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 0 + \snippet code/src_corelib_io_qfileinfo.cpp 0 On Windows, symlinks (shortcuts) are \c .lnk files. The reported size() is that of the symlink (not the link's target), and opening a symlink using QFile opens the \c .lnk file. For example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 1 + \snippet code/src_corelib_io_qfileinfo.cpp 1 Elements of the file's name can be extracted with path() and fileName(). The fileName()'s parts can be extracted with @@ -442,7 +442,7 @@ QFileInfo &QFileInfo::operator=(const QFileInfo &fileinfo) path relative to the current directory. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 2 + \snippet code/src_corelib_io_qfileinfo.cpp 2 \sa isRelative(), QDir::setCurrent(), QDir::isRelativePath() */ @@ -496,7 +496,7 @@ void QFileInfo::setFile(const QDir &dir, const QString &file) QFileInfo will uppercase drive letters. Note that QDir does not do this. The code snippet below shows this. - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp newstuff + \snippet code/src_corelib_io_qfileinfo.cpp newstuff This function returns the same as filePath(), unless isRelative() is true. In contrast to canonicalFilePath(), symbolic links or @@ -688,7 +688,7 @@ QString QFileInfo::filePath() const Returns the name of the file, excluding the path. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 3 + \snippet code/src_corelib_io_qfileinfo.cpp 3 Note that, if this QFileInfo object is given a path ending in a slash, the name of the file is considered empty. @@ -711,7 +711,7 @@ QString QFileInfo::fileName() const path isBundle(). On all other platforms an empty QString is returned. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 4 + \snippet code/src_corelib_io_qfileinfo.cpp 4 \sa isBundle(), filePath(), baseName(), extension() */ @@ -730,7 +730,7 @@ QString QFileInfo::bundleName() const not including) the \e first '.' character. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 5 + \snippet code/src_corelib_io_qfileinfo.cpp 5 The base name of a file is computed equally on all platforms, independent @@ -754,7 +754,7 @@ QString QFileInfo::baseName() const to (but not including) the \e last '.' character. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 6 + \snippet code/src_corelib_io_qfileinfo.cpp 6 \sa fileName(), suffix(), completeSuffix(), baseName() */ @@ -773,7 +773,7 @@ QString QFileInfo::completeBaseName() const (but not including) the first '.'. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 7 + \snippet code/src_corelib_io_qfileinfo.cpp 7 \sa fileName(), suffix(), baseName(), completeBaseName() */ @@ -792,7 +792,7 @@ QString QFileInfo::completeSuffix() const including) the last '.'. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 8 + \snippet code/src_corelib_io_qfileinfo.cpp 8 The suffix of a file is computed equally on all platforms, independent of file naming conventions (e.g., ".bashrc" on Unix has an empty base name, @@ -818,12 +818,12 @@ QString QFileInfo::suffix() const For each of the following, dir() returns a QDir for \c{"~/examples/191697"}. - \snippet doc/src/snippets/fileinfo/main.cpp 0 + \snippet fileinfo/main.cpp 0 For each of the following, dir() returns a QDir for \c{"."}. - \snippet doc/src/snippets/fileinfo/main.cpp 1 + \snippet fileinfo/main.cpp 1 \sa absolutePath(), filePath(), fileName(), isRelative(), absoluteDir() */ @@ -1010,7 +1010,7 @@ bool QFileInfo::isBundle() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 9 + \snippet code/src_corelib_io_qfileinfo.cpp 9 \note If the symlink points to a non existing file, exists() returns false. @@ -1172,7 +1172,7 @@ uint QFileInfo::groupId() const always returns true. Example: - \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp 10 + \snippet code/src_corelib_io_qfileinfo.cpp 10 \sa isReadable(), isWritable(), isExecutable() */ @@ -1243,7 +1243,7 @@ qint64 QFileInfo::size() const If neither creation time nor "last status change" time are not available, returns the same as lastModified(). - \sa lastModified() lastRead() + \sa lastModified(), lastRead() */ QDateTime QFileInfo::created() const { @@ -1261,7 +1261,7 @@ QDateTime QFileInfo::created() const /*! Returns the date and time when the file was last modified. - \sa created() lastRead() + \sa created(), lastRead() */ QDateTime QFileInfo::lastModified() const { @@ -1282,7 +1282,7 @@ QDateTime QFileInfo::lastModified() const On platforms where this information is not available, returns the same as lastModified(). - \sa created() lastModified() + \sa created(), lastModified() */ QDateTime QFileInfo::lastRead() const { diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 1cdfc61..3c2da7f 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -215,7 +215,7 @@ QIODevicePrivate::~QIODevicePrivate() Calling these functions from the main, GUI thread, may cause your user interface to freeze. Example: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 0 + \snippet code/src_corelib_io_qiodevice.cpp 0 By subclassing QIODevice, you can provide the same interface to your own I/O devices. Subclasses of QIODevice are only required to @@ -239,7 +239,7 @@ QIODevicePrivate::~QIODevicePrivate() subclassing QIODevice, remember to bypass any buffer you may use when the device is open in Unbuffered mode. - \sa QBuffer QFile QTcpSocket + \sa QBuffer, QFile, QTcpSocket */ /*! @@ -257,9 +257,9 @@ QIODevicePrivate::~QIODevicePrivate() \value Truncate If possible, the device is truncated before it is opened. All earlier contents of the device are lost. \value Text When reading, the end-of-line terminators are - translated to '\n'. When writing, the end-of-line + translated to '\\n'. When writing, the end-of-line terminators are translated to the local encoding, for - example '\r\n' for Win32. + example '\\r\\n' for Win32. \value Unbuffered Any buffer in the device is bypassed. Certain flags, such as \c Unbuffered and \c Truncate, are @@ -431,7 +431,7 @@ QIODevice::OpenMode QIODevice::openMode() const function to set the open mode if the flags change after the device has been opened. - \sa openMode() OpenMode + \sa openMode(), OpenMode */ void QIODevice::setOpenMode(OpenMode openMode) { @@ -484,7 +484,7 @@ bool QIODevice::isTextModeEnabled() const default, this function returns false if openMode() returns \c NotOpen. - \sa openMode() OpenMode + \sa openMode(), OpenMode */ bool QIODevice::isOpen() const { @@ -498,7 +498,7 @@ bool QIODevice::isOpen() const This is a convenience function which checks if the OpenMode of the device contains the ReadOnly flag. - \sa openMode() OpenMode + \sa openMode(), OpenMode */ bool QIODevice::isReadable() const { @@ -512,7 +512,7 @@ bool QIODevice::isReadable() const This is a convenience function which checks if the OpenMode of the device contains the WriteOnly flag. - \sa openMode() OpenMode + \sa openMode(), OpenMode */ bool QIODevice::isWritable() const { @@ -524,7 +524,7 @@ bool QIODevice::isWritable() const otherwise returns false. This function should be called from any reimplementations of open() or other functions that open the device. - \sa openMode() OpenMode + \sa openMode(), OpenMode */ bool QIODevice::open(OpenMode mode) { @@ -544,7 +544,7 @@ bool QIODevice::open(OpenMode mode) First emits aboutToClose(), then closes the device and sets its OpenMode to NotOpen. The error string is also reset. - \sa setOpenMode() OpenMode + \sa setOpenMode(), OpenMode */ void QIODevice::close() { @@ -704,7 +704,7 @@ bool QIODevice::reset() Subclasses that reimplement this function must call the base implementation in order to include the size of QIODevices' buffer. Example: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 1 + \snippet code/src_corelib_io_qiodevice.cpp 1 \sa bytesToWrite(), readyRead(), isSequential() */ @@ -745,7 +745,7 @@ qint64 QIODevice::bytesToWrite() const function returns -1 in those cases (that is, reading on a closed socket or after a process has died). - \sa readData() readLine() write() + \sa readData(), readLine(), write() */ qint64 QIODevice::read(char *data, qint64 maxSize) { @@ -1032,13 +1032,13 @@ QByteArray QIODevice::readAll() occurs, this function returns the length of what could be read, or -1 if nothing was read. - A terminating '\0' byte is always appended to \a data, so \a + A terminating '\\0' byte is always appended to \a data, so \a maxSize must be larger than 1. Data is read until either of the following conditions are met: \list - \li The first '\n' character is read. + \li The first '\\n' character is read. \li \a maxSize - 1 bytes are read. \li The end of the device data is detected. \endlist @@ -1046,12 +1046,12 @@ QByteArray QIODevice::readAll() For example, the following code reads a line of characters from a file: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 2 + \snippet code/src_corelib_io_qiodevice.cpp 2 - The newline character ('\n') is included in the buffer. If a + The newline character ('\\n') is included in the buffer. If a newline is not encountered before maxSize - 1 bytes are read, a newline will not be inserted into the buffer. On windows newline - characters are replaced with '\n'. + characters are replaced with '\\n'. This function calls readLineData(), which is implemented using repeated calls to getChar(). You can provide a more efficient @@ -1208,7 +1208,7 @@ QByteArray QIODevice::readLine(qint64 maxSize) implementation, using getChar(). Buffered devices can improve the performance of readLine() by reimplementing this function. - readLine() appends a '\0' byte to \a data; readLineData() does not + readLine() appends a '\\0' byte to \a data; readLineData() does not need to do this. If you reimplement this function, be careful to return the correct @@ -1258,7 +1258,7 @@ qint64 QIODevice::readLineData(char *data, qint64 maxSize) Subclasses that reimplement this function must call the base implementation in order to include the contents of the QIODevice's buffer. Example: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 3 + \snippet code/src_corelib_io_qiodevice.cpp 3 \sa readyRead(), readLine() */ @@ -1272,7 +1272,7 @@ bool QIODevice::canReadLine() const device. Returns the number of bytes that were actually written, or -1 if an error occurred. - \sa read() writeData() + \sa read(), writeData() */ qint64 QIODevice::write(const char *data, qint64 maxSize) { @@ -1362,7 +1362,7 @@ qint64 QIODevice::write(const char *data, qint64 maxSize) ... \endcode - \sa read() writeData() + \sa read(), writeData() */ qint64 QIODevice::write(const char *data) { @@ -1376,7 +1376,7 @@ qint64 QIODevice::write(const char *data) Writes the content of \a byteArray to the device. Returns the number of bytes that were actually written, or -1 if an error occurred. - \sa read() writeData() + \sa read(), writeData() */ /*! @@ -1407,7 +1407,7 @@ void QIODevice::ungetChar(char c) Writes the character \a c to the device. Returns true on success; otherwise returns false. - \sa write() getChar() ungetChar() + \sa write(), getChar(), ungetChar() */ bool QIODevice::putChar(char c) { @@ -1457,7 +1457,7 @@ QByteArray QIODevicePrivate::peek(qint64 maxSize) is 0, the character is discarded. Returns true on success; otherwise returns false. - \sa read() putChar() ungetChar() + \sa read(), putChar(), ungetChar() */ bool QIODevice::getChar(char *c) { @@ -1479,7 +1479,7 @@ bool QIODevice::getChar(char *c) Example: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 4 + \snippet code/src_corelib_io_qiodevice.cpp 4 \sa read() */ @@ -1497,7 +1497,7 @@ qint64 QIODevice::peek(char *data, qint64 maxSize) Example: - \snippet doc/src/snippets/code/src_corelib_io_qiodevice.cpp 5 + \snippet code/src_corelib_io_qiodevice.cpp 5 This function has no way of reporting errors; returning an empty QByteArray() can mean either that no data was currently available @@ -1620,7 +1620,7 @@ QString QIODevice::errorString() const all the requested information was read and therefore does not retry reading if there was a problem. - \sa read() readLine() writeData() + \sa read(), readLine(), writeData() */ /*! @@ -1638,7 +1638,7 @@ QString QIODevice::errorString() const all the information was written and therefore does not retry writing if there was a problem. - \sa read() write() + \sa read(), write() */ diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index f3680de..b75c9c1 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -451,10 +451,10 @@ void QProcessPrivate::Channel::clear() containing "-style" and "motif" as two items in the list of arguments: - \snippet doc/src/snippets/qprocess/qprocess-simpleexecution.cpp 0 + \snippet qprocess/qprocess-simpleexecution.cpp 0 \dots - \snippet doc/src/snippets/qprocess/qprocess-simpleexecution.cpp 1 - \snippet doc/src/snippets/qprocess/qprocess-simpleexecution.cpp 2 + \snippet qprocess/qprocess-simpleexecution.cpp 1 + \snippet qprocess/qprocess-simpleexecution.cpp 2 QProcess then enters the \l Starting state, and when the program has started, QProcess enters the \l Running state and emits @@ -550,7 +550,7 @@ void QProcessPrivate::Channel::clear() The following example runs \c gzip to compress the string "Qt rocks!", without an event loop: - \snippet doc/src/snippets/process/process.cpp 0 + \snippet process/process.cpp 0 \section1 Notes for Windows Users @@ -1184,7 +1184,7 @@ QProcess::ProcessChannelMode QProcess::processChannelMode() const error channels to the \a mode specified. This mode will be used the next time start() is called. For example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 0 + \snippet code/src_corelib_io_qprocess.cpp 0 \sa processChannelMode(), ProcessChannelMode, setReadChannel() */ @@ -1261,7 +1261,7 @@ void QProcess::closeReadChannel(ProcessChannel channel) Unix and Windows. But it will not display the text data until QProcess's write channel has been closed. Example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 1 + \snippet code/src_corelib_io_qprocess.cpp 1 The write channel is implicitly opened when start() is called. @@ -1363,10 +1363,10 @@ void QProcess::setStandardErrorFile(const QString &fileName, OpenMode mode) destination process' standard input. The following shell command: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 2 + \snippet code/src_corelib_io_qprocess.cpp 2 Can be accomplished with QProcesses with the following code: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 3 + \snippet code/src_corelib_io_qprocess.cpp 3 */ void QProcess::setStandardOutputProcess(QProcess *destination) { @@ -1567,7 +1567,7 @@ QProcess::ProcessState QProcess::state() const For example, the following code adds the \c{C:\\BIN} directory to the list of executable paths (\c{PATHS}) on Windows: - \snippet doc/src/snippets/qprocess-environment/main.cpp 0 + \snippet qprocess-environment/main.cpp 0 \note This function is less efficient than the setProcessEnvironment() function. @@ -1605,7 +1605,7 @@ QStringList QProcess::environment() const For example, the following code adds the \c{C:\\BIN} directory to the list of executable paths (\c{PATHS}) on Windows and sets \c{TMPDIR}: - \snippet doc/src/snippets/qprocess-environment/main.cpp 1 + \snippet qprocess-environment/main.cpp 1 Note how, on Windows, environment variable names are case-insensitive. @@ -1755,7 +1755,7 @@ void QProcess::setProcessState(ProcessState state) \e execve()). Reimplement this function to do last minute initialization of the child process. Example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 4 + \snippet code/src_corelib_io_qprocess.cpp 4 You cannot exit the process (by calling exit(), for instance) from this function. If you need to stop the program before it starts @@ -2002,12 +2002,12 @@ static QStringList parseCombinedArgString(const QString &program) program name and its arguments. The arguments are separated by one or more spaces. For example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 5 + \snippet code/src_corelib_io_qprocess.cpp 5 The \a program string can also contain quotes, to ensure that arguments containing spaces are correctly supplied to the new process. For example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 6 + \snippet code/src_corelib_io_qprocess.cpp 6 If the QProcess object is already running a process, a warning may be printed at the console, and the existing process will continue running. @@ -2017,7 +2017,7 @@ static QStringList parseCombinedArgString(const QString &program) way to ensure that \c{"My Documents"} is used as the argument to the \c dir executable: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 7 + \snippet code/src_corelib_io_qprocess.cpp 7 The OpenMode is set to \a mode. */ @@ -2235,7 +2235,7 @@ QT_END_INCLUDE_NAMESPACE Returns the environment of the calling process as a list of key=value pairs. Example: - \snippet doc/src/snippets/code/src_corelib_io_qprocess.cpp 8 + \snippet code/src_corelib_io_qprocess.cpp 8 This function does not cache the system environment. Therefore, it's possible to obtain an updated version of the environment if low-level C diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 4a0211c..0937e1e 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -584,7 +584,7 @@ QResource::addSearchPath(const QString &path) Returns the current search path list. This list is consulted when creating a relative resource. - \sa QDir::addSearchPath() QDir::setSearchPaths() + \sa QDir::addSearchPath(), QDir::setSearchPaths() */ QStringList diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 8a6eef0..33c1d43 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2028,7 +2028,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, company is called MySoft, you would construct the QSettings object as follows: - \snippet doc/src/snippets/settings/settings.cpp 0 + \snippet settings/settings.cpp 0 QSettings objects can be created either on the stack or on the heap (i.e. using \c new). Constructing and destroying a @@ -2040,11 +2040,11 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, QCoreApplication::setApplicationName(), and then use the default QSettings constructor: - \snippet doc/src/snippets/settings/settings.cpp 1 - \snippet doc/src/snippets/settings/settings.cpp 2 - \snippet doc/src/snippets/settings/settings.cpp 3 + \snippet settings/settings.cpp 1 + \snippet settings/settings.cpp 2 + \snippet settings/settings.cpp 3 \dots - \snippet doc/src/snippets/settings/settings.cpp 4 + \snippet settings/settings.cpp 4 (Here, we also specify the organization's Internet domain. When the Internet domain is set, it is used on Mac OS X instead of the @@ -2058,7 +2058,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, that stores the data associated with the key. To write a setting, use setValue(). For example: - \snippet doc/src/snippets/settings/settings.cpp 5 + \snippet settings/settings.cpp 5 If there already exists a setting with the same key, the existing value is overwritten by the new value. For efficiency, the @@ -2067,14 +2067,14 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, You can get a setting's value back using value(): - \snippet doc/src/snippets/settings/settings.cpp 6 + \snippet settings/settings.cpp 6 If there is no setting with the specified name, QSettings returns a null QVariant (which can be converted to the integer 0). You can specify another default value by passing a second argument to value(): - \snippet doc/src/snippets/settings/settings.cpp 7 + \snippet settings/settings.cpp 7 To test whether a given key exists, call contains(). To remove the setting associated with a key, call remove(). To obtain the @@ -2091,13 +2091,13 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Instead, you can use the QVariant::value() or the qVariantValue() template function. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 0 + \snippet code/src_corelib_io_qsettings.cpp 0 The inverse conversion (e.g., from QColor to QVariant) is automatic for all data types supported by QVariant, including GUI-related types: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 1 + \snippet code/src_corelib_io_qsettings.cpp 1 Custom types registered using qRegisterMetaType() and qRegisterMetaTypeStreamOperators() can be stored using QSettings. @@ -2127,18 +2127,18 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, You can form hierarchical keys using the '/' character as a separator, similar to Unix file paths. For example: - \snippet doc/src/snippets/settings/settings.cpp 8 - \snippet doc/src/snippets/settings/settings.cpp 9 - \snippet doc/src/snippets/settings/settings.cpp 10 + \snippet settings/settings.cpp 8 + \snippet settings/settings.cpp 9 + \snippet settings/settings.cpp 10 If you want to save or restore many settings with the same prefix, you can specify the prefix using beginGroup() and call endGroup() at the end. Here's the same example again, but this time using the group mechanism: - \snippet doc/src/snippets/settings/settings.cpp 11 + \snippet settings/settings.cpp 11 \codeline - \snippet doc/src/snippets/settings/settings.cpp 12 + \snippet settings/settings.cpp 12 If a group is set using beginGroup(), the behavior of most functions changes consequently. Groups can be set recursively. @@ -2178,8 +2178,8 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Let's see with an example: - \snippet doc/src/snippets/settings/settings.cpp 13 - \snippet doc/src/snippets/settings/settings.cpp 14 + \snippet settings/settings.cpp 13 + \snippet settings/settings.cpp 14 The table below summarizes which QSettings objects access which location. "\b{X}" means that the location is the main @@ -2205,7 +2205,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, argument to the QSettings constructor, followed by the scope, the organization name, and the application name: - \snippet doc/src/snippets/settings/settings.cpp 15 + \snippet settings/settings.cpp 15 The \l{tools/settingseditor}{Settings Editor} example lets you experiment with different settings location and with fallbacks @@ -2217,9 +2217,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, application. The following example illustrates how to use QSettings to save and restore the geometry of an application's main window. - \snippet doc/src/snippets/settings/settings.cpp 16 + \snippet settings/settings.cpp 16 \codeline - \snippet doc/src/snippets/settings/settings.cpp 17 + \snippet settings/settings.cpp 17 See \l{Window Geometry} for a discussion on why it is better to call QWidget::resize() and QWidget::move() rather than QWidget::setGeometry() @@ -2229,12 +2229,12 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, called from the main window's constructor and close event handler as follows: - \snippet doc/src/snippets/settings/settings.cpp 18 + \snippet settings/settings.cpp 18 \dots - \snippet doc/src/snippets/settings/settings.cpp 19 - \snippet doc/src/snippets/settings/settings.cpp 20 + \snippet settings/settings.cpp 19 + \snippet settings/settings.cpp 20 \codeline - \snippet doc/src/snippets/settings/settings.cpp 21 + \snippet settings/settings.cpp 21 See the \l{mainwindows/application}{Application} example for a self-contained example that uses QSettings. @@ -2341,7 +2341,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, takes a file name as first argument and pass QSettings::IniFormat as second argument. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 2 + \snippet code/src_corelib_io_qsettings.cpp 2 You can then use the QSettings object to read and write settings in the file. @@ -2349,7 +2349,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, On Mac OS X, you can access XML-based \c .plist files by passing QSettings::NativeFormat as second argument. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 3 + \snippet code/src_corelib_io_qsettings.cpp 3 \section2 Accessing the Windows Registry Directly @@ -2360,13 +2360,13 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 4 + \snippet code/src_corelib_io_qsettings.cpp 4 All the registry entries that appear under the specified path can be read or written through the QSettings object as usual (using forward slashes instead of backslashes). For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 5 + \snippet code/src_corelib_io_qsettings.cpp 5 Note that the backslash character is, as mentioned, used by QSettings to separate subkeys. As a result, you cannot read or @@ -2380,7 +2380,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Its default value is accessed by using "Default" or "." in place of a subkey: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 6 + \snippet code/src_corelib_io_qsettings.cpp 6 On other platforms than Windows, "Default" and "." would be treated as regular subkeys. @@ -2421,7 +2421,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Another solution is to use preprocessor directives, for example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 7 + \snippet code/src_corelib_io_qsettings.cpp 7 \li On Unix and Mac OS X systems, the advisory file locking is disabled if NFS (or AutoFS or CacheFS) is detected to work around a bug in the @@ -2487,7 +2487,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, (e.g., QPoint, QRect, and QSize), Qt uses an \c{@}-based syntax to encode the type. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 8 + \snippet code/src_corelib_io_qsettings.cpp 8 To minimize compatibility issues, any \c @ that doesn't appear at the first position in the value or that isn't @@ -2498,7 +2498,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, Windows applications don't escape backslashes (\c{\}) in file paths: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 9 + \snippet code/src_corelib_io_qsettings.cpp 9 QSettings always treats backslash as a special character and provides no API for reading or writing such entries. @@ -2547,7 +2547,7 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, organization, and with parent \a parent. Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 10 + \snippet code/src_corelib_io_qsettings.cpp 10 The scope is set to QSettings::UserScope, and the format is set to QSettings::NativeFormat (i.e. calling setDefaultFormat() @@ -2659,11 +2659,11 @@ QSettings::QSettings(const QString &fileName, Format format, QObject *parent) The code - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 11 + \snippet code/src_corelib_io_qsettings.cpp 11 is equivalent to - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 12 + \snippet code/src_corelib_io_qsettings.cpp 12 If QCoreApplication::setOrganizationName() and QCoreApplication::setApplicationName() has not been previously @@ -2926,7 +2926,7 @@ QSettings::Status QSettings::status() const Groups are useful to avoid typing in the same setting paths over and over. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 13 + \snippet code/src_corelib_io_qsettings.cpp 13 This will set the value of three settings: @@ -2953,7 +2953,7 @@ void QSettings::beginGroup(const QString &prefix) Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 14 + \snippet code/src_corelib_io_qsettings.cpp 14 \sa beginGroup(), group() */ @@ -2991,7 +2991,7 @@ QString QSettings::group() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 15 + \snippet code/src_corelib_io_qsettings.cpp 15 Use beginWriteArray() to write the array in the first place. @@ -3014,7 +3014,7 @@ int QSettings::beginReadArray(const QString &prefix) that you want to save a variable-length list of user names and passwords. You could then write: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 16 + \snippet code/src_corelib_io_qsettings.cpp 16 The generated keys will have the form @@ -3099,12 +3099,12 @@ void QSettings::setArrayIndex(int i) Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 17 + \snippet code/src_corelib_io_qsettings.cpp 17 If a group is set using beginGroup(), only the keys in the group are returned, without the group prefix: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 18 + \snippet code/src_corelib_io_qsettings.cpp 18 \sa childGroups(), childKeys() */ @@ -3120,12 +3120,12 @@ QStringList QSettings::allKeys() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 19 + \snippet code/src_corelib_io_qsettings.cpp 19 If a group is set using beginGroup(), the top-level keys in that group are returned, without the group prefix: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 20 + \snippet code/src_corelib_io_qsettings.cpp 20 You can navigate through the entire setting hierarchy using childKeys() and childGroups() recursively. @@ -3144,12 +3144,12 @@ QStringList QSettings::childKeys() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 21 + \snippet code/src_corelib_io_qsettings.cpp 21 If a group is set using beginGroup(), the first-level keys in that group are returned, without the group prefix. - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 22 + \snippet code/src_corelib_io_qsettings.cpp 22 You can navigate through the entire setting hierarchy using childKeys() and childGroups() recursively. @@ -3192,7 +3192,7 @@ bool QSettings::isWritable() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 23 + \snippet code/src_corelib_io_qsettings.cpp 23 \sa value(), remove(), contains() */ @@ -3209,7 +3209,7 @@ void QSettings::setValue(const QString &key, const QVariant &value) Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 24 + \snippet code/src_corelib_io_qsettings.cpp 24 Be aware that if one of the fallback locations contains a setting with the same key, that setting will be visible after calling @@ -3218,7 +3218,7 @@ void QSettings::setValue(const QString &key, const QVariant &value) If \a key is an empty string, all keys in the current group() are removed. For example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 25 + \snippet code/src_corelib_io_qsettings.cpp 25 Note that the Windows registry and INI files use case-insensitive keys, whereas the Carbon Preferences API on Mac OS X uses @@ -3324,7 +3324,7 @@ bool QSettings::event(QEvent *event) Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 26 + \snippet code/src_corelib_io_qsettings.cpp 26 \sa setValue(), contains(), remove() */ @@ -3457,7 +3457,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) Typedef for a pointer to a function with the following signature: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 27 + \snippet code/src_corelib_io_qsettings.cpp 27 \c ReadFunc is used in \c registerFormat() as a pointer to a function that reads a set of key/value pairs. \c ReadFunc should read all the @@ -3472,7 +3472,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) Typedef for a pointer to a function with the following signature: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 28 + \snippet code/src_corelib_io_qsettings.cpp 28 \c WriteFunc is used in \c registerFormat() as a pointer to a function that writes a set of key/value pairs. \c WriteFunc is only called once, @@ -3508,7 +3508,7 @@ void QSettings::setPath(Format format, Scope scope, const QString &path) Example: - \snippet doc/src/snippets/code/src_corelib_io_qsettings.cpp 29 + \snippet code/src_corelib_io_qsettings.cpp 29 \sa setPath() */ diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index c6103b3..700b80b 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE \value DownloadLocation Returns a directory for user's downloaded files. - \sa writableLocation() standardLocations() displayName() locate() locateAll() + \sa writableLocation(), standardLocations(), displayName(), locate(), locateAll() */ /*! diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index 579d569..1abc257 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -171,7 +171,7 @@ void QTemporaryDirPrivate::create(const QString &templateName) Example: - \snippet doc/src/snippets/code/src_corelib_io_qtemporarydir.cpp 0 + \snippet code/src_corelib_io_qtemporarydir.cpp 0 It is very important to test that the temporary directory could be created, using isValid(). Do not use exists(), since a default-constructed diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 75681da..cb8b5db 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -466,7 +466,7 @@ static QString defaultTemplateName() Example: - \snippet doc/src/snippets/code/src_corelib_io_qtemporaryfile.cpp 0 + \snippet code/src_corelib_io_qtemporaryfile.cpp 0 Reopening a QTemporaryFile after calling close() is safe. For as long as the QTemporaryFile object itself is not destroyed, the unique temporary diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 0411b46..73ffdfe 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -58,13 +58,13 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; generating text, QTextStream supports formatting options for field padding and alignment, and formatting of numbers. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 0 + \snippet code/src_corelib_io_qtextstream.cpp 0 It's also common to use QTextStream to read console input and write console output. QTextStream is locale aware, and will automatically decode standard input using the correct codec. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 + \snippet code/src_corelib_io_qtextstream.cpp 1 Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or @@ -117,7 +117,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; the integer base, thereby disabling the automatic detection, by calling setIntegerBase(). Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 2 + \snippet code/src_corelib_io_qtextstream.cpp 2 QTextStream supports many formatting options for generating text. You can set the field width and pad character by calling @@ -154,7 +154,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \row \li \c left \li Same as setFieldAlignment(AlignLeft). \row \li \c right \li Same as setFieldAlignment(AlignRight). \row \li \c center \li Same as setFieldAlignment(AlignCenter). - \row \li \c endl \li Same as operator<<('\n') and flush(). + \row \li \c endl \li Same as operator<<('\\n') and flush(). \row \li \c flush \li Same as flush(). \row \li \c reset \li Same as reset(). \row \li \c ws \li Same as skipWhiteSpace(). @@ -1081,7 +1081,7 @@ QTextStream::QTextStream(QByteArray *array, QIODevice::OpenMode openMode) This constructor is convenient for working on constant strings. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 3 + \snippet code/src_corelib_io_qtextstream.cpp 3 */ QTextStream::QTextStream(const QByteArray &array, QIODevice::OpenMode openMode) : d_ptr(new QTextStreamPrivate(this)) @@ -1111,7 +1111,7 @@ QTextStream::QTextStream(const QByteArray &array, QIODevice::OpenMode openMode) This constructor is useful for working directly with the common FILE based input and output streams: stdin, stdout and stderr. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 4 + \snippet code/src_corelib_io_qtextstream.cpp 4 */ QTextStream::QTextStream(FILE *fileHandle, QIODevice::OpenMode openMode) @@ -1404,11 +1404,11 @@ QTextStream::FieldAlignment QTextStream::fieldAlignment() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 5 + \snippet code/src_corelib_io_qtextstream.cpp 5 The string \c s contains: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 6 + \snippet code/src_corelib_io_qtextstream.cpp 6 \sa padChar(), setFieldWidth() */ @@ -1601,7 +1601,7 @@ void QTextStream::resetStatus() Subsequent calls to setStatus() are ignored until resetStatus() is called. - \sa Status status() resetStatus() + \sa Status, status(), resetStatus() */ void QTextStream::setStatus(Status status) { @@ -2023,7 +2023,7 @@ bool QTextStreamPrivate::getReal(double *f) reference to the QTextStream, so several operators can be nested. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 7 + \snippet code/src_corelib_io_qtextstream.cpp 7 Whitespace is \e not skipped. */ @@ -2241,8 +2241,8 @@ QTextStream &QTextStream::operator>>(QByteArray &array) /*! \overload - Stores the word in \a c, terminated by a '\0' character. If no word is - available, only the '\0' character is stored. + Stores the word in \a c, terminated by a '\\0' character. If no word is + available, only the '\\0' character is stored. Warning: Although convenient, this operator is dangerous and must be used with care. QTextStream assumes that \a c points to a @@ -2561,11 +2561,11 @@ QTextStream &QTextStream::operator<<(const QByteArray &array) string is assumed to be in ISO-8859-1 encoding. This operator is convenient when working with constant string data. Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 8 + \snippet code/src_corelib_io_qtextstream.cpp 8 Warning: QTextStream assumes that \a string points to a string of - text, terminated by a '\0' character. If there is no terminating - '\0' character, your application may crash. + text, terminated by a '\\0' character. If there is no terminating + '\\0' character, your application may crash. */ QTextStream &QTextStream::operator<<(const char *string) { @@ -2865,13 +2865,13 @@ QTextStream ¢er(QTextStream &stream) /*! \relates QTextStream - Writes '\n' to the \a stream and flushes the stream. + Writes '\\n' to the \a stream and flushes the stream. Equivalent to - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 9 + \snippet code/src_corelib_io_qtextstream.cpp 9 - Note: On Windows, all '\n' characters are written as '\r\n' if + Note: On Windows, all '\\n' characters are written as '\\r\\n' if QTextStream's device or string is opened using the QIODevice::Text flag. \sa flush(), reset(), {QTextStream manipulators} @@ -2993,7 +2993,7 @@ void QTextStream::setCodec(QTextCodec *codec) Example: - \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 10 + \snippet code/src_corelib_io_qtextstream.cpp 10 \sa QTextCodec::codecForName(), setLocale() */ diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index fbc8d76..b6667d6 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -64,7 +64,7 @@ unencoded representation is suitable for showing to users, but the encoded representation is typically what you would send to a web server. For example, the unencoded URL - "http://b\uuml\c{}hler.example.com" would be sent to the server as + "http://b\\uuml\c{}hler.example.com" would be sent to the server as "http://xn--bhler-kva.example.com/List%20of%20applicants.xml". A URL can also be constructed piece by piece by calling @@ -155,7 +155,7 @@ */ /*! - \enum QUrl::FormattingOption + \enum QUrl::FormattingOptions The formatting options define how the URL is formatted when written out as text. @@ -1400,11 +1400,11 @@ const QByteArray &QUrlPrivate::normalized() const Example: - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 0 + \snippet code/src_corelib_io_qurl.cpp 0 To construct a URL from an encoded string, call fromEncoded(): - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 1 + \snippet code/src_corelib_io_qurl.cpp 1 \sa setUrl(), setEncodedUrl(), fromEncoded(), TolerantMode */ @@ -1445,7 +1445,7 @@ QUrl::~QUrl() must conform to the standard encoding rules of the URI standard for the URL to be reported as valid. - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 2 + \snippet code/src_corelib_io_qurl.cpp 2 */ bool QUrl::isValid() const { @@ -1501,7 +1501,7 @@ void QUrl::setUrl(const QString &url, ParsingMode parsingMode) and is followed by a ':'. The following example shows a URL where the scheme is "ftp": - \img qurl-authority2.png + \image qurl-authority2.png The scheme can also be empty, in which case the URL is interpreted as relative. @@ -1548,7 +1548,7 @@ QString QUrl::scheme() const The following example shows a valid authority string: - \img qurl-authority.png + \image qurl-authority.png */ void QUrl::setAuthority(const QString &authority) { @@ -1585,7 +1585,7 @@ QString QUrl::authority(ComponentFormattingOptions options) const separated by a ':'. If the password is empty, the colon must be omitted. The following example shows a valid user info string: - \img qurl-authority3.png + \image qurl-authority3.png \sa userInfo(), setUserName(), setPassword(), setAuthority() */ @@ -1746,7 +1746,7 @@ void QUrl::setPort(int port) Example: - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 3 + \snippet code/src_corelib_io_qurl.cpp 3 */ int QUrl::port(int defaultPort) const { @@ -1758,12 +1758,12 @@ int QUrl::port(int defaultPort) const Sets the path of the URL to \a path. The path is the part of the URL that comes after the authority but before the query string. - \img qurl-ftppath.png + \image qurl-ftppath.png For non-hierarchical schemes, the path will be everything following the scheme declaration, as in the following example: - \img qurl-mailtopath.png + \image qurl-mailtopath.png \sa path() */ @@ -1862,7 +1862,7 @@ QString QUrl::query(ComponentFormattingOptions options) const characters. It is typically used in HTTP for referring to a certain link or point on a page: - \img qurl-fragment.png + \image qurl-fragment.png The fragment is sometimes also referred to as the URL "reference". @@ -1938,7 +1938,7 @@ QString QUrl::topLevelDomain(ComponentFormattingOptions options) const the base URL, but with the merged path, as in the following example: - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 5 + \snippet code/src_corelib_io_qurl.cpp 5 Calling resolved() with ".." returns a QUrl whose directory is one level higher than the original. Similarly, calling resolved() @@ -2173,7 +2173,7 @@ QString QUrl::fromPercentEncoding(const QByteArray &input) Unreserved is defined as: ALPHA / DIGIT / "-" / "." / "_" / "~" - \snippet doc/src/snippets/code/src_corelib_io_qurl.cpp 6 + \snippet code/src_corelib_io_qurl.cpp 6 */ QByteArray QUrl::toPercentEncoding(const QString &input, const QByteArray &exclude, const QByteArray &include) { diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 3d9af90..dc53021 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -339,7 +339,7 @@ qint64 QPersistentModelIndex::internalId() const Returns the parent QModelIndex for this persistent index, or an invalid QModelIndex if it has no parent. - \sa child() sibling() model() + \sa child(), sibling(), model() */ QModelIndex QPersistentModelIndex::parent() const { @@ -352,7 +352,7 @@ QModelIndex QPersistentModelIndex::parent() const Returns the sibling at \a row and \a column or an invalid QModelIndex if there is no sibling at this position. - \sa parent() child() + \sa parent(), child() */ QModelIndex QPersistentModelIndex::sibling(int row, int column) const @@ -366,7 +366,7 @@ QModelIndex QPersistentModelIndex::sibling(int row, int column) const Returns the child of the model index that is stored in the given \a row and \a column. - \sa parent() sibling() + \sa parent(), sibling() */ QModelIndex QPersistentModelIndex::child(int row, int column) const @@ -906,7 +906,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Creates a new empty model index. This type of model index is used to indicate that the position in the model is invalid. - \sa isValid() QAbstractItemModel + \sa isValid(), QAbstractItemModel */ /*! @@ -1217,7 +1217,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Returns true if the column is inserted; otherwise returns false. - \sa insertColumns() insertRow() removeColumn() + \sa insertColumns(), insertRow(), removeColumn() */ /*! @@ -1230,7 +1230,7 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Returns true if the row is inserted; otherwise returns false. - \sa insertRows() insertColumn() removeRow() + \sa insertRows(), insertColumn(), removeRow() */ /*! @@ -1407,7 +1407,7 @@ QAbstractItemModel::~QAbstractItemModel() For example: - \snippet examples/itemviews/simpledommodel/dommodel.cpp 2 + \snippet itemviews/simpledommodel/dommodel.cpp 2 \note When implementing a table based model, columnCount() should return 0 when the parent is valid. @@ -1627,7 +1627,7 @@ bool QAbstractItemModel::hasIndex(int row, int column, const QModelIndex &parent Use rowCount() on the parent to find out the number of children. - \sa parent() index() + \sa parent(), index() */ bool QAbstractItemModel::hasChildren(const QModelIndex &parent) const { @@ -1696,7 +1696,7 @@ bool QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value Roles that are not in \a roles will not be modified. - \sa setData() data() itemData() + \sa setData(), data(), itemData() */ bool QAbstractItemModel::setItemData(const QModelIndex &index, const QMap &roles) { @@ -2195,6 +2195,7 @@ QSize QAbstractItemModel::span(const QModelIndex &) const } /*! + \fn void QAbstractItemModel::setRoleNames(const QHash &theRoleNames) \since 4.6 \obsolete @@ -2445,7 +2446,7 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare For example, as shown in the diagram, we insert three rows before row 2, so \a first is 2 and \a last is 4: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 0 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 0 This inserts the three new rows as rows 2, 3, and 4. \row @@ -2456,7 +2457,7 @@ bool QAbstractItemModel::decodeData(int row, int column, const QModelIndex &pare collection of 4 existing rows (ending in row 3), so \a first is 4 and \a last is 5: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 1 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 1 This appends the two new rows as rows 4 and 5. \endtable @@ -2511,7 +2512,7 @@ void QAbstractItemModel::endInsertRows() For example, as shown in the diagram, we remove the two rows from row 2 to row 3, so \a first is 2 and \a last is 3: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 2 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 2 \endtable \note This function emits the rowsAboutToBeRemoved() signal which connected @@ -2626,7 +2627,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star row 2 to 4 in the source, so \a sourceFirst is 2 and \a sourceLast is 4. We move those items to above row 2 in the destination, so \a destinationChild is 2. - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 6 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 6 This moves the three rows rows 2, 3, and 4 in the source to become 2, 3 and 4 in the destination. Other affected siblings are displaced accordingly. @@ -2637,7 +2638,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star For example, as shown in the diagram, we move three rows to a collection of 6 existing rows (ending in row 5), so \a destinationChild is 6: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 7 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 7 This moves the target rows to the end of the target parent as 6, 7 and 8. \row @@ -2647,7 +2648,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star For example, as shown in the diagram, we move one item from row 2 to row 0, so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 0. - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 8 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 8 Note that other rows may be displaced accordingly. Note also that when moving items within the same parent you should not attempt invalid or no-op moves. In @@ -2662,7 +2663,7 @@ bool QAbstractItemModelPrivate::allowMove(const QModelIndex &srcParent, int star For example, as shown in the diagram, we move one item from row 2 to row 4, so \a sourceFirst and \a sourceLast are 2 and \a destinationChild is 4. - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 9 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 9 Note that other rows may be displaced accordingly. \endtable @@ -2745,7 +2746,7 @@ void QAbstractItemModel::endMoveRows() For example, as shown in the diagram, we insert three columns before column 4, so \a first is 4 and \a last is 6: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 3 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 3 This inserts the three new columns as columns 4, 5, and 6. \row @@ -2756,7 +2757,7 @@ void QAbstractItemModel::endMoveRows() collection of six existing columns (ending in column 5), so \a first is 6 and \a last is 8: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 4 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 4 This appends the two new columns as columns 6, 7, and 8. \endtable @@ -2813,7 +2814,7 @@ void QAbstractItemModel::endInsertColumns() For example, as shown in the diagram, we remove the three columns from column 4 to column 6, so \a first is 4 and \a last is 6: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 5 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 5 \endtable \note This function emits the columnsAboutToBeRemoved() signal which @@ -2945,6 +2946,7 @@ void QAbstractItemModel::endMoveColumns() } /*! + \fn void QAbstractItemModel::reset() \obsolete Resets the model to its original state in any attached views. @@ -2958,11 +2960,11 @@ void QAbstractItemModel::endMoveColumns() For example, in this code both signals modelAboutToBeReset() and modelReset() are emitted \e after the data changes: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 10 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 10 Instead you should use: - \snippet doc/src/snippets/code/src_corelib_kernel_qabstractitemmodel.cpp 11 + \snippet code/src_corelib_kernel_qabstractitemmodel.cpp 11 */ /*! @@ -3208,7 +3210,7 @@ QModelIndex QAbstractTableModel::index(int row, int column, const QModelIndex &p Returns the parent of the model item with the given \a index. - \sa index() hasChildren() + \sa index(), hasChildren() */ QModelIndex QAbstractTableModel::parent(const QModelIndex &) const @@ -3334,7 +3336,7 @@ QModelIndex QAbstractListModel::index(int row, int column, const QModelIndex &pa /*! Returns the parent of the model item with the given \a index. - \sa index() hasChildren() + \sa index(), hasChildren() */ QModelIndex QAbstractListModel::parent(const QModelIndex & /* index */) const diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp index 9cac404..c7a5200 100644 --- a/src/corelib/itemmodels/qidentityproxymodel.cpp +++ b/src/corelib/itemmodels/qidentityproxymodel.cpp @@ -102,7 +102,7 @@ class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate This also provides a way to change the data in the case where a source model is supplied by a third party which can not be modified. - \snippet doc/src/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp 0 + \snippet code/src_gui_itemviews_qidentityproxymodel.cpp 0 \sa QAbstractProxyModel, {Model/View Programming}, QAbstractItemModel diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index fa34acd..9cc9502 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -347,13 +347,13 @@ QModelIndexList QItemSelectionRange::indexes() const a selection that contains a range of items from the given \c model, beginning at the \c topLeft, and ending at the \c bottomRight. - \snippet doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp 0 + \snippet code/src_gui_itemviews_qitemselectionmodel.cpp 0 An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way: - \snippet doc/src/snippets/code/src_gui_itemviews_qitemselectionmodel.cpp 1 + \snippet code/src_gui_itemviews_qitemselectionmodel.cpp 1 QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each @@ -1005,7 +1005,7 @@ void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel:: Note that this signal will not be emitted when the item model is reset. - \sa currentIndex() setCurrentIndex() selectionChanged() + \sa currentIndex(), setCurrentIndex(), selectionChanged() */ /*! @@ -1016,7 +1016,7 @@ void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel:: Note that this signal will not be emitted when the item model is reset. - \sa currentChanged() currentRowChanged() currentIndex() setCurrentIndex() + \sa currentChanged(), currentRowChanged(), currentIndex(), setCurrentIndex() */ /*! @@ -1027,7 +1027,7 @@ void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel:: Note that this signal will not be emitted when the item model is reset. - \sa currentChanged() currentColumnChanged() currentIndex() setCurrentIndex() + \sa currentChanged(), currentColumnChanged(), currentIndex(), setCurrentIndex() */ /*! @@ -1040,7 +1040,7 @@ void QItemSelectionModel::select(const QModelIndex &index, QItemSelectionModel:: Note the that the current index changes independently from the selection. Also note that this signal will not be emitted when the item model is reset. - \sa select() currentChanged() + \sa select(), currentChanged() */ /*! diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index ae9affb..68e5e89 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -1511,14 +1511,14 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( model. The code to set up the model and the view, \e without sorting and filtering, would look like this: - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 1 + \snippet qsortfilterproxymodel-details/main.cpp 1 To add sorting and filtering support to \c MyItemModel, we need to create a QSortFilterProxyModel, call setSourceModel() with the \c MyItemModel as argument, and install the QSortFilterProxyModel on the view: - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 0 - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 2 + \snippet qsortfilterproxymodel-details/main.cpp 0 + \snippet qsortfilterproxymodel-details/main.cpp 2 At this point, neither sorting nor filtering is enabled; the original data is displayed in the view. Any changes made through the @@ -1546,7 +1546,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( whether the user can sort the view by clicking the view's horizontal header. For example: - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 3 + \snippet qsortfilterproxymodel-details/main.cpp 3 When this feature is on (the default is off), clicking on a header section sorts the items according to that column. By clicking repeatedly, the user @@ -1569,7 +1569,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( QSortFilterProxyModel and reimplementing lessThan(), which is used to compare items. For example: - \snippet examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5 + \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 5 (This code snippet comes from the \l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model} @@ -1581,7 +1581,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( QSortFilterProxyModel (or on the original model if it implements sort()). For example: - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 4 + \snippet qsortfilterproxymodel-details/main.cpp 4 QSortFilterProxyModel can be sorted by column -1, in which case it returns to the sort order of the underlying source model. @@ -1594,7 +1594,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( each item, for a given column. The QRegExp object can be used to match a regular expression, a wildcard pattern, or a fixed string. For example: - \snippet doc/src/snippets/qsortfilterproxymodel-details/main.cpp 5 + \snippet qsortfilterproxymodel-details/main.cpp 5 For hierarchical models, the filter is applied recursively to all children. If a parent item doesn't match the filter, none of its children will be @@ -1612,7 +1612,7 @@ void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved( the \l{QSortFilterProxyModel::filterKeyColumn}{filterKeyColumn} property and performs filtering on columns 0, 1, and 2: - \snippet examples/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3 + \snippet itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp 3 (This code snippet comes from the \l{itemviews/customsortfiltermodel}{Custom Sort/Filter Model} diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index b13e825..e7f219f 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE An example usage of QStringListModel: - \snippet doc/src/snippets/qstringlistmodel/main.cpp 0 + \snippet qstringlistmodel/main.cpp 0 \sa QAbstractListModel, QAbstractItemModel, {Model Classes} */ diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp index 0884f10..e1ed53a 100644 --- a/src/corelib/json/qjsonarray.cpp +++ b/src/corelib/json/qjsonarray.cpp @@ -500,13 +500,13 @@ bool QJsonArray::operator!=(const QJsonArray &other) const \sa constBegin(), end() */ -/*! \fn void QJsonArray::push_back(const T &value) +/*! \fn void QJsonArray::push_back(const QJsonValue &value) This function is provided for STL compatibility. It is equivalent to \l{QJsonArray::append()}{append(\a value)}. */ -/*! \fn void QJsonArray::push_front(const T &value) +/*! \fn void QJsonArray::push_front(const QJsonValue &value) This function is provided for STL compatibility. It is equivalent to \l{QJsonArray::prepend()}{prepend(\a value)}. @@ -589,12 +589,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QJsonArray::begin() QJsonArray::end() -*/ - -/*! \fn QJsonArray::iterator::iterator(const iterator &other) - - Constructs a copy of \a other. + \sa QJsonArray::begin(), QJsonArray::end() */ /*! \fn QJsonValueRef QJsonArray::iterator::operator*() const @@ -791,7 +786,7 @@ bool QJsonArray::operator!=(const QJsonArray &other) const on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QJsonArray::constBegin() QJsonArray::constEnd() + \sa QJsonArray::constBegin(), QJsonArray::constEnd() */ /*! \typedef QJsonArray::const_iterator::iterator_category diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp index be241bc..ae59847 100644 --- a/src/corelib/json/qjsondocument.cpp +++ b/src/corelib/json/qjsondocument.cpp @@ -176,7 +176,7 @@ QJsonDocument &QJsonDocument::operator =(const QJsonDocument &other) Returns a QJsonDocument representing the data. - \sa rawData fromBinaryData isNull DataValidation + \sa rawData, fromBinaryData, isNull, DataValidation */ QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) { @@ -220,7 +220,7 @@ const char *QJsonDocument::rawData(int *size) const By default the data is validated. If the \a data is not valid, the method returns a null document. - \sa toBinaryData fromRawData isNull DataValidation + \sa toBinaryData, fromRawData, isNull, DataValidation */ QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) { @@ -361,7 +361,7 @@ QByteArray QJsonDocument::toBinaryData() const /*! Returns true if the document contains an array. - \sa array() isObject() + \sa array(), isObject() */ bool QJsonDocument::isArray() const { @@ -375,7 +375,7 @@ bool QJsonDocument::isArray() const /*! Returns true if the document contains an object. - \sa object() isArray() + \sa object(), isArray() */ bool QJsonDocument::isObject() const { @@ -392,7 +392,7 @@ bool QJsonDocument::isObject() const Returns an empty object if the document contains an array. - \sa isObject array setObject + \sa isObject, array, setObject */ QJsonObject QJsonDocument::object() const { @@ -410,7 +410,7 @@ QJsonObject QJsonDocument::object() const Returns an empty array if the document contains an object. - \sa isArray object setArray + \sa isArray, object, setArray */ QJsonArray QJsonDocument::array() const { @@ -425,7 +425,7 @@ QJsonArray QJsonDocument::array() const /*! Sets \a object as the main object of this document. - \sa setArray object + \sa setArray, object */ void QJsonDocument::setObject(const QJsonObject &object) { @@ -452,7 +452,7 @@ void QJsonDocument::setObject(const QJsonObject &object) /*! Sets \a array as the main object of this document. - \sa setObject array + \sa setObject, array */ void QJsonDocument::setArray(const QJsonArray &array) { diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp index e880078..5439855 100644 --- a/src/corelib/json/qjsonobject.cpp +++ b/src/corelib/json/qjsonobject.cpp @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE /*! Constructs an empty JSON object - \sa isEmpty + \sa isEmpty() */ QJsonObject::QJsonObject() : d(0), o(0) @@ -139,7 +139,7 @@ QJsonObject &QJsonObject::operator =(const QJsonObject &other) The keys in \a map will be used as the keys in the JSON object, and the QVariant values will be converted to JSON values. - \sa toVariantMap, QJsonValue::fromVariant + \sa toVariantMap(), QJsonValue::fromVariant() */ QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map) { @@ -200,7 +200,7 @@ int QJsonObject::size() const /*! Returns \c true if the object is empty. This is the same as size() == 0. - \sa size + \sa size() */ bool QJsonObject::isEmpty() const { @@ -215,7 +215,7 @@ bool QJsonObject::isEmpty() const The returned QJsonValue is \c Undefined, if the key does not exist. - \sa setValue, QJsonValue, QJsonValue::isUndefined + \sa QJsonValue, QJsonValue::isUndefined() */ QJsonValue QJsonObject::value(const QString &key) const { @@ -236,7 +236,7 @@ QJsonValue QJsonObject::value(const QString &key) const The returned QJsonValue is \c Undefined, if the key does not exist. - \sa value, setValue, QJsonValue, QJsonValue::isUndefined + \sa value(), QJsonValue, QJsonValue::isUndefined() */ QJsonValue QJsonObject::operator [](const QString &key) const { @@ -252,7 +252,7 @@ QJsonValue QJsonObject::operator [](const QString &key) const the assignment will apply to the character in the QJsonArray of QJsonObject from which you got the reference. - \sa setValue, value + \sa value() */ QJsonValueRef QJsonObject::operator [](const QString &key) { @@ -277,7 +277,7 @@ QJsonValueRef QJsonObject::operator [](const QString &key) If the value is QJsonValue::Undefined, it will cause the key to get removed from the object. The returned iterator will then point to end() - \sa remove, take, QJsonObject::iterator, end + \sa remove(), take(), QJsonObject::iterator, end() */ QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &value) { @@ -320,7 +320,7 @@ QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue & /*! Removes \a key from the object. - \sa insert, take + \sa insert(), take() */ void QJsonObject::remove(const QString &key) { @@ -346,7 +346,7 @@ void QJsonObject::remove(const QString &key) If \a key was not contained in the object, the returned QJsonValue is Undefined. - \sa insert, remove, QJsonValue + \sa insert(), remove(), QJsonValue */ QJsonValue QJsonObject::take(const QString &key) { @@ -370,7 +370,7 @@ QJsonValue QJsonObject::take(const QString &key) /*! Returns \c true if the object contains key \a key. - \sa insert, remove, take + \sa insert(), remove(), take() */ bool QJsonObject::contains(const QString &key) const { @@ -455,7 +455,7 @@ QJsonObject::iterator QJsonObject::find(const QString &key) return iterator(this, index); } -/*! \fn QJsonObject::const_iterator QJsonObject::find(const Key &key) const +/*! \fn QJsonObject::const_iterator QJsonObject::find(const QString &key) const \overload */ @@ -541,6 +541,10 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const */ /*! \class QJsonObject::iterator + \ingroup json + \reentrant + \since 5.0 + \brief The QJsonObject::iterator class provides an STL-style non-const iterator for QJsonObject. QJsonObject::iterator allows you to iterate over a QJsonObject @@ -591,7 +595,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QJsonObject::begin() QJsonObject::end() + \sa QJsonObject::begin(), QJsonObject::end() */ /*! \fn QString QJsonObject::iterator::key() const @@ -729,7 +733,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const \sa operator+=(), operator-() */ -/*! \class QJsonObject::const_iterator +/*! + \class QJsonObject::const_iterator \brief The QJsonObject::const_iterator class provides an STL-style const iterator for QJsonObject. QJsonObject::const_iterator allows you to iterate over a QJsonObject. @@ -780,7 +785,7 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QJsonObject::constBegin() QJsonObject::constEnd() + \sa QJsonObject::constBegin(), QJsonObject::constEnd() */ /*! \fn QJsonObject::const_iterator::const_iterator(const iterator &other) @@ -987,17 +992,6 @@ void QJsonObject::setValueAt(int i, const QJsonValue &val) Qt-style synonym for QJsonObject::const_iterator. */ - -/*! \class QJsonObject::iterator - \ingroup json - \reentrant - \since 5.0 - - \brief The QJsonDocument::iterator class provides a way to iterate over q QJsonObject - - - */ - #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QJsonObject &o) { diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp index cf9b0ce..2ef98db 100644 --- a/src/corelib/kernel/qabstracteventdispatcher.cpp +++ b/src/corelib/kernel/qabstracteventdispatcher.cpp @@ -374,7 +374,7 @@ void QAbstractEventDispatcher::closingDown() Typedef for a function with the signature - \snippet doc/src/snippets/code/src_corelib_kernel_qabstracteventdispatcher.cpp 0 + \snippet code/src_corelib_kernel_qabstracteventdispatcher.cpp 0 Note that the type of the \a message is platform dependent. The following table shows the \a {message}'s type on Windows, Mac, and @@ -460,7 +460,7 @@ bool QAbstractEventDispatcher::filterEvent(void *message) This signal is emitted after the event loop returns from a function that could block. - \sa wakeUp() aboutToBlock() + \sa wakeUp(), aboutToBlock() */ /*! \fn void QAbstractEventDispatcher::aboutToBlock() diff --git a/src/corelib/kernel/qbasictimer.cpp b/src/corelib/kernel/qbasictimer.cpp index 621223e..76db945 100644 --- a/src/corelib/kernel/qbasictimer.cpp +++ b/src/corelib/kernel/qbasictimer.cpp @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE Returns true if the timer is running and has not been stopped; otherwise returns false. - \sa start() stop() + \sa start(), stop() */ /*! @@ -112,7 +112,7 @@ QT_BEGIN_NAMESPACE The given \a object will receive timer events. - \sa stop() isActive() QObject::timerEvent() Qt::CoarseTimer + \sa stop(), isActive(), QObject::timerEvent(), Qt::CoarseTimer */ void QBasicTimer::start(int msec, QObject *obj) { @@ -139,7 +139,7 @@ void QBasicTimer::start(int msec, QObject *obj) The given \a object will receive timer events. - \sa stop() isActive() QObject::timerEvent() Qt::TimerType + \sa stop(), isActive(), QObject::timerEvent(), Qt::TimerType */ void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject *obj) { @@ -160,7 +160,7 @@ void QBasicTimer::start(int msec, Qt::TimerType timerType, QObject *obj) /*! Stops the timer. - \sa start() isActive() + \sa start(), isActive() */ void QBasicTimer::stop() { diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 7b26a01..d188ccb 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1000,7 +1000,7 @@ void QCoreApplication::exit(int returnCode) The event is \e not deleted when the event has been sent. The normal approach is to create the event on the stack, for example: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 0 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 0 \sa postEvent(), notify() */ @@ -1467,7 +1467,7 @@ void QCoreApplicationPrivate::maybeQuit() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 1 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 1 \sa exit(), aboutToQuit(), QApplication::lastWindowClosed() */ @@ -1515,7 +1515,7 @@ void QCoreApplication::quit() The function returns true on success and false on failure. - \sa removeTranslator() translate() QTranslator::load() {Dynamic Translation} + \sa removeTranslator(), translate(), QTranslator::load(), {Dynamic Translation} */ bool QCoreApplication::installTranslator(QTranslator *translationFile) @@ -1628,7 +1628,7 @@ static void replacePercentN(QString *result, int n) so will most likely result in crashes or other undesirable behavior. - \sa QObject::tr() installTranslator() + \sa QObject::tr(), installTranslator() */ @@ -1904,7 +1904,7 @@ QStringList QCoreApplication::arguments() organizationName(). On all other platforms, QSettings uses organizationName() as the organization. - \sa organizationDomain applicationName + \sa organizationDomain, applicationName */ void QCoreApplication::setOrganizationName(const QString &orgName) @@ -1930,7 +1930,7 @@ QString QCoreApplication::organizationName() On all other platforms, QSettings uses organizationName() as the organization. - \sa organizationName applicationName applicationVersion + \sa organizationName, applicationName, applicationVersion */ void QCoreApplication::setOrganizationDomain(const QString &orgDomain) { @@ -1952,7 +1952,7 @@ QString QCoreApplication::organizationDomain() If not set, the application name defaults to the executable name (since 5.0). - \sa organizationName organizationDomain applicationVersion applicationFilePath + \sa organizationName, organizationDomain, applicationVersion, applicationFilePath */ void QCoreApplication::setApplicationName(const QString &application) { @@ -1978,7 +1978,7 @@ Q_CORE_EXPORT QString qt_applicationName_noFallback() \since 4.4 \brief the version of this application - \sa applicationName organizationName organizationDomain + \sa applicationName, organizationName, organizationDomain */ void QCoreApplication::setApplicationVersion(const QString &version) { @@ -2012,7 +2012,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive)) If you want to iterate over the list, you can use the \l foreach pseudo-keyword: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 2 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 2 \sa setLibraryPaths(), addLibraryPath(), removeLibraryPath(), QLibrary, {How to Create Qt Plugins} @@ -2134,7 +2134,7 @@ void QCoreApplication::removeLibraryPath(const QString &path) A function with the following signature that can be used as an event filter: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 3 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 3 \sa setEventFilter() */ @@ -2269,7 +2269,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc The function specified by \a ptr should take no arguments and should return nothing. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 4 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 4 Note that for an application- or module-wide cleanup, qAddPostRoutine() is often not suitable. For example, if the @@ -2283,7 +2283,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc parent-child mechanism to call a cleanup function at the right time: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 5 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 5 By selecting the right parent object, this can often be made to clean up the module's data at the right moment. @@ -2297,7 +2297,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc translation functions, \c tr() and \c trUtf8(), with these signatures: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 6 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 6 This macro is useful if you want to use QObject::tr() or QObject::trUtf8() in classes that don't inherit from QObject. @@ -2306,7 +2306,7 @@ void QCoreApplication::setEventDispatcher(QAbstractEventDispatcher *eventDispatc class definition (before the first \c{public:} or \c{protected:}). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qcoreapplication.cpp 7 + \snippet code/src_corelib_kernel_qcoreapplication.cpp 7 The \a context parameter is normally the class name, but it can be any string. diff --git a/src/corelib/kernel/qeventloop.cpp b/src/corelib/kernel/qeventloop.cpp index d3a64aa..deea463 100644 --- a/src/corelib/kernel/qeventloop.cpp +++ b/src/corelib/kernel/qeventloop.cpp @@ -275,7 +275,7 @@ void QEventLoop::exit(int returnCode) false. The event loop is considered running from the time when exec() is called until exit() is called. - \sa exec() exit() + \sa exec(), exit() */ bool QEventLoop::isRunning() const { diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index e3b0b15..8a415c9 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -492,7 +492,7 @@ int QMetaObject::constructorCount() const Use code like the following to obtain a QStringList containing the methods specific to a given class: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp methodCount + \snippet code/src_corelib_kernel_qmetaobject.cpp methodCount \sa method(), methodOffset(), indexOfMethod() */ @@ -530,7 +530,7 @@ int QMetaObject::enumeratorCount() const Use code like the following to obtain a QStringList containing the properties specific to a given class: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp propertyCount + \snippet code/src_corelib_kernel_qmetaobject.cpp propertyCount \sa property(), propertyOffset(), indexOfProperty() */ @@ -1102,7 +1102,7 @@ QMetaProperty QMetaObject::userProperty() const Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 0 + \snippet code/src_corelib_kernel_qmetaobject.cpp 0 \sa classInfoCount(), classInfoOffset(), indexOfClassInfo() */ @@ -1207,7 +1207,7 @@ static char *qNormalizeType(char *d, int &templdepth, QByteArray &result) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 1 + \snippet code/src_corelib_kernel_qmetaobject.cpp 1 \sa normalizedSignature() */ @@ -1312,7 +1312,7 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value the \l{QPushButton::animateClick()}{animateClick()} slot on a QPushButton, use the following code: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 2 + \snippet code/src_corelib_kernel_qmetaobject.cpp 2 With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs @@ -1320,7 +1320,7 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value scenes. If you try to use a queued connection and get the error message - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 3 + \snippet code/src_corelib_kernel_qmetaobject.cpp 3 call qRegisterMetaType() to register the data type before you call invokeMethod(). @@ -1328,7 +1328,7 @@ enum { MaximumParamCount = 11 }; // up to 10 arguments + 1 return value To synchronously invoke the \c compute(QString, int, double) slot on some arbitrary object \c obj retrieve its return value: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 4 + \snippet code/src_corelib_kernel_qmetaobject.cpp 4 If the "compute" slot does not take exactly one QString, one int and one double in the specified order, the call will fail. @@ -1883,7 +1883,7 @@ QMetaMethod::MethodType QMetaMethod::methodType() const \l{QPushButton::animateClick()}{animateClick()} slot on a QPushButton: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 6 + \snippet code/src_corelib_kernel_qmetaobject.cpp 6 With asynchronous method invocations, the parameters must be of types that are known to Qt's meta-object system, because Qt needs @@ -1891,7 +1891,7 @@ QMetaMethod::MethodType QMetaMethod::methodType() const scenes. If you try to use a queued connection and get the error message - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 7 + \snippet code/src_corelib_kernel_qmetaobject.cpp 7 call qRegisterMetaType() to register the data type before you call QMetaMethod::invoke(). @@ -1899,7 +1899,7 @@ QMetaMethod::MethodType QMetaMethod::methodType() const To synchronously invoke the \c compute(QString, int, double) slot on some arbitrary object \c obj retrieve its return value: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 8 + \snippet code/src_corelib_kernel_qmetaobject.cpp 8 QMetaObject::normalizedSignature() is used here to ensure that the format of the signature is what invoke() expects. E.g. extra whitespace is @@ -3058,7 +3058,7 @@ bool QMetaProperty::isEditable(const QObject *object) const are specified using Q_CLASSINFO() in the source code. The information can be retrieved using name() and value(). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp 5 + \snippet code/src_corelib_kernel_qmetaobject.cpp 5 This mechanism is free for you to use in your Qt applications. Qt doesn't use it for any of its classes. diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index d262d6a..1dda9f2 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -609,7 +609,7 @@ QMetaPropertyBuilder QMetaObjectBuilder::addProperty(const QMetaProperty& protot \a name. Returns an object that can be used to adjust the other attributes of the enumerator. - \sa enumerator(), enumeratorCount(), removeEnumerator(), + \sa enumerator(), enumeratorCount(), removeEnumerator() \sa indexOfEnumerator() */ QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QByteArray& name) @@ -625,7 +625,7 @@ QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QByteArray& name) QMetaObject. Returns an object that can be used to adjust the attributes of the enumerator. - \sa enumerator(), enumeratorCount(), removeEnumerator(), + \sa enumerator(), enumeratorCount(), removeEnumerator() \sa indexOfEnumerator() */ QMetaEnumBuilder QMetaObjectBuilder::addEnumerator(const QMetaEnum& prototype) diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index fba1aaf..e7f68fd 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -125,16 +125,16 @@ struct DefinedTypesFilter { This example shows a typical use case of Q_DECLARE_METATYPE(): - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 0 + \snippet code/src_corelib_kernel_qmetatype.cpp 0 If \c MyStruct is in a namespace, the Q_DECLARE_METATYPE() macro has to be outside the namespace: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 1 + \snippet code/src_corelib_kernel_qmetatype.cpp 1 Since \c{MyStruct} is now known to QMetaType, it can be used in QVariant: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 2 + \snippet code/src_corelib_kernel_qmetatype.cpp 2 \sa qRegisterMetaType() */ @@ -220,21 +220,13 @@ struct DefinedTypesFilter { \value User Base value for user types \value UnknownType This is an invalid type id. It is returned from QMetaType for types that are not registered - \omitvalue FirstGuiType - \omitvalue FirstWidgetsType - \omitvalue LastCoreType - \omitvalue LastGuiType - \omitvalue LastWidgetsType - \omitvalue QReal - \omitvalue HighestInternalId - Additional types can be registered using Q_DECLARE_METATYPE(). \sa type(), typeName() */ /*! - \enum QMetaType::TypeFlags + \enum QMetaType::TypeFlag The enum describes attributes of a type supported by QMetaType. @@ -265,7 +257,7 @@ struct DefinedTypesFilter { The following code allocates and destructs an instance of \c{MyClass}: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 3 + \snippet code/src_corelib_kernel_qmetatype.cpp 3 If we want the stream operators \c operator<<() and \c operator>>() to work on QVariant objects that store custom types, @@ -1486,12 +1478,12 @@ QMetaType::TypeFlags QMetaType::typeFlags(int type) This example registers the class \c{MyClass}: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 4 + \snippet code/src_corelib_kernel_qmetatype.cpp 4 This function is useful to register typedefs so they can be used by QMetaProperty, or in QueuedConnections - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 9 + \snippet code/src_corelib_kernel_qmetatype.cpp 9 \sa qRegisterMetaTypeStreamOperators(), QMetaType::isRegistered(), Q_DECLARE_METATYPE() @@ -1509,11 +1501,11 @@ QMetaType::TypeFlags QMetaType::typeFlags(int type) QMetaType::save(). These functions are used when streaming a QVariant. - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 5 + \snippet code/src_corelib_kernel_qmetatype.cpp 5 The stream operators should have the following signatures: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 6 + \snippet code/src_corelib_kernel_qmetatype.cpp 6 \sa qRegisterMetaType(), QMetaType::isRegistered(), Q_DECLARE_METATYPE() */ @@ -1548,7 +1540,7 @@ QMetaType::TypeFlags QMetaType::typeFlags(int type) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 7 + \snippet code/src_corelib_kernel_qmetatype.cpp 7 To use the type \c T in QVariant, using Q_DECLARE_METATYPE() is sufficient. To use the type \c T in queued signal and slot connections, @@ -1574,7 +1566,7 @@ QMetaType::TypeFlags QMetaType::typeFlags(int type) Typical usage: - \snippet doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp 8 + \snippet code/src_corelib_kernel_qmetatype.cpp 8 QMetaType::type() returns the same ID as qMetaTypeId(), but does a lookup at runtime based on the name of the type. diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 21f4bc7..14f3490 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -195,6 +195,8 @@ class Q_CORE_EXPORT QMetaType { FlagsEx = 0x100 }; public: +#ifndef Q_QDOC + // The code that actually gets compiled. enum Type { // these are merged with QVariant QT_FOR_EACH_STATIC_TYPE(QT_DEFINE_METATYPE_ID) @@ -212,6 +214,29 @@ public: UnknownType = 0, User = 1024 }; +#else + // If we are using QDoc it fakes the Type enum looks like this. + enum Type { + Void = 0, Bool = 1, Int = 2, UInt = 3, LongLong = 4, ULongLong = 5, + Double = 6, Long = 32, Short = 33, Char = 34, ULong = 35, UShort = 36, + UChar = 37, Float = 38, + VoidStar = 31, + QChar = 7, QString = 10, QStringList = 11, QByteArray = 12, + QBitArray = 13, QDate = 14, QTime = 15, QDateTime = 16, QUrl = 17, + QLocale = 18, QRect = 19, QRectF = 20, QSize = 21, QSizeF = 22, + QLine = 23, QLineF = 24, QPoint = 25, QPointF = 26, QRegExp = 27, + QEasingCurve = 29, QUuid = 30, QVariant = 41, QModelIndex = 42, + QObjectStar = 39, QWidgetStar = 40, + QVariantMap = 8, QVariantList = 9, QVariantHash = 28, + QFont = 64, QPixmap = 65, QBrush = 66, QColor = 67, QPalette = 68, + QImage = 69, QPolygon = 70, QRegion = 71, QBitmap = 72, QCursor = 73, + QKeySequence = 74, QPen = 75, QTextLength = 76, QTextFormat = 77, + QMatrix = 78, QTransform = 79, QMatrix4x4 = 80, QVector2D = 81, + QVector3D = 82, QVector4D = 83, QQuaternion = 84, QPolygonF = 85, + QIcon = 120, QSizePolicy = 121, + User = 256 + }; +#endif enum TypeFlag { NeedsConstruction = 0x1, diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp index 3a3464e..c18ce22 100644 --- a/src/corelib/kernel/qmimedata.cpp +++ b/src/corelib/kernel/qmimedata.cpp @@ -257,7 +257,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty For example, if your write a widget that accepts URL drags, you would end up writing code like this: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 0 + \snippet code/src_corelib_kernel_qmimedata.cpp 0 There are three approaches for storing custom data in a QMimeData object: @@ -266,7 +266,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty \li Custom data can be stored directly in a QMimeData object as a QByteArray using setData(). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 1 + \snippet code/src_corelib_kernel_qmimedata.cpp 1 \li We can subclass QMimeData and reimplement hasFormat(), formats(), and retrieveData(). @@ -276,7 +276,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty it, and use a qobject_cast() in the receiver's drop event handler. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 2 + \snippet code/src_corelib_kernel_qmimedata.cpp 2 \endlist \section1 Platform-Specific MIME Types @@ -286,11 +286,11 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty indicate that they represent data in non-standard formats. The formats will take the following form: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 3 + \snippet code/src_corelib_kernel_qmimedata.cpp 3 The following are examples of custom MIME types: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 4 + \snippet code/src_corelib_kernel_qmimedata.cpp 4 The \c value declaration of each format describes the way in which the data is encoded. @@ -458,7 +458,7 @@ bool QMimeData::hasHtml() const library, whereas QImage belongs to \l QtGui. To convert the QVariant to a QImage, simply use qvariant_cast(). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 5 + \snippet code/src_corelib_kernel_qmimedata.cpp 5 \sa hasImage() */ @@ -475,7 +475,7 @@ QVariant QMimeData::imageData() const library, whereas QImage belongs to \l QtGui. The conversion from QImage to QVariant is implicit. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 6 + \snippet code/src_corelib_kernel_qmimedata.cpp 6 \sa hasImage(), setData() */ @@ -505,7 +505,7 @@ bool QMimeData::hasImage() const library, whereas QColor belongs to \l QtGui. To convert the QVariant to a QColor, simply use qvariant_cast(). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qmimedata.cpp 7 + \snippet code/src_corelib_kernel_qmimedata.cpp 7 \sa hasColor(), setColorData(), data() */ diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index fb3e4e3..5ccbad4 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -568,9 +568,9 @@ void QMetaCallEvent::placeMetaCall(QObject *object) \l uic generates code that invokes this function to enable auto-connection to be performed between widgets on forms created - with \QD. More information about using auto-connection with \QD is + with \e{Qt Designer}. More information about using auto-connection with \e{Qt Designer} is given in the \l{Using a Designer UI File in Your Application} section of - the \QD manual. + the \e{Qt Designer} manual. \section1 Dynamic Properties @@ -606,7 +606,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object) Returns 0 if there is no such child. - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 0 + \snippet code/src_corelib_kernel_qobject.cpp 0 */ void *qt_find_obj_child(QObject *parent, const char *type, const QString &name) @@ -651,8 +651,8 @@ static bool check_parent_thread(QObject *parent, Constructs an object with parent object \a parent. The parent of an object may be viewed as the object's owner. For - instance, a \l{QDialog}{dialog box} is the parent of the \gui OK - and \gui Cancel buttons it contains. + instance, a \l{QDialog}{dialog box} is the parent of the \uicontrol{OK} + and \uicontrol{Cancel} buttons it contains. The destructor of a parent object destroys all child objects. @@ -881,7 +881,7 @@ QObjectPrivate::Connection::~Connection() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 1 + \snippet code/src_corelib_kernel_qobject.cpp 1 \sa staticMetaObject */ @@ -905,7 +905,7 @@ QObjectPrivate::Connection::~Connection() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 2 + \snippet code/src_corelib_kernel_qobject.cpp 2 \sa metaObject() */ @@ -924,7 +924,7 @@ QObjectPrivate::Connection::~Connection() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 3 + \snippet code/src_corelib_kernel_qobject.cpp 3 The qobject_cast() function behaves similarly to the standard C++ \c dynamic_cast(), with the advantages that it doesn't require @@ -950,7 +950,7 @@ QObjectPrivate::Connection::~Connection() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 4 + \snippet code/src_corelib_kernel_qobject.cpp 4 If you need to determine whether an object is an instance of a particular class for the purpose of casting it, consider using qobject_cast(object) @@ -967,7 +967,7 @@ QObjectPrivate::Connection::~Connection() You can find an object by name (and type) using findChild(). You can find a set of objects with findChildren(). - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 5 + \snippet code/src_corelib_kernel_qobject.cpp 5 By default, this property contains an empty string. @@ -1155,7 +1155,7 @@ void QObject::customEvent(QEvent * /* event */) true; otherwise return false. Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 6 + \snippet code/src_corelib_kernel_qobject.cpp 6 Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class @@ -1225,7 +1225,7 @@ QThread *QObject::thread() const QApplication::thread() to retrieve the thread in which the application lives. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 7 + \snippet code/src_corelib_kernel_qobject.cpp 7 If \a targetThread is zero, all event processing for this object and its children stops. @@ -1390,7 +1390,7 @@ void QObjectPrivate::_q_reregisterTimers(void *pointer) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 8 + \snippet code/src_corelib_kernel_qobject.cpp 8 Note that QTimer's accuracy depends on the underlying operating system and hardware. The \a timerType argument allows you to customize the accuracy of @@ -1472,7 +1472,7 @@ void QObject::killTimer(int id) The QObjectList class is defined in the \c{} header file as the following: - \quotefromfile src/corelib/kernel/qobject.h + \quotefromfile kernel/qobject.h \skipto /typedef .*QObjectList/ \printuntil QObjectList @@ -1507,21 +1507,21 @@ void QObject::killTimer(int id) named \c{"button1"}, even if the button isn't a direct child of the parent: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 10 + \snippet code/src_corelib_kernel_qobject.cpp 10 This example returns a \l{QListWidget} child of \c{parentWidget}: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 11 + \snippet code/src_corelib_kernel_qobject.cpp 11 This example returns a child \l{QPushButton} of \c{parentWidget} (its direct parent) named \c{"button1"}: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 41 + \snippet code/src_corelib_kernel_qobject.cpp 41 This example returns a \l{QListWidget} child of \c{parentWidget}, its direct parent: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 42 + \snippet code/src_corelib_kernel_qobject.cpp 42 \sa findChildren() */ @@ -1538,15 +1538,15 @@ void QObject::killTimer(int id) The following example shows how to find a list of child \l{QWidget}s of the specified \c{parentWidget} named \c{widgetname}: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 12 + \snippet code/src_corelib_kernel_qobject.cpp 12 This example returns all \c{QPushButton}s that are children of \c{parentWidget}: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 13 + \snippet code/src_corelib_kernel_qobject.cpp 13 This example returns all \c{QPushButton}s that are immediate children of \c{parentWidget}: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 43 + \snippet code/src_corelib_kernel_qobject.cpp 43 \sa findChild() */ @@ -1791,7 +1791,7 @@ void QObjectPrivate::setParent_helper(QObject *o) \fn void QObject::installEventFilter(QObject *filterObj) Installs an event filter \a filterObj on this object. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 14 + \snippet code/src_corelib_kernel_qobject.cpp 14 An event filter is an object that receives all events that are sent to this object. The filter can either stop the event or @@ -1806,11 +1806,11 @@ void QObjectPrivate::setParent_helper(QObject *o) Here's a \c KeyPressEater class that eats the key presses of its monitored objects: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 15 + \snippet code/src_corelib_kernel_qobject.cpp 15 And here's how to install it on two widgets: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 16 + \snippet code/src_corelib_kernel_qobject.cpp 16 The QShortcut class, for example, uses this technique to intercept shortcut key presses. @@ -1925,7 +1925,7 @@ void QObject::deleteLater() Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 17 + \snippet code/src_corelib_kernel_qobject.cpp 17 \dots See \l{Writing Source Code for Translation} for a detailed description of @@ -1959,7 +1959,7 @@ void QObject::deleteLater() escape sequences for specifying non-ASCII characters in string literals to trUtf8(). For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 20 + \snippet code/src_corelib_kernel_qobject.cpp 20 \sa tr(), QApplication::translate(), {Internationalization with Qt} */ @@ -2153,7 +2153,7 @@ int QObject::senderSignalIndex() const When calling this function, you can use the \c SIGNAL() macro to pass a specific signal: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 21 + \snippet code/src_corelib_kernel_qobject.cpp 21 As the code snippet above illustrates, you can use this function to avoid emitting a signal that nobody listens to. @@ -2278,18 +2278,18 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM You must use the \c SIGNAL() and \c SLOT() macros when specifying the \a signal and the \a method, for example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 22 + \snippet code/src_corelib_kernel_qobject.cpp 22 This example ensures that the label always displays the current scroll bar value. Note that the signal and slots parameters must not contain any variable names, only the type. E.g. the following would not work and return false: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 23 + \snippet code/src_corelib_kernel_qobject.cpp 23 A signal can also be connected to another signal: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 24 + \snippet code/src_corelib_kernel_qobject.cpp 24 In this example, the \c MyWidget constructor relays a signal from a private member variable, and makes it available under a name @@ -2326,7 +2326,7 @@ static inline void check_and_warn_compat(const QMetaObject *sender, const QMetaM scenes. If you try to use a queued connection and get the error message - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 25 + \snippet code/src_corelib_kernel_qobject.cpp 25 call qRegisterMetaType() to register the data type before you establish the connection. @@ -2575,27 +2575,27 @@ QMetaObject::Connection QObject::connect(const QObject *sender, const QMetaMetho \list 1 \li Disconnect everything connected to an object's signals: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 26 + \snippet code/src_corelib_kernel_qobject.cpp 26 equivalent to the non-static overloaded function - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 27 + \snippet code/src_corelib_kernel_qobject.cpp 27 \li Disconnect everything connected to a specific signal: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 28 + \snippet code/src_corelib_kernel_qobject.cpp 28 equivalent to the non-static overloaded function - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 29 + \snippet code/src_corelib_kernel_qobject.cpp 29 \li Disconnect a specific receiver: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 30 + \snippet code/src_corelib_kernel_qobject.cpp 30 equivalent to the non-static overloaded function - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 31 + \snippet code/src_corelib_kernel_qobject.cpp 31 \endlist @@ -2847,7 +2847,7 @@ bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal, If you want to compare \a signal with a specific signal, use QLatin1String and the \c SIGNAL() macro as follows: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 32 + \snippet code/src_corelib_kernel_qobject.cpp 32 If the signal contains multiple parameters or parameters that contain spaces, call QMetaObject::normalizedSignature() on @@ -3101,13 +3101,13 @@ bool QMetaObjectPrivate::disconnect(const QObject *sender, int signal_index, Searches recursively for all child objects of the given \a object, and connects matching signals from them to slots of \a object that follow the following form: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 33 + \snippet code/src_corelib_kernel_qobject.cpp 33 Let's assume our object has a child object of type QPushButton with the \l{QObject::objectName}{object name} \c{button1}. The slot to catch the button's \c{clicked()} signal would be: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 34 + \snippet code/src_corelib_kernel_qobject.cpp 34 \sa QObject::setObjectName() */ @@ -3722,7 +3722,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) { Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 35 + \snippet code/src_corelib_kernel_qobject.cpp 35 \sa QMetaObject::classInfo() */ @@ -3736,9 +3736,9 @@ QDebug operator<<(QDebug dbg, const QObject *o) { Example: - \snippet examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h 1 + \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 1 \dots - \snippet examples/tools/plugandpaintplugins/basictools/basictoolsplugin.h 3 + \snippet tools/plugandpaintplugins/basictools/basictoolsplugin.h 3 See the \l{tools/plugandpaintplugins/basictools}{Plug & Paint Basic Tools} example for details. @@ -3755,7 +3755,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) { they have additional features accessible through the \l {Meta-Object System}. - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 36 + \snippet code/src_corelib_kernel_qobject.cpp 36 The property name and type and the \c READ function are required. The type can be any type supported by QVariant, or it can be a @@ -3765,7 +3765,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) { For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 37 + \snippet code/src_corelib_kernel_qobject.cpp 37 For more details about how to use this macro, and a more detailed example of its use, see the discussion on \l {Qt's Property System}. @@ -3782,7 +3782,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) { For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 38 + \snippet code/src_corelib_kernel_qobject.cpp 38 If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class @@ -3804,12 +3804,12 @@ QDebug operator<<(QDebug dbg, const QObject *o) { For example, in QLibrary, the \l{QLibrary::LoadHints}{LoadHints} flag is declared in the following way: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39a + \snippet code/src_corelib_kernel_qobject.cpp 39a The declaration of the flags themselves is performed in the public section of the QLibrary class itself, using the \l Q_DECLARE_FLAGS() macro: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 39b + \snippet code/src_corelib_kernel_qobject.cpp 39b \note This macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUMS() @@ -3828,10 +3828,10 @@ QDebug operator<<(QDebug dbg, const QObject *o) { For example: - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 1 + \snippet signalsandslots/signalsandslots.h 1 \codeline - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 2 - \snippet doc/src/snippets/signalsandslots/signalsandslots.h 3 + \snippet signalsandslots/signalsandslots.h 2 + \snippet signalsandslots/signalsandslots.h 3 \note This macro requires the class to be a subclass of QObject. Use Q_GADGET instead of Q_OBJECT to enable the meta object system's support @@ -3927,7 +3927,7 @@ QDebug operator<<(QDebug dbg, const QObject *o) { be invoked via the meta-object system. The macro is written before the return type, as shown in the following example: - \snippet snippets/qmetaobject-invokable/window.h Window class with invokable method + \snippet qmetaobject-invokable/window.h Window class with invokable method The \c invokableMethod() function is marked up using Q_INVOKABLE, causing it to be registered with the meta-object system and enabling it to be @@ -3968,7 +3968,7 @@ void qDeleteInEventHandler(QObject *o) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 44 + \snippet code/src_corelib_kernel_qobject.cpp 44 This example ensures that the label always displays the current line edit text. @@ -4003,7 +4003,7 @@ void qDeleteInEventHandler(QObject *o) scenes. If you try to use a queued connection and get the error message - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 25 + \snippet code/src_corelib_kernel_qobject.cpp 25 make sure to declare the argument type with Q_DECLARE_METATYPE */ @@ -4029,11 +4029,11 @@ void qDeleteInEventHandler(QObject *o) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 45 + \snippet code/src_corelib_kernel_qobject.cpp 45 If your compiler support C++11 lambda expressions, you can use them: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 46 + \snippet code/src_corelib_kernel_qobject.cpp 46 The connection will automatically disconnect if the sender is destroyed. */ @@ -4178,19 +4178,19 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) \list 1 \li Disconnect everything connected to an object's signals: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 26 + \snippet code/src_corelib_kernel_qobject.cpp 26 \li Disconnect everything connected to a specific signal: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 47 + \snippet code/src_corelib_kernel_qobject.cpp 47 \li Disconnect a specific receiver: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 30 + \snippet code/src_corelib_kernel_qobject.cpp 30 \li Disconnect a connection from one specific signal to a specific slot: - \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 48 + \snippet code/src_corelib_kernel_qobject.cpp 48 \endlist diff --git a/src/corelib/kernel/qobjectcleanuphandler.cpp b/src/corelib/kernel/qobjectcleanuphandler.cpp index 166a90a..f165ec9 100644 --- a/src/corelib/kernel/qobjectcleanuphandler.cpp +++ b/src/corelib/kernel/qobjectcleanuphandler.cpp @@ -121,7 +121,7 @@ void QObjectCleanupHandler::remove(QObject *object) Returns true if this cleanup handler is empty or if all objects in this cleanup handler have been destroyed; otherwise return false. - \sa add() remove() clear() + \sa add(), remove(), clear() */ bool QObjectCleanupHandler::isEmpty() const { diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp index e0e14e5..cd88baf 100644 --- a/src/corelib/kernel/qpointer.cpp +++ b/src/corelib/kernel/qpointer.cpp @@ -74,10 +74,10 @@ Example: - \snippet doc/src/snippets/pointer/pointer.cpp 0 + \snippet pointer/pointer.cpp 0 \dots - \snippet doc/src/snippets/pointer/pointer.cpp 1 - \snippet doc/src/snippets/pointer/pointer.cpp 2 + \snippet pointer/pointer.cpp 1 + \snippet pointer/pointer.cpp 2 If the QLabel is deleted in the meantime, the \c label variable will hold 0 instead of an invalid address, and the last line will diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp index d8578a8..50c24ba 100644 --- a/src/corelib/kernel/qsharedmemory.cpp +++ b/src/corelib/kernel/qsharedmemory.cpp @@ -174,7 +174,7 @@ QSharedMemory::QSharedMemory(const QString &key, QObject *parent) the shared memory segment, the detach() operation destroys the shared memory segment. - \sa detach() isAttached() + \sa detach(), isAttached() */ QSharedMemory::~QSharedMemory() { @@ -193,7 +193,7 @@ QSharedMemory::~QSharedMemory() segment, it will \l {detach()} {detach} from it before setting the new key. This function does not do an attach(). - \sa key() nativeKey() isAttached() + \sa key(), nativeKey(), isAttached() */ void QSharedMemory::setKey(const QString &key) { @@ -225,7 +225,7 @@ void QSharedMemory::setKey(const QString &key) The application will not be portable if you set a native key. - \sa nativeKey() key() isAttached() + \sa nativeKey(), key(), isAttached() */ void QSharedMemory::setNativeKey(const QString &key) { @@ -288,7 +288,7 @@ bool QSharedMemoryPrivate::initKey() You can find the native, platform specific, key used by the operating system by calling nativeKey(). - \sa setKey() setNativeKey() + \sa setKey(), setNativeKey() */ QString QSharedMemory::key() const { @@ -306,7 +306,7 @@ QString QSharedMemory::key() const You can use the native key to access shared memory segments that have not been created by Qt, or to grant shared memory access to non-Qt applications. - \sa setKey() setNativeKey() + \sa setKey(), setNativeKey() */ QString QSharedMemory::nativeKey() const { @@ -363,7 +363,7 @@ bool QSharedMemory::create(int size, AccessMode mode) Returns the size of the attached shared memory segment. If no shared memory segment is attached, 0 is returned. - \sa create() attach() + \sa create(), attach() */ int QSharedMemory::size() const { @@ -472,7 +472,7 @@ void *QSharedMemory::data() the shared memory, and remember to release the lock with unlock() after you are done. - \sa attach() create() + \sa attach(), create() */ const void* QSharedMemory::constData() const { diff --git a/src/corelib/kernel/qsignalmapper.cpp b/src/corelib/kernel/qsignalmapper.cpp index 2734002..c668047 100644 --- a/src/corelib/kernel/qsignalmapper.cpp +++ b/src/corelib/kernel/qsignalmapper.cpp @@ -91,14 +91,14 @@ public: signal, \c clicked(), which is emitted with the text of the button that was clicked: - \snippet doc/src/snippets/qsignalmapper/buttonwidget.h 0 - \snippet doc/src/snippets/qsignalmapper/buttonwidget.h 1 + \snippet qsignalmapper/buttonwidget.h 0 + \snippet qsignalmapper/buttonwidget.h 1 The only function that we need to implement is the constructor: - \snippet doc/src/snippets/qsignalmapper/buttonwidget.cpp 0 - \snippet doc/src/snippets/qsignalmapper/buttonwidget.cpp 1 - \snippet doc/src/snippets/qsignalmapper/buttonwidget.cpp 2 + \snippet qsignalmapper/buttonwidget.cpp 0 + \snippet qsignalmapper/buttonwidget.cpp 1 + \snippet qsignalmapper/buttonwidget.cpp 2 A list of texts is passed to the constructor. A signal mapper is constructed and for each text in the list a QPushButton is diff --git a/src/corelib/kernel/qsystemsemaphore.cpp b/src/corelib/kernel/qsystemsemaphore.cpp index 0558f3c..70e75b5 100644 --- a/src/corelib/kernel/qsystemsemaphore.cpp +++ b/src/corelib/kernel/qsystemsemaphore.cpp @@ -79,7 +79,7 @@ QT_BEGIN_NAMESPACE can use to use the same semaphore. Example: Create a system semaphore - \snippet doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp 0 + \snippet code/src_corelib_kernel_qsystemsemaphore.cpp 0 A typical application of system semaphores is for controlling access to a circular buffer shared by a producer process and a consumer @@ -283,13 +283,13 @@ bool QSystemSemaphore::acquire() Example: Create a system semaphore having five resources; acquire them all and then release them all. - \snippet doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp 1 + \snippet code/src_corelib_kernel_qsystemsemaphore.cpp 1 This function can also "create" resources. For example, immediately following the sequence of statements above, suppose we add the statement: - \snippet doc/src/snippets/code/src_corelib_kernel_qsystemsemaphore.cpp 2 + \snippet code/src_corelib_kernel_qsystemsemaphore.cpp 2 Ten new resources are now guarded by the semaphore, in addition to the five that already existed. You would not normally use this diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 2131188..048388d 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -61,9 +61,9 @@ QT_BEGIN_NAMESPACE Example for a one second (1000 millisecond) timer (from the \l{widgets/analogclock}{Analog Clock} example): - \snippet examples/widgets/analogclock/analogclock.cpp 4 - \snippet examples/widgets/analogclock/analogclock.cpp 5 - \snippet examples/widgets/analogclock/analogclock.cpp 6 + \snippet widgets/analogclock/analogclock.cpp 4 + \snippet widgets/analogclock/analogclock.cpp 5 + \snippet widgets/analogclock/analogclock.cpp 6 From then on, the \c update() slot is called every second. @@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE QTimer::singleShot() function to call a slot after a specified interval: - \snippet doc/src/snippets/timers/timers.cpp 3 + \snippet timers/timers.cpp 3 In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI @@ -87,9 +87,9 @@ QT_BEGIN_NAMESPACE been processed. This can be used to do heavy work while providing a snappy user interface: - \snippet doc/src/snippets/timers/timers.cpp 4 - \snippet doc/src/snippets/timers/timers.cpp 5 - \snippet doc/src/snippets/timers/timers.cpp 6 + \snippet timers/timers.cpp 4 + \snippet timers/timers.cpp 5 + \snippet timers/timers.cpp 6 \c processOneThing() will from then on be called repeatedly. It should be written in such a way that it always returns quickly @@ -304,7 +304,7 @@ QT_END_INCLUDE_NAMESPACE create a local QTimer object. Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qtimer.cpp 0 + \snippet code/src_corelib_kernel_qtimer.cpp 0 This sample program automatically terminates after 10 minutes (600,000 milliseconds). diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index 892883b..c34a3ac 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -338,7 +338,7 @@ public: it via QObject::tr(). Here's the \c main() function from the \l{linguist/hellotr}{Hello tr()} example: - \snippet examples/linguist/hellotr/main.cpp 2 + \snippet linguist/hellotr/main.cpp 2 Note that the translator must be created \e before the application's widgets. diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 296b845..c363be8 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -913,7 +913,7 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names Here is some example code to demonstrate the use of QVariant: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 0 + \snippet code/src_corelib_kernel_qvariant.cpp 0 You can even store QList and QMap values in a variant, so you can easily construct arbitrarily @@ -925,7 +925,7 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names have a defined type with no value set. However, note that QVariant types can only be cast when they have had a value set. - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 1 + \snippet code/src_corelib_kernel_qvariant.cpp 1 QVariant can be extended to support other types than those mentioned in the \l Type enum. See the \l QMetaType documentation @@ -939,13 +939,13 @@ Q_CORE_EXPORT void QVariantPrivate::registerHandler(const int /* Modules::Names toColor() function. Instead, you can use the QVariant::value() or the qvariant_cast() template function. For example: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 2 + \snippet code/src_corelib_kernel_qvariant.cpp 2 The inverse conversion (e.g., from QColor to QVariant) is automatic for all data types supported by QVariant, including GUI-related types: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 3 + \snippet code/src_corelib_kernel_qvariant.cpp 3 \section1 Using canConvert() and convert() Consecutively @@ -2551,7 +2551,7 @@ bool QVariant::convert(int targetTypeId) } /*! - \fn convert(const int type, void *ptr) const + \fn bool QVariant::convert(const int type, void *ptr) const \internal Created for qvariant_cast() usage */ @@ -2695,7 +2695,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 4 + \snippet code/src_corelib_kernel_qvariant.cpp 4 \sa value(), fromValue(), canConvert() */ @@ -2712,7 +2712,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 5 + \snippet code/src_corelib_kernel_qvariant.cpp 5 \sa setValue(), fromValue(), canConvert() */ @@ -2724,7 +2724,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 6 + \snippet code/src_corelib_kernel_qvariant.cpp 6 \sa convert() */ @@ -2736,7 +2736,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) Example: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 7 + \snippet code/src_corelib_kernel_qvariant.cpp 7 \note If you are working with custom types, you should use the Q_DECLARE_METATYPE() macro to register your custom type. @@ -2761,7 +2761,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) For example, a QObject pointer can be stored in a variant with the following code: - \snippet doc/src/snippets/code/src_corelib_kernel_qvariant.cpp 8 + \snippet code/src_corelib_kernel_qvariant.cpp 8 \sa QVariant::fromValue() */ diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp index 2c84a93..2ac1978 100644 --- a/src/corelib/mimetypes/qmimedatabase.cpp +++ b/src/corelib/mimetypes/qmimedatabase.cpp @@ -289,7 +289,7 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent) \threadsafe - \snippet doc/src/snippets/code/src_corelib_mimetype_qmimedatabase.cpp 0 + \snippet code/src_corelib_mimetype_qmimedatabase.cpp 0 \sa QMimeType */ diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 216e6e1..7bb1ef1 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -127,7 +127,7 @@ static QBasicMutex qt_library_mutex; symbol is not defined, the function pointer will be 0 and won't be called. - \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 0 + \snippet code/src_corelib_plugin_qlibrary.cpp 0 The symbol must be exported as a C function from the library for resolve() to work. This means that the function must be wrapped in @@ -138,7 +138,7 @@ static QBasicMutex qt_library_mutex; use if you just want to call a function in a library without explicitly loading the library first: - \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 1 + \snippet code/src_corelib_plugin_qlibrary.cpp 1 \sa QPluginLoader */ @@ -1118,7 +1118,7 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver not be resolved or if the library could not be loaded. Example: - \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 2 + \snippet code/src_corelib_plugin_qlibrary.cpp 2 The symbol must be exported as a C function from the library. This means that the function must be wrapped in an \c{extern "C"} if @@ -1126,11 +1126,11 @@ void QLibrary::setFileNameAndVersion(const QString &fileName, const QString &ver also explicitly export the function from the DLL using the \c{__declspec(dllexport)} compiler directive, for example: - \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 3 + \snippet code/src_corelib_plugin_qlibrary.cpp 3 with \c MY_EXPORT defined as - \snippet doc/src/snippets/code/src_corelib_plugin_qlibrary.cpp 4 + \snippet code/src_corelib_plugin_qlibrary.cpp 4 */ QFunctionPointer QLibrary::resolve(const char *symbol) { diff --git a/src/corelib/plugin/qplugin.qdoc b/src/corelib/plugin/qplugin.qdoc index 77069e6..001b0d5 100644 --- a/src/corelib/plugin/qplugin.qdoc +++ b/src/corelib/plugin/qplugin.qdoc @@ -42,7 +42,7 @@ to the interface class called \a ClassName. The \a Identifier must be unique. For example: - \snippet examples/tools/plugandpaint/interfaces.h 3 + \snippet tools/plugandpaint/interfaces.h 3 This macro is normally used right after the class definition for \a ClassName, in a header file. See the @@ -51,7 +51,7 @@ If you want to use Q_DECLARE_INTERFACE with interface classes declared in a namespace then you have to make sure the Q_DECLARE_INTERFACE is not inside a namespace though. For example: - \snippet doc/src/snippets/code/doc_src_qplugin.cpp 0 + \snippet code/doc_src_qplugin.cpp 0 \sa Q_INTERFACES(), Q_EXPORT_PLUGIN2(), {How to Create Qt Plugins} */ @@ -82,7 +82,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qplugin.cpp 1 + \snippet code/doc_src_qplugin.cpp 1 See the \l{tools/plugandpaint}{Plug & Paint} example for details. @@ -102,14 +102,14 @@ Example: - \snippet doc/src/snippets/code/doc_src_qplugin.cpp 2 + \snippet code/doc_src_qplugin.cpp 2 Static plugins must also be included by the linker when your application is built. For Qt's predefined plugins, you can use the \c QTPLUGIN to add the required plugins to your build. For example: - \snippet doc/src/snippets/code/doc_src_qplugin.pro 3 + \snippet code/doc_src_qplugin.pro 3 \sa {Static Plugins}, {How to Create Qt Plugins}, {Using qmake} */ diff --git a/src/corelib/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp index 2603232..b1805af 100644 --- a/src/corelib/plugin/quuid.cpp +++ b/src/corelib/plugin/quuid.cpp @@ -337,7 +337,7 @@ static QUuid createFromName(const QUuid &ns, const QByteArray &baseData, QCrypto b8. Example: - \snippet doc/src/snippets/code/src_corelib_plugin_quuid.cpp 0 + \snippet code/src_corelib_plugin_quuid.cpp 0 */ #ifndef QT_NO_QUUID_STRING @@ -425,7 +425,7 @@ QUuid::QUuid(const QByteArray &text) /*! \since 5.0 - \fn QUuid::createUuidV3() + \fn QUuid QUuid::createUuidV3(const QUuid &ns, const QByteArray &baseData); This functions returns a new UUID with variant QUuid::DCE and version QUuid::MD5. \a ns is the namespace and \a name is the name as described by RFC 4122. @@ -435,7 +435,7 @@ QUuid::QUuid(const QByteArray &text) /*! \since 5.0 - \fn QUuid::createUuidV5() + \fn QUuid QUuid::createUuidV5(const QUuid &ns, const QByteArray &baseData); This functions returns a new UUID with variant QUuid::DCE and version QUuid::SHA1. \a ns is the namespace and \a name is the name as described by RFC 4122. diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index ad2cb02..4bb000a 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -126,7 +126,7 @@ QT_BEGIN_NAMESPACE The following snippet shows a state machine that will finish when a button is clicked: - \snippet doc/src/snippets/code/src_corelib_statemachine_qstatemachine.cpp simple state machine + \snippet code/src_corelib_statemachine_qstatemachine.cpp simple state machine This code example uses QState, which inherits QAbstractState. The QState class provides a state that you can use to set properties @@ -1747,7 +1747,7 @@ QStateMachine::~QStateMachine() \value RestoreProperties The state machine should save the initial values of properties and restore them later. - \sa QStateMachine::globalRestorePolicy QState::assignProperty() + \sa QStateMachine::globalRestorePolicy, QState::assignProperty() */ diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp index 2e3029f..abd2cc1 100644 --- a/src/corelib/thread/qatomic.cpp +++ b/src/corelib/thread/qatomic.cpp @@ -68,7 +68,7 @@ functions allow you to implement your own implicitly shared classes. - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 0 + \snippet code/src_corelib_thread_qatomic.cpp 0 \section2 Memory ordering @@ -104,7 +104,7 @@ nothing and return false. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 1 + \snippet code/src_corelib_thread_qatomic.cpp 1 There are 4 test-and-set functions: testAndSetRelaxed(), testAndSetAcquire(), testAndSetRelease(), and @@ -117,7 +117,7 @@ QAtomicInt and then assign a new value, returning the original value. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 2 + \snippet code/src_corelib_thread_qatomic.cpp 2 There are 4 fetch-and-store functions: fetchAndStoreRelaxed(), fetchAndStoreAcquire(), fetchAndStoreRelease(), and @@ -131,7 +131,7 @@ returning the original value. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 3 + \snippet code/src_corelib_thread_qatomic.cpp 3 There are 4 fetch-and-add functions: fetchAndAddRelaxed(), fetchAndAddAcquire(), fetchAndAddRelease(), and @@ -215,41 +215,12 @@ Constructs a copy of \a other. */ -/*! \fn QAtomicInt &QAtomicInt::operator=(int value) - - Assigns the \a value to this QAtomicInt and returns a reference to - this QAtomicInt. -*/ - /*! \fn QAtomicInt &QAtomicInt::operator=(const QAtomicInt &other) Assigns \a other to this QAtomicInt and returns a reference to this QAtomicInt. */ -/*! \fn bool QAtomicInt::operator==(int value) const - - Returns true if the \a value is equal to the value in this - QAtomicInt; otherwise returns false. -*/ - -/*! \fn bool QAtomicInt::operator!=(int value) const - - Returns true if the value of this QAtomicInt is not equal to \a - value; otherwise returns false. -*/ - -/*! \fn bool QAtomicInt::operator!() const - - Returns true is the value of this QAtomicInt is zero; otherwise - returns false. -*/ - -/*! \fn QAtomicInt::operator int() const - - Returns the value stored by the QAtomicInt object as an integer. -*/ - /*! \fn bool QAtomicInt::isReferenceCountingNative() Returns true if reference counting is implemented using atomic @@ -679,7 +650,7 @@ these functions do nothing and return false. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 4 + \snippet code/src_corelib_thread_qatomic.cpp 4 There are 4 test-and-set functions: testAndSetRelaxed(), testAndSetAcquire(), testAndSetRelease(), and @@ -692,7 +663,7 @@ QAtomicPointer and then assign a new value, returning the original value. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 5 + \snippet code/src_corelib_thread_qatomic.cpp 5 There are 4 fetch-and-store functions: fetchAndStoreRelaxed(), fetchAndStoreAcquire(), fetchAndStoreRelease(), and @@ -706,7 +677,7 @@ returning the original value. This operation equates to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qatomic.cpp 6 + \snippet code/src_corelib_thread_qatomic.cpp 6 There are 4 fetch-and-add functions: fetchAndAddRelaxed(), fetchAndAddAcquire(), fetchAndAddRelease(), and @@ -783,46 +754,12 @@ Constructs a copy of \a other. */ -/*! \fn QAtomicPointer &QAtomicPointer::operator=(T *value) - - Assigns the \a value to this QAtomicPointer and returns a - reference to this QAtomicPointer. -*/ - /*! \fn QAtomicPointer &QAtomicPointer::operator=(const QAtomicPointer &other) Assigns \a other to this QAtomicPointer and returns a reference to this QAtomicPointer. */ -/*! \fn bool QAtomicPointer::operator==(T *value) const - - Returns true if the \a value is equal to the value in this - QAtomicPointer; otherwise returns false. -*/ - -/*! \fn bool QAtomicPointer::operator!=(T *value) const - - Returns true if the value of this QAtomicPointer is not equal to - \a value; otherwise returns false. -*/ - -/*! \fn bool QAtomicPointer::operator!() const - - Returns true is the current value of this QAtomicPointer is zero; - otherwise returns false. -*/ - -/*! \fn QAtomicPointer::operator T *() const - - Returns the current pointer value stored by this QAtomicPointer - object. -*/ - -/*! \fn T *QAtomicPointer::operator->() const - -*/ - /*! \fn bool QAtomicPointer::isTestAndSetNative() Returns true if test-and-set is implemented using atomic processor diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index a8e321b..5cd9a6a 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -165,7 +165,7 @@ public: This is a helper for the assignment operators of implicitly shared classes. Your assignment operator should look like this: - \snippet doc/src/snippets/code/src.corelib.thread.qatomic.h 0 + \snippet code/src.corelib.thread.qatomic.h 0 */ template inline void qAtomicAssign(T *&d, T *x) @@ -184,7 +184,7 @@ inline void qAtomicAssign(T *&d, T *x) the members and sets the refcount to 1. After that, your detach function should look like this: - \snippet doc/src/snippets/code/src.corelib.thread.qatomic.h 1 + \snippet code/src.corelib.thread.qatomic.h 1 */ template inline void qAtomicDetach(T *&d) diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 049230f..145916d 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE -/*! +/* \class QBasicMutex \brief QMutex POD \internal @@ -86,20 +86,20 @@ QT_BEGIN_NAMESPACE For example, say there is a method that prints a message to the user on two lines: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 0 + \snippet code/src_corelib_thread_qmutex.cpp 0 If these two methods are called in succession, the following happens: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 1 + \snippet code/src_corelib_thread_qmutex.cpp 1 If these two methods are called simultaneously from two threads then the following sequence could result: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 2 + \snippet code/src_corelib_thread_qmutex.cpp 2 If we add a mutex, we should get the result we want: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 3 + \snippet code/src_corelib_thread_qmutex.cpp 3 Then only one thread can modify \c number at any given time and the result is correct. This is a trivial example, of course, but @@ -178,26 +178,7 @@ QMutex::~QMutex() \sa unlock() */ -/*!\fn bool QMutex::trylock() - Attempts to lock the mutex. If the lock was obtained, this function - returns true. If another thread has locked the mutex, this - function returns false immediately. - - If the lock was obtained, the mutex must be unlocked with unlock() - before another thread can successfully lock it. - - Calling this function multiple times on the same mutex from the - same thread is allowed if this mutex is a - \l{QMutex::Recursive}{recursive mutex}. If this mutex is a - \l{QMutex::NonRecursive}{non-recursive mutex}, this function will - \e always return false when attempting to lock the mutex - recursively. - - \sa lock(), unlock() -*/ - /*! \fn bool QMutex::tryLock(int timeout) - \overload Attempts to lock the mutex. This function returns true if the lock was obtained; otherwise it returns false. If another thread has @@ -268,7 +249,7 @@ bool QBasicMutex::isRecursive() { For example, this complex function locks a QMutex upon entering the function and unlocks the mutex at all the exit points: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 4 + \snippet code/src_corelib_thread_qmutex.cpp 4 This example function will get more complicated as it is developed, which increases the likelihood that errors will occur. @@ -276,7 +257,7 @@ bool QBasicMutex::isRecursive() { Using QMutexLocker greatly simplifies the code, and makes it more readable: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 5 + \snippet code/src_corelib_thread_qmutex.cpp 5 Now, the mutex will always be unlocked when the QMutexLocker object is destroyed (when the function returns since \c locker is @@ -292,7 +273,7 @@ bool QBasicMutex::isRecursive() { for code that needs access to the mutex, such as QWaitCondition::wait(). For example: - \snippet doc/src/snippets/code/src_corelib_thread_qmutex.cpp 6 + \snippet code/src_corelib_thread_qmutex.cpp 6 \sa QReadLocker, QWriteLocker, QMutex */ @@ -317,13 +298,6 @@ bool QBasicMutex::isRecursive() { */ /*! - \fn QMutex *QMutexLocker::mutex() const - - Returns a pointer to the mutex that was locked in the - constructor. -*/ - -/*! \fn void QMutexLocker::unlock() Unlocks this mutex locker. You can use \c relock() to lock diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 9a81b3d..0743c36 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -158,7 +158,6 @@ private: #else // QT_NO_THREAD or qdoc - class Q_CORE_EXPORT QMutex { public: diff --git a/src/corelib/thread/qmutexpool.cpp b/src/corelib/thread/qmutexpool.cpp index 6b6674c..4d24f8c 100644 --- a/src/corelib/thread/qmutexpool.cpp +++ b/src/corelib/thread/qmutexpool.cpp @@ -66,7 +66,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive)) For example, consider this simple class: - \snippet doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp 0 + \snippet code/src_corelib_thread_qmutexpool.cpp 0 Adding a QMutex member to the Number class does not make sense, because it is so small. However, in order to ensure that access to @@ -76,7 +76,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (QMutex::Recursive)) Code to calculate the square of a number would then look something like this: - \snippet doc/src/snippets/code/src_corelib_thread_qmutexpool.cpp 1 + \snippet code/src_corelib_thread_qmutexpool.cpp 1 This function will safely calculate the square of a number, since it uses a mutex from a QMutexPool. The mutex is locked and diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp index 519bae9..1aba2f5 100644 --- a/src/corelib/thread/qreadwritelock.cpp +++ b/src/corelib/thread/qreadwritelock.cpp @@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp 0 + \snippet code/src_corelib_thread_qreadwritelock.cpp 0 To ensure that writers aren't blocked forever by readers, readers attempting to obtain a lock will not succeed if there is a blocked @@ -135,7 +135,7 @@ QReadWriteLock::~QReadWriteLock() thread if any thread (including the current) has locked for writing. - \sa unlock() lockForWrite() tryLockForRead() + \sa unlock(), lockForWrite(), tryLockForRead() */ void QReadWriteLock::lockForRead() { @@ -178,7 +178,7 @@ void QReadWriteLock::lockForRead() If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it. - \sa unlock() lockForRead() + \sa unlock(), lockForRead() */ bool QReadWriteLock::tryLockForRead() { @@ -223,7 +223,7 @@ bool QReadWriteLock::tryLockForRead() If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it. - \sa unlock() lockForRead() + \sa unlock(), lockForRead() */ bool QReadWriteLock::tryLockForRead(int timeout) { @@ -263,7 +263,7 @@ bool QReadWriteLock::tryLockForRead(int timeout) Locks the lock for writing. This function will block the current thread if another thread has locked for reading or writing. - \sa unlock() lockForRead() tryLockForWrite() + \sa unlock(), lockForRead(), tryLockForWrite() */ void QReadWriteLock::lockForWrite() { @@ -303,7 +303,7 @@ void QReadWriteLock::lockForWrite() If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it. - \sa unlock() lockForWrite() + \sa unlock(), lockForWrite() */ bool QReadWriteLock::tryLockForWrite() { @@ -347,7 +347,7 @@ bool QReadWriteLock::tryLockForWrite() If the lock was obtained, the lock must be unlocked with unlock() before another thread can successfully lock it. - \sa unlock() lockForWrite() + \sa unlock(), lockForWrite() */ bool QReadWriteLock::tryLockForWrite(int timeout) { @@ -389,7 +389,7 @@ bool QReadWriteLock::tryLockForWrite(int timeout) Attempting to unlock a lock that is not locked is an error, and will result in program termination. - \sa lockForRead() lockForWrite() tryLockForRead() tryLockForWrite() + \sa lockForRead(), lockForWrite(), tryLockForRead(), tryLockForWrite() */ void QReadWriteLock::unlock() { @@ -443,11 +443,11 @@ void QReadWriteLock::unlock() Here's an example that uses QReadLocker to lock and unlock a read-write lock for reading: - \snippet doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp 1 + \snippet code/src_corelib_thread_qreadwritelock.cpp 1 It is equivalent to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp 2 + \snippet code/src_corelib_thread_qreadwritelock.cpp 2 The QMutexLocker documentation shows examples where the use of a locker object greatly simplifies programming. @@ -515,11 +515,11 @@ void QReadWriteLock::unlock() Here's an example that uses QWriteLocker to lock and unlock a read-write lock for writing: - \snippet doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp 3 + \snippet code/src_corelib_thread_qreadwritelock.cpp 3 It is equivalent to the following code: - \snippet doc/src/snippets/code/src_corelib_thread_qreadwritelock.cpp 4 + \snippet code/src_corelib_thread_qreadwritelock.cpp 4 The QMutexLocker documentation shows examples where the use of a locker object greatly simplifies programming. diff --git a/src/corelib/thread/qsemaphore.cpp b/src/corelib/thread/qsemaphore.cpp index 08952ee..e5b460b 100644 --- a/src/corelib/thread/qsemaphore.cpp +++ b/src/corelib/thread/qsemaphore.cpp @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE Example: - \snippet doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp 0 + \snippet code/src_corelib_thread_qsemaphore.cpp 0 A typical application of semaphores is for controlling access to a circular buffer shared by a producer thread and a consumer @@ -151,7 +151,7 @@ void QSemaphore::acquire(int n) This function can be used to "create" resources as well. For example: - \snippet doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp 1 + \snippet code/src_corelib_thread_qsemaphore.cpp 1 \sa acquire(), available() */ @@ -182,7 +182,7 @@ int QSemaphore::available() const Example: - \snippet doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp 2 + \snippet code/src_corelib_thread_qsemaphore.cpp 2 \sa acquire() */ @@ -208,7 +208,7 @@ bool QSemaphore::tryAcquire(int n) Example: - \snippet doc/src/snippets/code/src_corelib_thread_qsemaphore.cpp 3 + \snippet code/src_corelib_thread_qsemaphore.cpp 3 \sa acquire() */ diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index ea6760a..f93f383 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -184,7 +184,7 @@ QThreadPrivate::~QThreadPrivate() below). To create your own threads, subclass QThread and reimplement run(). For example: - \snippet doc/src/snippets/code/src_corelib_thread_qthread.cpp 0 + \snippet code/src_corelib_thread_qthread.cpp 0 This will create a QTcpSocket in the thread and then execute the thread's event loop. Use the start() method to begin execution. @@ -493,7 +493,7 @@ int QThread::exec() is not running then the next call to QThread::exec() will also return immediately. - \sa quit() QEventLoop + \sa quit(), QEventLoop */ void QThread::exit(int returnCode) { @@ -515,7 +515,7 @@ void QThread::exit(int returnCode) This function does nothing if the thread does not have an event loop. - \sa exit() QEventLoop + \sa exit(), QEventLoop */ void QThread::quit() { exit(); } @@ -529,7 +529,7 @@ void QThread::quit() work. Returning from this method will end the execution of the thread. - \sa start() wait() + \sa start(), wait() */ void QThread::run() { @@ -553,7 +553,7 @@ void QThread::run() (such as on Linux, see http://linux.die.net/man/2/sched_setscheduler for more details). - \sa Priority priority() start() + \sa Priority, priority(), start() */ /*! @@ -562,7 +562,7 @@ void QThread::run() Returns the priority for a running thread. If the thread is not running, this function returns \c InheritPriority. - \sa Priority setPriority() start() + \sa Priority, setPriority(), start() */ QThread::Priority QThread::priority() const { diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index 1cde07e..433c561 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -182,7 +182,7 @@ void qt_watch_adopted_thread(const HANDLE adoptedThreadHandle, QThread *qthread) } } -/*! \internal +/* This function loops and waits for native adopted threads to finish. When this happens it derefs the QThreadData for the adopted thread to make sure it gets cleaned up properly. diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp index 7f26dfe..c913146 100644 --- a/src/corelib/thread/qthreadpool.cpp +++ b/src/corelib/thread/qthreadpool.cpp @@ -360,7 +360,7 @@ void QThreadPoolPrivate::stealRunnable(QRunnable *runnable) the run() virtual function. Then create an object of that class and pass it to QThreadPool::start(). - \snippet doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp 0 + \snippet code/src_corelib_concurrent_qthreadpool.cpp 0 QThreadPool deletes the QRunnable automatically by default. Use QRunnable::setAutoDelete() to change the auto-deletion flag. diff --git a/src/corelib/thread/qthreadstorage.cpp b/src/corelib/thread/qthreadstorage.cpp index 68db8fe..caa2ac9 100644 --- a/src/corelib/thread/qthreadstorage.cpp +++ b/src/corelib/thread/qthreadstorage.cpp @@ -238,9 +238,9 @@ void QThreadStorageData::finish(void **p) removeFromCache() functions. The cache is automatically deleted when the calling thread exits. - \snippet doc/src/snippets/threads/threads.cpp 7 - \snippet doc/src/snippets/threads/threads.cpp 8 - \snippet doc/src/snippets/threads/threads.cpp 9 + \snippet threads/threads.cpp 7 + \snippet threads/threads.cpp 8 + \snippet threads/threads.cpp 9 \section1 Caveats diff --git a/src/corelib/thread/qwaitcondition.qdoc b/src/corelib/thread/qwaitcondition.qdoc index 81c095f..58679c4 100644 --- a/src/corelib/thread/qwaitcondition.qdoc +++ b/src/corelib/thread/qwaitcondition.qdoc @@ -45,7 +45,7 @@ split into a thread, each of which would have a \l{QThread::run()}{run()} body like this: - \snippet doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp 0 + \snippet code/src_corelib_thread_qwaitcondition_unix.cpp 0 Here, the \c keyPressed variable is a global variable of type QWaitCondition. @@ -53,7 +53,7 @@ A fourth thread would read key presses and wake the other three threads up every time it receives one, like this: - \snippet doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp 1 + \snippet code/src_corelib_thread_qwaitcondition_unix.cpp 1 The order in which the three threads are woken up is undefined. Also, if some of the threads are still in \c do_something() when @@ -63,11 +63,11 @@ counter and a QMutex to guard it. For example, here's the new code for the worker threads: - \snippet doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp 2 + \snippet code/src_corelib_thread_qwaitcondition_unix.cpp 2 Here's the code for the fourth thread: - \snippet doc/src/snippets/code/src_corelib_thread_qwaitcondition_unix.cpp 3 + \snippet code/src_corelib_thread_qwaitcondition_unix.cpp 3 The mutex is necessary because the results of two threads attempting to change the value of the same variable diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index 5a4a278..28fd988 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -60,14 +60,14 @@ a particular value. If you need that functionality, you can use qFill(): - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 0 + \snippet code/doc_src_qalgorithms.cpp 0 qFill() takes a begin iterator, an end iterator, and a value. In the example above, we pass \c list.begin() and \c list.end() as the begin and end iterators, but this doesn't have to be the case: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 1 + \snippet code/doc_src_qalgorithms.cpp 1 Different algorithms can have different requirements for the iterators they accept. For example, qFill() accepts two @@ -98,13 +98,13 @@ name_table array and return the corresponding Unicode value from the \c value_table if the entity is recognized: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 2 + \snippet code/doc_src_qalgorithms.cpp 2 This kind of code is for advanced users only; for most applications, a QMap- or QHash-based approach would work just as well: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 3 + \snippet code/doc_src_qalgorithms.cpp 3 \section1 Types of Iterators @@ -185,7 +185,7 @@ position \a begin2 + 1; and so on. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 4 + \snippet code/doc_src_qalgorithms.cpp 4 \sa qCopyBackward(), {input iterators}, {output iterators} */ @@ -201,7 +201,7 @@ at position \a end2 - 2; and so on. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 5 + \snippet code/doc_src_qalgorithms.cpp 5 \sa qCopy(), {bidirectional iterators} */ @@ -214,7 +214,7 @@ items compare equal; otherwise returns false. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 6 + \snippet code/doc_src_qalgorithms.cpp 6 This function requires the item type (in the example above, QString) to implement \c operator==(). @@ -228,7 +228,7 @@ Fills the range [\a begin, \a end) with \a value. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 7 + \snippet code/doc_src_qalgorithms.cpp 7 \sa qCopy(), {forward iterators} */ @@ -249,7 +249,7 @@ value isn't found. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 8 + \snippet code/doc_src_qalgorithms.cpp 8 This function requires the item type (in the example above, QString) to implement \c operator==(). @@ -278,7 +278,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 9 + \snippet code/doc_src_qalgorithms.cpp 9 This function requires the item type (in the example above, \c int) to implement \c operator==(). @@ -302,7 +302,7 @@ of \a value in the variable passed as a reference in argument \a n. Exchanges the values of variables \a var1 and \a var2. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 10 + \snippet code/doc_src_qalgorithms.cpp 10 */ /*! \fn void qSort(RandomAccessIterator begin, RandomAccessIterator end) @@ -312,7 +312,7 @@ of \a value in the variable passed as a reference in argument \a n. using the quicksort algorithm. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 11 + \snippet code/doc_src_qalgorithms.cpp 11 The sort algorithm is efficient on large data sets. It operates in \l {linear-logarithmic time}, O(\e{n} log \e{n}). @@ -338,13 +338,13 @@ of \a value in the variable passed as a reference in argument \a n. For example, here's how to sort the strings in a QStringList in case-insensitive alphabetical order: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 12 + \snippet code/doc_src_qalgorithms.cpp 12 To sort values in reverse order, pass \l{qGreater()}{qGreater()} as the \a lessThan parameter. For example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 13 + \snippet code/doc_src_qalgorithms.cpp 13 If neither of the two items is "less than" the other, the items are taken to be equal. It is then undefined which one of the two @@ -356,7 +356,7 @@ of \a value in the variable passed as a reference in argument \a n. following code shows how to sort a list of strings case insensitively using QMap: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 14 + \snippet code/doc_src_qalgorithms.cpp 14 \sa QMap */ @@ -382,7 +382,7 @@ of \a value in the variable passed as a reference in argument \a n. property is often useful when sorting user-visible data. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 15 + \snippet code/doc_src_qalgorithms.cpp 15 The sort algorithm is efficient on large data sets. It operates in \l {linear-logarithmic time}, O(\e{n} log \e{n}). @@ -405,7 +405,7 @@ of \a value in the variable passed as a reference in argument \a n. For example, here's how to sort the strings in a QStringList in case-insensitive alphabetical order: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 16 + \snippet code/doc_src_qalgorithms.cpp 16 Note that earlier versions of Qt allowed using a lessThan function that took its arguments by non-const reference. From 4.3 and on this is no longer possible, @@ -415,7 +415,7 @@ of \a value in the variable passed as a reference in argument \a n. \l{qGreater()}{qGreater()} as the \a lessThan parameter. For example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 17 + \snippet code/doc_src_qalgorithms.cpp 17 If neither of the two items is "less than" the other, the items are taken to be equal. The item that appeared before the other in the @@ -444,7 +444,7 @@ of \a value in the variable passed as a reference in argument \a n. ascending order; see qSort(). Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 18 + \snippet code/doc_src_qalgorithms.cpp 18 This function requires the item type (in the example above, \c{int}) to implement \c operator<(). @@ -452,7 +452,7 @@ of \a value in the variable passed as a reference in argument \a n. qLowerBound() can be used in conjunction with qUpperBound() to iterate over all occurrences of the same value: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 19 + \snippet code/doc_src_qalgorithms.cpp 19 \sa qUpperBound(), qBinaryFind() */ @@ -494,7 +494,7 @@ of \a value in the variable passed as a reference in argument \a n. ascending order; see qSort(). Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 20 + \snippet code/doc_src_qalgorithms.cpp 20 This function requires the item type (in the example above, \c{int}) to implement \c operator<(). @@ -502,7 +502,7 @@ of \a value in the variable passed as a reference in argument \a n. qUpperBound() can be used in conjunction with qLowerBound() to iterate over all occurrences of the same value: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 21 + \snippet code/doc_src_qalgorithms.cpp 21 \sa qLowerBound(), qBinaryFind() */ @@ -545,7 +545,7 @@ of \a value in the variable passed as a reference in argument \a n. finer control. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 22 + \snippet code/doc_src_qalgorithms.cpp 22 This function requires the item type (in the example above, QString) to implement \c operator<(). @@ -587,7 +587,7 @@ of \a value in the variable passed as a reference in argument \a n. example, \c{QWidget *}). Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 23 + \snippet code/doc_src_qalgorithms.cpp 23 Notice that qDeleteAll() doesn't remove the items from the container; it merely calls \c delete on them. In the example @@ -618,7 +618,7 @@ of \a value in the variable passed as a reference in argument \a n. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 24 + \snippet code/doc_src_qalgorithms.cpp 24 \sa {qGreater()}{qGreater()} */ @@ -631,7 +631,7 @@ of \a value in the variable passed as a reference in argument \a n. Example: - \snippet doc/src/snippets/code/doc_src_qalgorithms.cpp 25 + \snippet code/doc_src_qalgorithms.cpp 25 \sa {qLess()}{qLess()} */ diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index 4cb08a7..0e74e15 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE The following code constructs a QBitArray containing 200 bits initialized to false (0): - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 0 + \snippet code/src_corelib_tools_qbitarray.cpp 0 To initialize the bits to true, either pass \c true as second argument to the constructor, or call fill() later on. @@ -75,13 +75,13 @@ QT_BEGIN_NAMESPACE bit that can be used on the left side of an assignment. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 1 + \snippet code/src_corelib_tools_qbitarray.cpp 1 For technical reasons, it is more efficient to use testBit() and setBit() to access bits in the array than operator[](). For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 2 + \snippet code/src_corelib_tools_qbitarray.cpp 2 QBitArray supports \c{&} (\link operator&() AND\endlink), \c{|} (\link operator|() OR\endlink), \c{^} (\link operator^() @@ -90,7 +90,7 @@ QT_BEGIN_NAMESPACE as the built-in C++ bitwise operators of the same name. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 3 + \snippet code/src_corelib_tools_qbitarray.cpp 3 For historical reasons, QBitArray distinguishes between a null bit array and an empty bit array. A \e null bit array is a bit @@ -99,7 +99,7 @@ QT_BEGIN_NAMESPACE array is always empty, but an empty bit array isn't necessarily null: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 4 + \snippet code/src_corelib_tools_qbitarray.cpp 4 All functions except isNull() treat null bit arrays the same as empty bit arrays; for example, QBitArray() compares equal to @@ -228,7 +228,7 @@ void QBitArray::resize(int size) Returns true if this bit array is null; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 5 + \snippet code/src_corelib_tools_qbitarray.cpp 5 Qt makes a distinction between null bit arrays and empty bit arrays for historical reasons. For most applications, what @@ -245,7 +245,7 @@ void QBitArray::resize(int size) the bit array is resized to \a size beforehand. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 6 + \snippet code/src_corelib_tools_qbitarray.cpp 6 \sa resize() */ @@ -372,7 +372,7 @@ void QBitArray::fill(bool value, int begin, int end) \a i < size()). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 7 + \snippet code/src_corelib_tools_qbitarray.cpp 7 The return value is of type QBitRef, a helper class for QBitArray. When you get an object of type QBitRef, you can assign to @@ -451,7 +451,7 @@ void QBitArray::fill(bool value, int begin, int end) taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 8 + \snippet code/src_corelib_tools_qbitarray.cpp 8 \sa operator&(), operator|=(), operator^=(), operator~() */ @@ -480,7 +480,7 @@ QBitArray &QBitArray::operator&=(const QBitArray &other) taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 9 + \snippet code/src_corelib_tools_qbitarray.cpp 9 \sa operator|(), operator&=(), operator^=(), operator~() */ @@ -506,7 +506,7 @@ QBitArray &QBitArray::operator|=(const QBitArray &other) taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 10 + \snippet code/src_corelib_tools_qbitarray.cpp 10 \sa operator^(), operator&=(), operator|=(), operator~() */ @@ -527,7 +527,7 @@ QBitArray &QBitArray::operator^=(const QBitArray &other) array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 11 + \snippet code/src_corelib_tools_qbitarray.cpp 11 \sa operator&(), operator|(), operator^() */ @@ -559,7 +559,7 @@ QBitArray QBitArray::operator~() const taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 12 + \snippet code/src_corelib_tools_qbitarray.cpp 12 \sa QBitArray::operator&=(), operator|(), operator^() */ @@ -582,7 +582,7 @@ QBitArray operator&(const QBitArray &a1, const QBitArray &a2) taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 13 + \snippet code/src_corelib_tools_qbitarray.cpp 13 \sa QBitArray::operator|=(), operator&(), operator^() */ @@ -605,7 +605,7 @@ QBitArray operator|(const QBitArray &a1, const QBitArray &a2) taken to be 0. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbitarray.cpp 14 + \snippet code/src_corelib_tools_qbitarray.cpp 14 \sa QBitArray::operator^=(), operator&(), operator|() */ @@ -668,7 +668,7 @@ QBitArray operator^(const QBitArray &a1, const QBitArray &a2) Writes bit array \a ba to stream \a out. - \sa \link datastreamformat.html Format of the QDataStream operators \endlink + \sa {Serializing Qt Data Types}{Format of the QDataStream operators} */ QDataStream &operator<<(QDataStream &out, const QBitArray &ba) @@ -685,7 +685,7 @@ QDataStream &operator<<(QDataStream &out, const QBitArray &ba) Reads a bit array into \a ba from stream \a in. - \sa \link datastreamformat.html Format of the QDataStream operators \endlink + \sa {Serializing Qt Data Types}{Format of the QDataStream operators} */ QDataStream &operator>>(QDataStream &in, QBitArray &ba) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 31cf65b..42150ef 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -648,7 +648,7 @@ static inline char qToLower(char c) char *} to its constructor. For example, the following code creates a byte array of size 5 containing the data "Hello": - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 0 + \snippet code/src_corelib_tools_qbytearray.cpp 0 Although the size() is 5, the byte array also maintains an extra '\\0' character at the end so that if a function is used that @@ -668,11 +668,11 @@ static inline char qToLower(char c) arrays, operator[]() returns a reference to a byte that can be used on the left side of an assignment. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 1 + \snippet code/src_corelib_tools_qbytearray.cpp 1 For read-only access, an alternative syntax is to use at(): - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 2 + \snippet code/src_corelib_tools_qbytearray.cpp 2 at() can be faster than operator[](), because it never causes a \l{deep copy} to occur. @@ -700,7 +700,7 @@ static inline char qToLower(char c) the byte data: append(), prepend(), insert(), replace(), and remove(). For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 3 + \snippet code/src_corelib_tools_qbytearray.cpp 3 The replace() and remove() functions' first two arguments are the position from which to start erasing and the number of bytes that @@ -728,7 +728,7 @@ static inline char qToLower(char c) For example, here's a typical loop that finds all occurrences of a particular substring: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 4 + \snippet code/src_corelib_tools_qbytearray.cpp 4 If you simply want to check whether a QByteArray contains a particular character or substring, use contains(). If you want to @@ -752,7 +752,7 @@ static inline char qToLower(char c) array is always empty, but an empty byte array isn't necessarily null: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 5 + \snippet code/src_corelib_tools_qbytearray.cpp 5 All functions except isNull() treat null byte arrays the same as empty byte arrays. For example, data() returns a pointer to a @@ -949,7 +949,7 @@ QByteArray &QByteArray::operator=(const char *str) automaticall unless the \l{deep copy} is created. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 6 + \snippet code/src_corelib_tools_qbytearray.cpp 6 \sa isEmpty(), resize() */ @@ -959,7 +959,7 @@ QByteArray &QByteArray::operator=(const char *str) Returns true if the byte array has size 0; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 7 + \snippet code/src_corelib_tools_qbytearray.cpp 7 \sa size() */ @@ -1046,7 +1046,7 @@ QByteArray &QByteArray::operator=(const char *str) '\\0' terminator. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 8 + \snippet code/src_corelib_tools_qbytearray.cpp 8 The pointer remains valid as long as the byte array isn't reallocated or destroyed. For read-only access, constData() is @@ -1059,11 +1059,11 @@ QByteArray &QByteArray::operator=(const char *str) data(), but it will corrupt the heap and cause a crash because it does not allocate a byte for the '\\0' at the end: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 46 + \snippet code/src_corelib_tools_qbytearray.cpp 46 This one allocates the correct amount of space: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 47 + \snippet code/src_corelib_tools_qbytearray.cpp 47 Note: A QByteArray can store any byte values including '\\0's, but most functions that take \c{char *} arguments assume that the @@ -1129,7 +1129,7 @@ QByteArray &QByteArray::operator=(const char *str) place. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 9 + \snippet code/src_corelib_tools_qbytearray.cpp 9 The return value is of type QByteRef, a helper class for QByteArray. When you get an object of type QByteRef, you can use @@ -1188,7 +1188,7 @@ QByteArray &QByteArray::operator=(const char *str) If \a pos is beyond the end of the array, nothing happens. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 10 + \snippet code/src_corelib_tools_qbytearray.cpp 10 \sa chop(), resize(), left() */ @@ -1206,7 +1206,7 @@ void QByteArray::truncate(int pos) array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 11 + \snippet code/src_corelib_tools_qbytearray.cpp 11 \sa truncate(), resize(), left() */ @@ -1224,7 +1224,7 @@ void QByteArray::chop(int n) returns a reference to this byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 12 + \snippet code/src_corelib_tools_qbytearray.cpp 12 Note: QByteArray is an \l{implicitly shared} class. Consequently, if \e this is an empty QByteArray, then \e this will just share @@ -1284,7 +1284,7 @@ void QByteArray::chop(int n) Returns true if this byte array is null; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 13 + \snippet code/src_corelib_tools_qbytearray.cpp 13 Qt makes a distinction between null byte arrays and empty byte arrays for historical reasons. For most applications, what @@ -1428,7 +1428,7 @@ void QByteArray::resize(int size) size \a size beforehand. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 14 + \snippet code/src_corelib_tools_qbytearray.cpp 14 \sa resize() */ @@ -1493,7 +1493,7 @@ QByteArray QByteArray::nulTerminated() const reference to this byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 15 + \snippet code/src_corelib_tools_qbytearray.cpp 15 This is the same as insert(0, \a ba). @@ -1573,7 +1573,7 @@ QByteArray &QByteArray::prepend(char ch) Appends the byte array \a ba onto the end of this byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 16 + \snippet code/src_corelib_tools_qbytearray.cpp 16 This is the same as insert(size(), \a ba). @@ -1710,7 +1710,7 @@ static inline QByteArray &qbytearray_insert(QByteArray *ba, reference to this byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 17 + \snippet code/src_corelib_tools_qbytearray.cpp 17 \sa append(), prepend(), replace(), remove() */ @@ -1793,7 +1793,7 @@ QByteArray &QByteArray::insert(int i, char ch) array is truncated at position \a pos. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 18 + \snippet code/src_corelib_tools_qbytearray.cpp 18 \sa insert(), replace() */ @@ -1817,7 +1817,7 @@ QByteArray &QByteArray::remove(int pos, int len) array \a after, and returns a reference to this byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 19 + \snippet code/src_corelib_tools_qbytearray.cpp 19 \sa insert(), remove() */ @@ -1855,7 +1855,7 @@ QByteArray &QByteArray::replace(int pos, int len, const char *after) \overload Replaces \a len bytes from index position \a pos with \a alen bytes - from the string \a after. \a after is allowed to have '\0' characters. + from the string \a after. \a after is allowed to have '\\0' characters. \since 4.7 */ @@ -1881,7 +1881,7 @@ QByteArray &QByteArray::replace(int pos, int len, const char *after, int alen) byte array \a after. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 20 + \snippet code/src_corelib_tools_qbytearray.cpp 20 */ QByteArray &QByteArray::replace(const QByteArray &before, const QByteArray &after) @@ -2214,7 +2214,7 @@ QByteArray QByteArray::repeated(int times) const position \a from. Returns -1 if \a ba could not be found. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 21 + \snippet code/src_corelib_tools_qbytearray.cpp 21 \sa lastIndexOf(), contains(), count() */ @@ -2284,7 +2284,7 @@ int QByteArray::indexOf(const char *c, int from) const position \a from. Returns -1 if \a ch could not be found. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 22 + \snippet code/src_corelib_tools_qbytearray.cpp 22 \sa lastIndexOf(), contains() */ @@ -2346,7 +2346,7 @@ static int lastIndexOfHelper(const char *haystack, int l, const char *needle, in starts at the last byte. Returns -1 if \a ba could not be found. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 23 + \snippet code/src_corelib_tools_qbytearray.cpp 23 \sa indexOf(), contains(), count() */ @@ -2406,7 +2406,7 @@ int QByteArray::lastIndexOf(const char *str, int from) const last (size() - 1) byte. Returns -1 if \a ch could not be found. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 24 + \snippet code/src_corelib_tools_qbytearray.cpp 24 \sa indexOf(), contains() */ @@ -2493,7 +2493,7 @@ int QByteArray::count(char ch) const otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 25 + \snippet code/src_corelib_tools_qbytearray.cpp 25 \sa endsWith(), left() */ @@ -2538,7 +2538,7 @@ bool QByteArray::startsWith(char ch) const otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 26 + \snippet code/src_corelib_tools_qbytearray.cpp 26 \sa startsWith(), right() */ @@ -2586,7 +2586,7 @@ bool QByteArray::endsWith(char ch) const size(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 27 + \snippet code/src_corelib_tools_qbytearray.cpp 27 \sa right(), mid(), startsWith(), truncate() */ @@ -2608,7 +2608,7 @@ QByteArray QByteArray::left(int len) const size(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 28 + \snippet code/src_corelib_tools_qbytearray.cpp 28 \sa endsWith(), left(), mid() */ @@ -2631,7 +2631,7 @@ QByteArray QByteArray::right(int len) const pos until the end of the byte array. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 29 + \snippet code/src_corelib_tools_qbytearray.cpp 29 \sa left(), right() */ @@ -2658,7 +2658,7 @@ QByteArray QByteArray::mid(int pos, int len) const interpreted as a Latin-1 encoded string. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 30 + \snippet code/src_corelib_tools_qbytearray.cpp 30 \sa toUpper(), {8-bit Character Comparisons} */ @@ -2680,7 +2680,7 @@ QByteArray QByteArray::toLower() const interpreted as a Latin-1 encoded string. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 31 + \snippet code/src_corelib_tools_qbytearray.cpp 31 \sa toLower(), {8-bit Character Comparisons} */ @@ -3090,7 +3090,7 @@ QDataStream &operator>>(QDataStream &in, QByteArray &ba) characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 32 + \snippet code/src_corelib_tools_qbytearray.cpp 32 \sa trimmed() */ @@ -3128,7 +3128,7 @@ QByteArray QByteArray::simplified() const characters '\\t', '\\n', '\\v', '\\f', '\\r', and ' '. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 33 + \snippet code/src_corelib_tools_qbytearray.cpp 33 Unlike simplified(), trimmed() leaves internal whitespace alone. @@ -3170,7 +3170,7 @@ QByteArray QByteArray::trimmed() const after position \a width are removed, and the copy is returned. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 34 + \snippet code/src_corelib_tools_qbytearray.cpp 34 \sa rightJustified() */ @@ -3207,7 +3207,7 @@ QByteArray QByteArray::leftJustified(int width, char fill, bool truncate) const position \a width. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 35 + \snippet code/src_corelib_tools_qbytearray.cpp 35 \sa leftJustified() */ @@ -3314,7 +3314,7 @@ qulonglong QByteArray::toULongLong(bool *ok, int base) const If \a ok is not 0: if a conversion error occurs, *\a{ok} is set to false; otherwise *\a{ok} is set to true. - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 36 + \snippet code/src_corelib_tools_qbytearray.cpp 36 \note The conversion of the number is performed in the default C locale, irrespective of the user's locale. @@ -3380,7 +3380,7 @@ uint QByteArray::toUInt(bool *ok, int base) const If \a ok is not 0: if a conversion error occurs, *\a{ok} is set to false; otherwise *\a{ok} is set to true. - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 37 + \snippet code/src_corelib_tools_qbytearray.cpp 37 \note The conversion of the number is performed in the default C locale, irrespective of the user's locale. @@ -3501,7 +3501,7 @@ ushort QByteArray::toUShort(bool *ok, int base) const If \a ok is not 0: if a conversion error occurs, *\a{ok} is set to false; otherwise *\a{ok} is set to true. - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 38 + \snippet code/src_corelib_tools_qbytearray.cpp 38 \note The conversion of the number is performed in the default C locale, irrespective of the user's locale. @@ -3536,7 +3536,7 @@ float QByteArray::toFloat(bool *ok) const /*! Returns a copy of the byte array, encoded as Base64. - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 39 + \snippet code/src_corelib_tools_qbytearray.cpp 39 The algorithm used to encode Base64-encoded data is defined in \l{RFC 2045}. @@ -3588,7 +3588,7 @@ QByteArray QByteArray::toBase64() const be any value between 2 and 36. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 40 + \snippet code/src_corelib_tools_qbytearray.cpp 40 \note The format of the number is not localized; the default C locale is used irrespective of the user's locale. @@ -3734,7 +3734,7 @@ QByteArray &QByteArray::setNum(double n, char f, int prec) any value between 2 and 36. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 41 + \snippet code/src_corelib_tools_qbytearray.cpp 41 \note The format of the number is not localized; the default C locale is used irrespective of the user's locale. @@ -3806,7 +3806,7 @@ QByteArray QByteArray::number(qulonglong n, int base) decimal point. With 'g' and 'G', \a prec is the maximum number of significant digits (trailing zeroes are omitted). - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 42 + \snippet code/src_corelib_tools_qbytearray.cpp 42 \note The format of the number is not localized; the default C locale is used irrespective of the user's locale. @@ -3843,7 +3843,7 @@ QByteArray QByteArray::number(double n, char f, int prec) Here is an example of how to read data using a QDataStream on raw data in memory without copying the raw data into a QByteArray: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 43 + \snippet code/src_corelib_tools_qbytearray.cpp 43 \warning A byte array created with fromRawData() is \e not null-terminated, unless the raw data contains a 0 character at @@ -3908,7 +3908,7 @@ QByteArray &QByteArray::setRawData(const char *data, uint size) For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 44 + \snippet code/src_corelib_tools_qbytearray.cpp 44 The algorithm used to decode Base64-encoded data is defined in \l{RFC 2045}. @@ -3960,7 +3960,7 @@ QByteArray QByteArray::fromBase64(const QByteArray &base64) For example: - \snippet doc/src/snippets/code/src_corelib_tools_qbytearray.cpp 45 + \snippet code/src_corelib_tools_qbytearray.cpp 45 \sa toHex() */ diff --git a/src/corelib/tools/qcache.qdoc b/src/corelib/tools/qcache.qdoc index 80d47ff..86eec28 100644 --- a/src/corelib/tools/qcache.qdoc +++ b/src/corelib/tools/qcache.qdoc @@ -39,11 +39,11 @@ definition of a cache that stores objects of type Employee associated with an integer key: - \snippet doc/src/snippets/code/doc_src_qcache.cpp 0 + \snippet code/doc_src_qcache.cpp 0 Here's how to insert an object in the cache: - \snippet doc/src/snippets/code/doc_src_qcache.cpp 1 + \snippet code/doc_src_qcache.cpp 1 The advantage of using QCache over some other key-based data structure (such as QMap or QHash) is that QCache automatically @@ -59,7 +59,7 @@ By default, QCache's maxCost() is 100. You can specify a different value in the QCache constructor: - \snippet doc/src/snippets/code/doc_src_qcache.cpp 2 + \snippet code/doc_src_qcache.cpp 2 Each time you call insert(), you can specify a cost as third argument (after the key and a pointer to the object to insert). diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index fa5eed4..630decc 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -824,7 +824,7 @@ QString QDate::toString(Qt::DateFormat f) const range 0 to 9999. This restriction may apply to locale-aware formats as well, depending on the locale settings. - \sa QDateTime::toString() QTime::toString() + \sa QDateTime::toString(), QTime::toString() */ QString QDate::toString(const QString& format) const @@ -836,7 +836,7 @@ QString QDate::toString(const QString& format) const #endif //QT_NO_DATESTRING /*! - \fn bool setYMD(int y, int m, int d) + \fn bool QDate::setYMD(int y, int m, int d) \deprecated in 5.0, use setDate() instead. @@ -906,7 +906,7 @@ void QDate::getDate(int *year, int *month, int *day) Returns a null date if the current date is invalid or the new date is out-of-range. - \sa addMonths() addYears() daysTo() + \sa addMonths(), addYears(), daysTo() */ QDate QDate::addDays(qint64 ndays) const @@ -938,7 +938,7 @@ QDate QDate::addDays(qint64 ndays) const resulting month/year, this function will return a date that is the latest valid date. - \sa addDays() addYears() + \sa addDays(), addYears() */ QDate QDate::addMonths(int nmonths) const @@ -1029,7 +1029,7 @@ QDate QDate::addYears(int nyears) const Returns 0 if either date is invalid. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 0 + \snippet code/src_corelib_tools_qdatetime.cpp 0 \sa addDays() */ @@ -1217,7 +1217,7 @@ QDate QDate::fromString(const QString& s, Qt::DateFormat f) of characters that are enclosed in single quotes will also be treated as text and will not be used as an expression. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 1 + \snippet code/src_corelib_tools_qdatetime.cpp 1 If the format is not satisfied, an invalid QDate is returned. The expressions that don't expect leading zeroes (d, M) will be @@ -1227,7 +1227,7 @@ QDate QDate::fromString(const QString& s, Qt::DateFormat f) string could have meant January 30 but the M will grab two digits, resulting in an invalid date: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 2 + \snippet code/src_corelib_tools_qdatetime.cpp 2 For any field that is not represented in the format the following defaults are used: @@ -1241,7 +1241,7 @@ QDate QDate::fromString(const QString& s, Qt::DateFormat f) The following examples demonstrate the default values: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 3 + \snippet code/src_corelib_tools_qdatetime.cpp 3 \sa QDateTime::fromString(), QTime::fromString(), QDate::toString(), QDateTime::toString(), QTime::toString() @@ -1269,7 +1269,7 @@ QDate QDate::fromString(const QString &string, const QString &format) day) is valid; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 4 + \snippet code/src_corelib_tools_qdatetime.cpp 4 \sa isNull(), setDate() */ @@ -1300,7 +1300,7 @@ bool QDate::isLeapYear(int y) return (y % 4 == 0 && y % 100 != 0) || y % 400 == 0; } -/*! \fn static QDate QDate::fromJulianDay(int jd) +/*! \fn static QDate QDate::fromJulianDay(qint64 jd) Converts the Julian day \a jd to a QDate. @@ -1582,7 +1582,7 @@ QString QTime::toString(Qt::DateFormat format) const If the datetime is invalid, an empty string will be returned. If \a format is empty, the default format "hh:mm:ss" is used. - \sa QDate::toString() QDateTime::toString() + \sa QDate::toString(), QDateTime::toString() */ QString QTime::toString(const QString& format) const { @@ -1623,7 +1623,7 @@ bool QTime::setHMS(int h, int m, int s, int ms) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 5 + \snippet code/src_corelib_tools_qdatetime.cpp 5 \sa addMSecs(), secsTo(), QDateTime::addSecs() */ @@ -1845,7 +1845,7 @@ QTime QTime::fromString(const QString& s, Qt::DateFormat f) of characters that are enclosed in single quotes will also be treated as text and not be used as an expression. - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 6 + \snippet code/src_corelib_tools_qdatetime.cpp 6 If the format is not satisfied an invalid QTime is returned. Expressions that do not expect leading zeroes to be given (h, m, s @@ -1855,15 +1855,15 @@ QTime QTime::fromString(const QString& s, Qt::DateFormat f) could have meant 00:07:10, but the m will grab two digits, resulting in an invalid time: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 7 + \snippet code/src_corelib_tools_qdatetime.cpp 7 Any field that is not represented in the format will be set to zero. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 8 + \snippet code/src_corelib_tools_qdatetime.cpp 8 - \sa QDateTime::fromString() QDate::fromString() QDate::toString() - QDateTime::toString() QTime::toString() + \sa QDateTime::fromString(), QDate::fromString(), QDate::toString(), + QDateTime::toString(), QTime::toString() */ QTime QTime::fromString(const QString &string, const QString &format) @@ -1894,7 +1894,7 @@ QTime QTime::fromString(const QString &string, const QString &format) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 9 + \snippet code/src_corelib_tools_qdatetime.cpp 9 */ bool QTime::isValid(int h, int m, int s, int ms) @@ -1906,7 +1906,7 @@ bool QTime::isValid(int h, int m, int s, int ms) /*! Sets this time to the current time. This is practical for timing: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 10 + \snippet code/src_corelib_tools_qdatetime.cpp 10 \sa restart(), elapsed(), currentTime() */ @@ -2077,7 +2077,7 @@ int QTime::elapsed() const time zone before 1970, even if the system's time zone database supports that information. - \sa QDate QTime QDateTimeEdit + \sa QDate, QTime, QDateTimeEdit */ /*! @@ -2432,7 +2432,7 @@ void QDateTime::setTime_t(uint secsSince1Jan1970UTC) range 0 to 9999. This restriction may apply to locale-aware formats as well, depending on the locale settings. - \sa QDate::toString() QTime::toString() Qt::DateFormat + \sa QDate::toString(), QTime::toString(), Qt::DateFormat */ QString QDateTime::toString(Qt::DateFormat f) const @@ -2574,7 +2574,7 @@ QString QDateTime::toString(Qt::DateFormat f) const If the datetime is invalid, an empty string will be returned. - \sa QDate::toString() QTime::toString() + \sa QDate::toString(), QTime::toString() */ QString QDateTime::toString(const QString& format) const { @@ -2718,7 +2718,7 @@ qint64 QDateTime::daysTo(const QDateTime &other) const Returns 0 if either time is invalid. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 11 + \snippet code/src_corelib_tools_qdatetime.cpp 11 \sa addSecs(), daysTo(), QTime::secsTo() */ @@ -3420,7 +3420,7 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f) of characters that are enclosed in singlequotes will also be treated as text and not be used as an expression. - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 12 + \snippet code/src_corelib_tools_qdatetime.cpp 12 If the format is not satisfied an invalid QDateTime is returned. The expressions that don't have leading zeroes (d, M, h, m, s, z) will be @@ -3428,7 +3428,7 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f) put them outside the range and/or leave too few digits for other sections. - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 13 + \snippet code/src_corelib_tools_qdatetime.cpp 13 This could have meant 1 January 00:30.00 but the M will grab two digits. @@ -3448,10 +3448,10 @@ QDateTime QDateTime::fromString(const QString& s, Qt::DateFormat f) For example: - \snippet doc/src/snippets/code/src_corelib_tools_qdatetime.cpp 14 + \snippet code/src_corelib_tools_qdatetime.cpp 14 - \sa QDate::fromString() QTime::fromString() QDate::toString() - QDateTime::toString() QTime::toString() + \sa QDate::fromString(), QTime::fromString(), QDate::toString(), + QDateTime::toString(), QTime::toString() */ QDateTime QDateTime::fromString(const QString &string, const QString &format) diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 1d6514e..e237b81 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -55,7 +55,7 @@ \class QEasingCurve \since 4.6 \ingroup animation - \brief The QEasingCurve class provides easing curves for controlling animation. + \captionief The QEasingCurve class provides easing curves for controlling animation. Easing curves describe a function that controls how the speed of the interpolation between 0 and 1 should be. Easing curves allow transitions from @@ -112,183 +112,173 @@ The type of easing curve. - \value Linear \inlineimage qeasingcurve-linear.png - \br - Easing curve for a linear (t) function: + \value Linear \image qeasingcurve-linear.png + \caption Easing curve for a linear (t) function: velocity is constant. - \value InQuad \inlineimage qeasingcurve-inquad.png - \br - Easing curve for a quadratic (t^2) function: + \value InQuad \image qeasingcurve-inquad.png + \caption Easing curve for a quadratic (t^2) function: accelerating from zero velocity. - \value OutQuad \inlineimage qeasingcurve-outquad.png - \br - Easing curve for a quadratic (t^2) function: + \value OutQuad \image qeasingcurve-outquad.png + \caption Easing curve for a quadratic (t^2) function: decelerating to zero velocity. - \value InOutQuad \inlineimage qeasingcurve-inoutquad.png - \br - Easing curve for a quadratic (t^2) function: + \value InOutQuad \image qeasingcurve-inoutquad.png + \caption Easing curve for a quadratic (t^2) function: acceleration until halfway, then deceleration. - \value OutInQuad \inlineimage qeasingcurve-outinquad.png - \br - Easing curve for a quadratic (t^2) function: + \value OutInQuad \image qeasingcurve-outinquad.png + \caption Easing curve for a quadratic (t^2) function: deceleration until halfway, then acceleration. - \value InCubic \inlineimage qeasingcurve-incubic.png - \br - Easing curve for a cubic (t^3) function: + \value InCubic \image qeasingcurve-incubic.png + \caption Easing curve for a cubic (t^3) function: accelerating from zero velocity. - \value OutCubic \inlineimage qeasingcurve-outcubic.png - \br - Easing curve for a cubic (t^3) function: + \value OutCubic \image qeasingcurve-outcubic.png + \caption Easing curve for a cubic (t^3) function: decelerating to zero velocity. - \value InOutCubic \inlineimage qeasingcurve-inoutcubic.png - \br - Easing curve for a cubic (t^3) function: + \value InOutCubic \image qeasingcurve-inoutcubic.png + \caption Easing curve for a cubic (t^3) function: acceleration until halfway, then deceleration. - \value OutInCubic \inlineimage qeasingcurve-outincubic.png - \br - Easing curve for a cubic (t^3) function: + \value OutInCubic \image qeasingcurve-outincubic.png + \caption Easing curve for a cubic (t^3) function: deceleration until halfway, then acceleration. - \value InQuart \inlineimage qeasingcurve-inquart.png - \br - Easing curve for a quartic (t^4) function: + \value InQuart \image qeasingcurve-inquart.png + \caption Easing curve for a quartic (t^4) function: accelerating from zero velocity. - \value OutQuart \inlineimage qeasingcurve-outquart.png - \br + \value OutQuart \image qeasingcurve-outquart.png + \caption Easing curve for a quartic (t^4) function: decelerating to zero velocity. - \value InOutQuart \inlineimage qeasingcurve-inoutquart.png - \br + \value InOutQuart \image qeasingcurve-inoutquart.png + \caption Easing curve for a quartic (t^4) function: acceleration until halfway, then deceleration. - \value OutInQuart \inlineimage qeasingcurve-outinquart.png - \br + \value OutInQuart \image qeasingcurve-outinquart.png + \caption Easing curve for a quartic (t^4) function: deceleration until halfway, then acceleration. - \value InQuint \inlineimage qeasingcurve-inquint.png - \br + \value InQuint \image qeasingcurve-inquint.png + \caption Easing curve for a quintic (t^5) easing in: accelerating from zero velocity. - \value OutQuint \inlineimage qeasingcurve-outquint.png - \br + \value OutQuint \image qeasingcurve-outquint.png + \caption Easing curve for a quintic (t^5) function: decelerating to zero velocity. - \value InOutQuint \inlineimage qeasingcurve-inoutquint.png - \br + \value InOutQuint \image qeasingcurve-inoutquint.png + \caption Easing curve for a quintic (t^5) function: acceleration until halfway, then deceleration. - \value OutInQuint \inlineimage qeasingcurve-outinquint.png - \br + \value OutInQuint \image qeasingcurve-outinquint.png + \caption Easing curve for a quintic (t^5) function: deceleration until halfway, then acceleration. - \value InSine \inlineimage qeasingcurve-insine.png - \br + \value InSine \image qeasingcurve-insine.png + \caption Easing curve for a sinusoidal (sin(t)) function: accelerating from zero velocity. - \value OutSine \inlineimage qeasingcurve-outsine.png - \br + \value OutSine \image qeasingcurve-outsine.png + \caption Easing curve for a sinusoidal (sin(t)) function: decelerating from zero velocity. - \value InOutSine \inlineimage qeasingcurve-inoutsine.png - \br + \value InOutSine \image qeasingcurve-inoutsine.png + \caption Easing curve for a sinusoidal (sin(t)) function: acceleration until halfway, then deceleration. - \value OutInSine \inlineimage qeasingcurve-outinsine.png - \br + \value OutInSine \image qeasingcurve-outinsine.png + \caption Easing curve for a sinusoidal (sin(t)) function: deceleration until halfway, then acceleration. - \value InExpo \inlineimage qeasingcurve-inexpo.png - \br + \value InExpo \image qeasingcurve-inexpo.png + \caption Easing curve for an exponential (2^t) function: accelerating from zero velocity. - \value OutExpo \inlineimage qeasingcurve-outexpo.png - \br + \value OutExpo \image qeasingcurve-outexpo.png + \caption Easing curve for an exponential (2^t) function: decelerating from zero velocity. - \value InOutExpo \inlineimage qeasingcurve-inoutexpo.png - \br + \value InOutExpo \image qeasingcurve-inoutexpo.png + \caption Easing curve for an exponential (2^t) function: acceleration until halfway, then deceleration. - \value OutInExpo \inlineimage qeasingcurve-outinexpo.png - \br + \value OutInExpo \image qeasingcurve-outinexpo.png + \caption Easing curve for an exponential (2^t) function: deceleration until halfway, then acceleration. - \value InCirc \inlineimage qeasingcurve-incirc.png - \br + \value InCirc \image qeasingcurve-incirc.png + \caption Easing curve for a circular (sqrt(1-t^2)) function: accelerating from zero velocity. - \value OutCirc \inlineimage qeasingcurve-outcirc.png - \br + \value OutCirc \image qeasingcurve-outcirc.png + \caption Easing curve for a circular (sqrt(1-t^2)) function: decelerating from zero velocity. - \value InOutCirc \inlineimage qeasingcurve-inoutcirc.png - \br + \value InOutCirc \image qeasingcurve-inoutcirc.png + \caption Easing curve for a circular (sqrt(1-t^2)) function: acceleration until halfway, then deceleration. - \value OutInCirc \inlineimage qeasingcurve-outincirc.png - \br + \value OutInCirc \image qeasingcurve-outincirc.png + \caption Easing curve for a circular (sqrt(1-t^2)) function: deceleration until halfway, then acceleration. - \value InElastic \inlineimage qeasingcurve-inelastic.png - \br + \value InElastic \image qeasingcurve-inelastic.png + \caption Easing curve for an elastic (exponentially decaying sine wave) function: accelerating from zero velocity. The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. - \value OutElastic \inlineimage qeasingcurve-outelastic.png - \br + \value OutElastic \image qeasingcurve-outelastic.png + \caption Easing curve for an elastic (exponentially decaying sine wave) function: decelerating from zero velocity. The peak amplitude can be set with the \e amplitude parameter, and the period of decay by the \e period parameter. - \value InOutElastic \inlineimage qeasingcurve-inoutelastic.png - \br + \value InOutElastic \image qeasingcurve-inoutelastic.png + \caption Easing curve for an elastic (exponentially decaying sine wave) function: acceleration until halfway, then deceleration. - \value OutInElastic \inlineimage qeasingcurve-outinelastic.png - \br + \value OutInElastic \image qeasingcurve-outinelastic.png + \caption Easing curve for an elastic (exponentially decaying sine wave) function: deceleration until halfway, then acceleration. - \value InBack \inlineimage qeasingcurve-inback.png - \br + \value InBack \image qeasingcurve-inback.png + \caption Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity. - \value OutBack \inlineimage qeasingcurve-outback.png - \br + \value OutBack \image qeasingcurve-outback.png + \caption Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing out: decelerating to zero velocity. - \value InOutBack \inlineimage qeasingcurve-inoutback.png - \br + \value InOutBack \image qeasingcurve-inoutback.png + \caption Easing curve for a back (overshooting cubic function: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration. - \value OutInBack \inlineimage qeasingcurve-outinback.png - \br + \value OutInBack \image qeasingcurve-outinback.png + \caption Easing curve for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration. - \value InBounce \inlineimage qeasingcurve-inbounce.png - \br + \value InBounce \image qeasingcurve-inbounce.png + \caption Easing curve for a bounce (exponentially decaying parabolic bounce) function: accelerating from zero velocity. - \value OutBounce \inlineimage qeasingcurve-outbounce.png - \br + \value OutBounce \image qeasingcurve-outbounce.png + \caption Easing curve for a bounce (exponentially decaying parabolic bounce) function: decelerating from zero velocity. - \value InOutBounce \inlineimage qeasingcurve-inoutbounce.png - \br + \value InOutBounce \image qeasingcurve-inoutbounce.png + \caption Easing curve for a bounce (exponentially decaying parabolic bounce) function easing in/out: acceleration until halfway, then deceleration. - \value OutInBounce \inlineimage qeasingcurve-outinbounce.png - \br + \value OutInBounce \image qeasingcurve-outinbounce.png + \caption Easing curve for a bounce (exponentially decaying parabolic bounce) function easing out/in: deceleration until halfway, then acceleration. @@ -312,7 +302,7 @@ This is a typedef for a pointer to a function with the following signature: - \snippet doc/src/snippets/code/src_corelib_tools_qeasingcurve.cpp 0 + \snippet code/src_corelib_tools_qeasingcurve.cpp 0 */ #include "qeasingcurve.h" @@ -1467,7 +1457,7 @@ QDataStream &operator<<(QDataStream &stream, const QEasingCurve &easing) /*! \fn QDataStream &operator>>(QDataStream &stream, QEasingCurve &easing) - \relates QQuaternion + \relates QEasingCurve Reads an easing curve from the given \a stream into the given \a easing curve and returns a reference to the stream. diff --git a/src/corelib/tools/qelapsedtimer.cpp b/src/corelib/tools/qelapsedtimer.cpp index e8f2ce1..76b0d79 100644 --- a/src/corelib/tools/qelapsedtimer.cpp +++ b/src/corelib/tools/qelapsedtimer.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE spent in a slow operation. The simplest example of such a case is for debugging purposes, as in the following example: - \snippet doc/src/snippets/qelapsedtimer/main.cpp 0 + \snippet qelapsedtimer/main.cpp 0 In this example, the timer is started by a call to start() and the elapsed timer is calculated by the elapsed() function. @@ -76,14 +76,14 @@ QT_BEGIN_NAMESPACE subclasses are good examples of such need. In that case, the code could be as follows: - \snippet doc/src/snippets/qelapsedtimer/main.cpp 1 + \snippet qelapsedtimer/main.cpp 1 Another use-case is to execute a certain operation for a specific timeslice. For this, QElapsedTimer provides the hasExpired() convenience function, which can be used to determine if a certain number of milliseconds has already elapsed: - \snippet doc/src/snippets/qelapsedtimer/main.cpp 2 + \snippet qelapsedtimer/main.cpp 2 \section1 Reference clocks diff --git a/src/corelib/tools/qelapsedtimer_generic.cpp b/src/corelib/tools/qelapsedtimer_generic.cpp index 05214f0..a20b6b5 100644 --- a/src/corelib/tools/qelapsedtimer_generic.cpp +++ b/src/corelib/tools/qelapsedtimer_generic.cpp @@ -70,7 +70,7 @@ bool QElapsedTimer::isMonotonic() Starts this timer. Once started, a timer value can be checked with elapsed() or msecsSinceReference(). Normally, a timer is started just before a lengthy operation, such as: - \snippet doc/src/snippets/qelapsedtimer/main.cpp 0 + \snippet qelapsedtimer/main.cpp 0 Also, starting a timer makes it valid again. @@ -91,7 +91,7 @@ void QElapsedTimer::start() parameter to a slow operation (for example, an iteration count) so that this operation takes at least 250 milliseconds: - \snippet doc/src/snippets/qelapsedtimer/main.cpp 3 + \snippet qelapsedtimer/main.cpp 3 \sa start(), invalidate(), elapsed() */ diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 20202a4..a2851d1 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -694,21 +694,21 @@ void QHashData::checkSanity() \endlist Here's an example QHash with QString keys and \c int values: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 0 + \snippet code/src_corelib_tools_qhash.cpp 0 To insert a (key, value) pair into the hash, you can use operator[](): - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 1 + \snippet code/src_corelib_tools_qhash.cpp 1 This inserts the following three (key, value) pairs into the QHash: ("one", 1), ("three", 3), and ("seven", 7). Another way to insert items into the hash is to use insert(): - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 2 + \snippet code/src_corelib_tools_qhash.cpp 2 To look up a value, use operator[]() or value(): - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 3 + \snippet code/src_corelib_tools_qhash.cpp 3 If there is no item with the specified key in the hash, these functions return a \l{default-constructed value}. @@ -716,12 +716,12 @@ void QHashData::checkSanity() If you want to check whether the hash contains a particular key, use contains(): - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 4 + \snippet code/src_corelib_tools_qhash.cpp 4 There is also a value() overload that uses its second argument as a default value if there is no item with the specified key: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 5 + \snippet code/src_corelib_tools_qhash.cpp 5 In general, we recommend that you use contains() and value() rather than operator[]() for looking up a key in a hash. The @@ -730,7 +730,7 @@ void QHashData::checkSanity() const). For example, the following code snippet will create 1000 items in memory: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 6 + \snippet code/src_corelib_tools_qhash.cpp 6 To avoid this problem, replace \c hash[i] with \c hash.value(i) in the code above. @@ -751,11 +751,11 @@ void QHashData::checkSanity() QHash::iterator). Here's how to iterate over a QHash using a Java-style iterator: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 7 + \snippet code/src_corelib_tools_qhash.cpp 7 Here's the same code, but using an STL-style iterator: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 8 + \snippet code/src_corelib_tools_qhash.cpp 8 QHash is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap. @@ -764,7 +764,7 @@ void QHashData::checkSanity() insert() with a key that already exists in the QHash, the previous value is erased. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 9 + \snippet code/src_corelib_tools_qhash.cpp 9 However, you can store multiple values per key by using insertMulti() instead of insert() (or using the convenience @@ -772,19 +772,19 @@ void QHashData::checkSanity() the values for a single key, you can use values(const Key &key), which returns a QList: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 10 + \snippet code/src_corelib_tools_qhash.cpp 10 The items that share the same key are available from most recently to least recently inserted. A more efficient approach is to call find() to get the iterator for the first item with a key and iterate from there: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 11 + \snippet code/src_corelib_tools_qhash.cpp 11 If you only need to extract the values from a hash (not the keys), you can also use \l{foreach}: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 12 + \snippet code/src_corelib_tools_qhash.cpp 12 Items can be removed from the hash in several ways. One way is to call remove(); this will remove any item with the given key. @@ -975,7 +975,7 @@ void QHashData::checkSanity() This function is useful for code that needs to build a huge hash and wants to avoid repeated reallocation. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 14 + \snippet code/src_corelib_tools_qhash.cpp 14 Ideally, \a size should be slightly more than the maximum number of items expected in the hash. \a size doesn't have to be prime, @@ -1284,7 +1284,7 @@ void QHashData::checkSanity() be called while iterating, and won't affect the order of items in the hash. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 15 + \snippet code/src_corelib_tools_qhash.cpp 15 \sa remove(), take(), find() */ @@ -1303,7 +1303,7 @@ void QHashData::checkSanity() the iterator. For example, here's some code that iterates over all the items with the same key: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 16 + \snippet code/src_corelib_tools_qhash.cpp 16 \sa value(), values(), QMultiHash::find() */ @@ -1460,7 +1460,7 @@ void QHashData::checkSanity() start iterating. Here's a typical loop that prints all the (key, value) pairs stored in a hash: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 17 + \snippet code/src_corelib_tools_qhash.cpp 17 Unlike QMap, which orders its items by key, QHash stores its items in an arbitrary order. The only guarantee is that items that @@ -1473,22 +1473,22 @@ void QHashData::checkSanity() Here's an example that increments every value stored in the QHash by 2: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 18 + \snippet code/src_corelib_tools_qhash.cpp 18 Here's an example that removes all the items whose key is a string that starts with an underscore character: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 19 + \snippet code/src_corelib_tools_qhash.cpp 19 The call to QHash::erase() removes the item pointed to by the iterator from the hash, and returns an iterator to the next item. Here's another way of removing an item while iterating: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 20 + \snippet code/src_corelib_tools_qhash.cpp 20 It might be tempting to write code like this: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 21 + \snippet code/src_corelib_tools_qhash.cpp 21 However, this will potentially crash in \c{++i}, because \c i is a dangling iterator after the call to erase(). @@ -1514,7 +1514,7 @@ void QHashData::checkSanity() called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QHash::begin() QHash::end() + \sa QHash::begin(), QHash::end() */ /*! \fn QHash::iterator::iterator(void *node) @@ -1540,7 +1540,7 @@ void QHashData::checkSanity() You can change the value of an item by using value() on the left side of an assignment, for example: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 22 + \snippet code/src_corelib_tools_qhash.cpp 22 \sa key(), operator*() */ @@ -1684,7 +1684,7 @@ void QHashData::checkSanity() QHash::find() before you can start iterating. Here's a typical loop that prints all the (key, value) pairs stored in a hash: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 23 + \snippet code/src_corelib_tools_qhash.cpp 23 Unlike QMap, which orders its items by key, QHash stores its items in an arbitrary order. The only guarantee is that items that @@ -1710,7 +1710,7 @@ void QHashData::checkSanity() called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QHash::constBegin() QHash::constEnd() + \sa QHash::constBegin(), QHash::constEnd() */ /*! \fn QHash::const_iterator::const_iterator(void *node) @@ -1897,7 +1897,7 @@ void QHashData::checkSanity() operator+=(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 24 + \snippet code/src_corelib_tools_qhash.cpp 24 Unlike QHash, QMultiHash provides no operator[]. Use value() or replace() if you want to access the most recently inserted item @@ -1906,7 +1906,7 @@ void QHashData::checkSanity() If you want to retrieve all the values for a single key, you can use values(const Key &key), which returns a QList: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 25 + \snippet code/src_corelib_tools_qhash.cpp 25 The items that share the same key are available from most recently to least recently inserted. @@ -1915,7 +1915,7 @@ void QHashData::checkSanity() the STL-style iterator for the first item with a key and iterate from there: - \snippet doc/src/snippets/code/src_corelib_tools_qhash.cpp 26 + \snippet code/src_corelib_tools_qhash.cpp 26 QMultiHash's key and value data types must be \l{assignable data types}. You cannot, for example, store a QWidget as a value; diff --git a/src/corelib/tools/qiterator.qdoc b/src/corelib/tools/qiterator.qdoc index e19a751..508664e 100644 --- a/src/corelib/tools/qiterator.qdoc +++ b/src/corelib/tools/qiterator.qdoc @@ -50,7 +50,7 @@ the list (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 0 + \snippet code/doc_src_qiterator.cpp 0 The next() function returns the next item in the list and advances the iterator. Unlike STL-style iterators, Java-style @@ -61,11 +61,11 @@ position between the second and third item, and returns the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 1 + \snippet code/doc_src_qiterator.cpp 1 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -98,7 +98,7 @@ beginning of the list (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 2 + \snippet code/doc_src_qiterator.cpp 2 The next() function returns the next item in the list and advances the iterator. Unlike STL-style iterators, Java-style @@ -109,11 +109,11 @@ position between the second and third item, and returns the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 3 + \snippet code/doc_src_qiterator.cpp 3 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -150,7 +150,7 @@ of the vector (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 4 + \snippet code/doc_src_qiterator.cpp 4 The next() function returns the next item in the vector and advances the iterator. Unlike STL-style iterators, Java-style @@ -161,11 +161,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 5 + \snippet code/doc_src_qiterator.cpp 5 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -197,7 +197,7 @@ the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 6 + \snippet code/doc_src_qiterator.cpp 6 The next() function returns the next item in the set and advances the iterator. Unlike STL-style iterators, Java-style @@ -208,11 +208,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 7 + \snippet code/doc_src_qiterator.cpp 7 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -251,7 +251,7 @@ of the list (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 8 + \snippet code/doc_src_qiterator.cpp 8 The next() function returns the next item in the list and advances the iterator. Unlike STL-style iterators, Java-style @@ -262,11 +262,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 9 + \snippet code/doc_src_qiterator.cpp 9 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -277,7 +277,7 @@ insert(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 10 + \snippet code/doc_src_qiterator.cpp 10 The example traverses a list, replacing negative numbers with their absolute values, and eliminating zeroes. @@ -312,7 +312,7 @@ beginning of the list (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 11 + \snippet code/doc_src_qiterator.cpp 11 The next() function returns the next item in the list and advances the iterator. Unlike STL-style iterators, Java-style @@ -323,11 +323,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 12 + \snippet code/doc_src_qiterator.cpp 12 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -338,7 +338,7 @@ insert(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 13 + \snippet code/doc_src_qiterator.cpp 13 The example traverses a list, replacing negative numbers with their absolute values, and eliminating zeroes. @@ -378,7 +378,7 @@ beginning of the list (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 14 + \snippet code/doc_src_qiterator.cpp 14 The next() function returns the next item in the vector and advances the iterator. Unlike STL-style iterators, Java-style @@ -389,11 +389,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 15 + \snippet code/doc_src_qiterator.cpp 15 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. @@ -404,7 +404,7 @@ insert(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 16 + \snippet code/doc_src_qiterator.cpp 16 The example traverses a vector, replacing negative numbers with their absolute values, and eliminating zeroes. @@ -440,7 +440,7 @@ of the set (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 17 + \snippet code/doc_src_qiterator.cpp 17 The next() function returns the next item in the set and advances the iterator. Unlike STL-style iterators, Java-style @@ -451,11 +451,11 @@ position between the second and third item, returning the second item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 18 + \snippet code/doc_src_qiterator.cpp 18 If you want to remove items as you iterate over the set, use remove(). @@ -755,7 +755,7 @@ traversal functions (next(), previous(), findNext(), findPrevious()). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 19 + \snippet code/doc_src_qiterator.cpp 19 \sa insert(), setValue() */ @@ -766,7 +766,7 @@ traversal functions (next(), previous(), findNext(), findPrevious()). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 20 + \snippet code/doc_src_qiterator.cpp 20 \sa insert(), setValue() */ @@ -777,7 +777,7 @@ traversal functions (next(), previous(), findNext(), findPrevious()). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 21 + \snippet code/doc_src_qiterator.cpp 21 \sa insert(), setValue() */ @@ -788,7 +788,7 @@ traversal functions (next(), previous(), findNext(), findPrevious()). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 22 + \snippet code/doc_src_qiterator.cpp 22 \sa value() */ @@ -802,7 +802,7 @@ findPrevious(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 23 + \snippet code/doc_src_qiterator.cpp 23 \sa value(), remove(), insert() */ @@ -816,7 +816,7 @@ findPrevious(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 24 + \snippet code/doc_src_qiterator.cpp 24 \sa value(), remove(), insert() */ @@ -830,7 +830,7 @@ findPrevious(). Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 25 + \snippet code/doc_src_qiterator.cpp 25 \sa value(), remove(), insert() */ @@ -889,7 +889,7 @@ the map (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 26 + \snippet code/doc_src_qiterator.cpp 26 The next() function returns the next item in the map and advances the iterator. The key() and value() functions return the @@ -902,16 +902,16 @@ next() advances the iterator to the position between the second and third item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 27 + \snippet code/doc_src_qiterator.cpp 27 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. For example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 28 + \snippet code/doc_src_qiterator.cpp 28 Multiple iterators can be used on the same map. If the map is modified while a QMapIterator is active, the QMapIterator will @@ -941,7 +941,7 @@ the hash (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 29 + \snippet code/doc_src_qiterator.cpp 29 The next() function returns the next item in the hash and advances the iterator. The key() and value() functions return the @@ -954,16 +954,16 @@ next() advances the iterator to the position between the second and third item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 30 + \snippet code/doc_src_qiterator.cpp 30 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. For example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 31 + \snippet code/doc_src_qiterator.cpp 31 Multiple iterators can be used on the same hash. If the hash is modified while a QHashIterator is active, the QHashIterator will @@ -994,7 +994,7 @@ of the map (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 32 + \snippet code/doc_src_qiterator.cpp 32 The next() function returns the next item in the map and advances the iterator. The key() and value() functions return the @@ -1007,16 +1007,16 @@ next() advances the iterator to the position between the second and third item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 33 + \snippet code/doc_src_qiterator.cpp 33 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. For example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 34 + \snippet code/doc_src_qiterator.cpp 34 If you want to remove items as you iterate over the map, use remove(). If you want to modify the value of an item, use @@ -1024,7 +1024,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 35 + \snippet code/doc_src_qiterator.cpp 35 The example removes all (key, value) pairs where the key and the value are the same. @@ -1059,7 +1059,7 @@ of the hash (before the first item). Here's how to iterate over all the elements sequentially: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 36 + \snippet code/doc_src_qiterator.cpp 36 The next() function returns the next item in the hash and advances the iterator. The key() and value() functions return the @@ -1072,16 +1072,16 @@ next() advances the iterator to the position between the second and third item; and so on. - \img javaiterators1.png + \image javaiterators1.png Here's how to iterate over the elements in reverse order: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 37 + \snippet code/doc_src_qiterator.cpp 37 If you want to find all occurrences of a particular value, use findNext() or findPrevious() in a loop. For example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 38 + \snippet code/doc_src_qiterator.cpp 38 If you want to remove items as you iterate over the hash, use remove(). If you want to modify the value of an item, use @@ -1089,7 +1089,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qiterator.cpp 39 + \snippet code/doc_src_qiterator.cpp 39 The example removes all (key, value) pairs where the key and the value are the same. diff --git a/src/corelib/tools/qlinkedlist.cpp b/src/corelib/tools/qlinkedlist.cpp index 1502f70..3682818 100644 --- a/src/corelib/tools/qlinkedlist.cpp +++ b/src/corelib/tools/qlinkedlist.cpp @@ -81,13 +81,13 @@ const QLinkedListData QLinkedListData::shared_null = { Here's an example of a QLinkedList that stores integers and a QLinkedList that stores QTime values: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 0 + \snippet code/src_corelib_tools_qlinkedlist.cpp 0 QLinkedList stores a list of items. The default constructor creates an empty list. To insert items into the list, you can use operator<<(): - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 1 + \snippet code/src_corelib_tools_qlinkedlist.cpp 1 If you want to get the first or last item in a linked list, use first() or last(). If you want to remove an item from either end @@ -99,7 +99,7 @@ const QLinkedListData QLinkedListData::shared_null = { list and do something with it. For this, QLinkedList provides takeFirst() and takeLast(). Here's a loop that removes the items from a list one at a time and calls \c delete on them: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 2 + \snippet code/src_corelib_tools_qlinkedlist.cpp 2 QLinkedList's value type must be an \l {assignable data type}. This covers most data types that are commonly used, but the compiler @@ -230,7 +230,7 @@ const QLinkedListData QLinkedListData::shared_null = { Inserts \a value at the end of the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 3 + \snippet code/src_corelib_tools_qlinkedlist.cpp 3 This is the same as list.insert(end(), \a value). @@ -242,7 +242,7 @@ const QLinkedListData QLinkedListData::shared_null = { Inserts \a value at the beginning of the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 4 + \snippet code/src_corelib_tools_qlinkedlist.cpp 4 This is the same as list.insert(begin(), \a value). @@ -254,7 +254,7 @@ const QLinkedListData QLinkedListData::shared_null = { Removes all occurrences of \a value in the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 5 + \snippet code/src_corelib_tools_qlinkedlist.cpp 5 This function requires the value type to have an implementation of \c operator==(). @@ -270,7 +270,7 @@ const QLinkedListData QLinkedListData::shared_null = { success; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 6 + \snippet code/src_corelib_tools_qlinkedlist.cpp 6 This function requires the value type to have an implementation of \c operator==(). @@ -635,35 +635,35 @@ const QLinkedListData QLinkedListData::shared_null = { QLinkedList::insert() before you can start iterating. Here's a typical loop that prints all the items stored in a list: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 7 + \snippet code/src_corelib_tools_qlinkedlist.cpp 7 STL-style iterators can be used as arguments to \l{generic algorithms}. For example, here's how to find an item in the list using the qFind() algorithm: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 8 + \snippet code/src_corelib_tools_qlinkedlist.cpp 8 Let's see a few examples of things we can do with a QLinkedList::iterator that we cannot do with a QLinkedList::const_iterator. Here's an example that increments every value stored in a QLinkedList\ by 2: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 9 + \snippet code/src_corelib_tools_qlinkedlist.cpp 9 Here's an example that removes all the items that start with an underscore character in a QLinkedList\: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 10 + \snippet code/src_corelib_tools_qlinkedlist.cpp 10 The call to QLinkedList::erase() removes the item pointed to by the iterator from the list, and returns an iterator to the next item. Here's another way of removing an item while iterating: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 11 + \snippet code/src_corelib_tools_qlinkedlist.cpp 11 It might be tempting to write code like this: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 12 + \snippet code/src_corelib_tools_qlinkedlist.cpp 12 However, this will potentially crash in \c{++i}, because \c i is a dangling iterator after the call to erase(). @@ -686,7 +686,7 @@ const QLinkedListData QLinkedListData::shared_null = { on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QLinkedList::begin() QLinkedList::end() + \sa QLinkedList::begin(), QLinkedList::end() */ /*! \fn QLinkedList::iterator::iterator(Node *node) @@ -736,7 +736,7 @@ const QLinkedListData QLinkedListData::shared_null = { You can change the value of an item by using operator*() on the left side of an assignment, for example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 13 + \snippet code/src_corelib_tools_qlinkedlist.cpp 13 \sa operator->() */ @@ -868,13 +868,13 @@ const QLinkedListData QLinkedListData::shared_null = { QLinkedList::insert() before you can start iterating. Here's a typical loop that prints all the items stored in a list: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 14 + \snippet code/src_corelib_tools_qlinkedlist.cpp 14 STL-style iterators can be used as arguments to \l{generic algorithms}. For example, here's how to find an item in the list using the qFind() algorithm: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 15 + \snippet code/src_corelib_tools_qlinkedlist.cpp 15 Multiple iterators can be used on the same list. If you add items to the list, existing iterators will remain valid. If you remove @@ -892,7 +892,7 @@ const QLinkedListData QLinkedListData::shared_null = { on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QLinkedList::constBegin() QLinkedList::constEnd() + \sa QLinkedList::constBegin(), QLinkedList::constEnd() */ /*! \fn QLinkedList::const_iterator::const_iterator(Node *node) @@ -1082,7 +1082,7 @@ const QLinkedListData QLinkedListData::shared_null = { Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 16 + \snippet code/src_corelib_tools_qlinkedlist.cpp 16 \sa toStdList() */ @@ -1094,7 +1094,7 @@ const QLinkedListData QLinkedListData::shared_null = { Returns a std::list object with the data contained in this QLinkedList. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlinkedlist.cpp 17 + \snippet code/src_corelib_tools_qlinkedlist.cpp 17 \sa fromStdList() */ diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index c87b3e7..b3514d3 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -375,7 +375,7 @@ void **QListData::erase(void **xi) Here's an example of a QList that stores integers and a QList that stores QDate values: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 0 + \snippet code/src_corelib_tools_qlistdata.cpp 0 Qt includes a QStringList class that inherits QList\ and adds a few convenience functions, such as QStringList::join() @@ -386,7 +386,7 @@ void **QListData::erase(void **xi) empty list. To insert items into the list, you can use operator<<(): - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 1 + \snippet code/src_corelib_tools_qlistdata.cpp 1 QList provides these basic functions to add, move, and remove items: insert(), replace(), removeAt(), move(), and swap(). In @@ -398,13 +398,13 @@ void **QListData::erase(void **xi) non-const lists, operator[]() returns a reference to the item and can be used on the left side of an assignment: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 2 + \snippet code/src_corelib_tools_qlistdata.cpp 2 Because QList is implemented as an array of pointers, this operation is very fast (\l{constant time}). For read-only access, an alternative syntax is to use at(): - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 3 + \snippet code/src_corelib_tools_qlistdata.cpp 3 at() can be faster than operator[](), because it never causes a \l{deep copy} to occur. @@ -414,7 +414,7 @@ void **QListData::erase(void **xi) and takeLast(). Here's a loop that removes the items from a list one at a time and calls \c delete on them: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 4 + \snippet code/src_corelib_tools_qlistdata.cpp 4 Inserting and removing items at either ends of the list is very fast (\l{constant time} in most cases), because QList @@ -427,7 +427,7 @@ void **QListData::erase(void **xi) backward. Both return the index of a matching item if they find it; otherwise, they return -1. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 5 + \snippet code/src_corelib_tools_qlistdata.cpp 5 If you simply want to check whether a list contains a particular value, use contains(). If you want to find out how many times a @@ -652,7 +652,7 @@ void **QListData::erase(void **xi) Inserts \a value at the end of the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 6 + \snippet code/src_corelib_tools_qlistdata.cpp 6 This is the same as list.insert(size(), \a value). @@ -680,7 +680,7 @@ void **QListData::erase(void **xi) Inserts \a value at the beginning of the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 7 + \snippet code/src_corelib_tools_qlistdata.cpp 7 This is the same as list.insert(0, \a value). @@ -698,7 +698,7 @@ void **QListData::erase(void **xi) value is appended to the list. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 8 + \snippet code/src_corelib_tools_qlistdata.cpp 8 \sa append(), prepend(), replace(), removeAt() */ @@ -729,7 +729,7 @@ void **QListData::erase(void **xi) number of entries removed. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 9 + \snippet code/src_corelib_tools_qlistdata.cpp 9 This function requires the value type to have an implementation of \c operator==(). @@ -745,7 +745,7 @@ void **QListData::erase(void **xi) true on success; otherwise returns false. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 10 + \snippet code/src_corelib_tools_qlistdata.cpp 10 This function requires the value type to have an implementation of \c operator==(). @@ -805,7 +805,7 @@ void **QListData::erase(void **xi) Moves the item at index position \a from to index position \a to. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 11 + \snippet code/src_corelib_tools_qlistdata.cpp 11 This is the same as insert(\a{to}, takeAt(\a{from})).This function assumes that both \a from and \a to are at least 0 but less than @@ -823,7 +823,7 @@ void **QListData::erase(void **xi) \a i and \a j are at least 0 and less than size(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 12 + \snippet code/src_corelib_tools_qlistdata.cpp 12 \sa move() */ @@ -835,7 +835,7 @@ void **QListData::erase(void **xi) -1 if no item matched. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 13 + \snippet code/src_corelib_tools_qlistdata.cpp 13 This function requires the value type to have an implementation of \c operator==(). @@ -855,7 +855,7 @@ void **QListData::erase(void **xi) Returns -1 if no item matched. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 14 + \snippet code/src_corelib_tools_qlistdata.cpp 14 This function requires the value type to have an implementation of \c operator==(). @@ -1237,14 +1237,14 @@ void **QListData::erase(void **xi) start iterating. Here's a typical loop that prints all the items stored in a list: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 15 + \snippet code/src_corelib_tools_qlistdata.cpp 15 Let's see a few examples of things we can do with a QList::iterator that we cannot do with a QList::const_iterator. Here's an example that increments every value stored in a QList\ by 2: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 16 + \snippet code/src_corelib_tools_qlistdata.cpp 16 Most QList functions accept an integer index rather than an iterator. For that reason, iterators are rarely useful in @@ -1254,7 +1254,7 @@ void **QListData::erase(void **xi) For example, here's how to delete all the widgets stored in a QList\: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 17 + \snippet code/src_corelib_tools_qlistdata.cpp 17 Multiple iterators can be used on the same list. However, be aware that any non-const function call performed on the QList @@ -1299,7 +1299,7 @@ void **QListData::erase(void **xi) on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QList::begin() QList::end() + \sa QList::begin(), QList::end() */ /*! \fn QList::iterator::iterator(Node *node) @@ -1319,7 +1319,7 @@ void **QListData::erase(void **xi) You can change the value of an item by using operator*() on the left side of an assignment, for example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 18 + \snippet code/src_corelib_tools_qlistdata.cpp 18 \sa operator->() */ @@ -1493,7 +1493,7 @@ void **QListData::erase(void **xi) QList::insert() before you can start iterating. Here's a typical loop that prints all the items stored in a list: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 19 + \snippet code/src_corelib_tools_qlistdata.cpp 19 Most QList functions accept an integer index rather than an iterator. For that reason, iterators are rarely useful in @@ -1503,7 +1503,7 @@ void **QListData::erase(void **xi) For example, here's how to delete all the widgets stored in a QList\: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 20 + \snippet code/src_corelib_tools_qlistdata.cpp 20 Multiple iterators can be used on the same list. However, be aware that any non-const function call performed on the QList @@ -1522,7 +1522,7 @@ void **QListData::erase(void **xi) on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QList::constBegin() QList::constEnd() + \sa QList::constBegin(), QList::constEnd() */ /*! \typedef QList::const_iterator::iterator_category @@ -1738,7 +1738,7 @@ void **QListData::erase(void **xi) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 21 + \snippet code/src_corelib_tools_qlistdata.cpp 21 \sa fromSet(), toVector(), QVector::toList() */ @@ -1749,7 +1749,7 @@ void **QListData::erase(void **xi) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 22 + \snippet code/src_corelib_tools_qlistdata.cpp 22 \sa toSet(), fromVector(), QVector::fromList() */ @@ -1761,7 +1761,7 @@ void **QListData::erase(void **xi) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 23 + \snippet code/src_corelib_tools_qlistdata.cpp 23 \sa fromVector(), toSet(), QSet::toList(), qSort() */ @@ -1774,7 +1774,7 @@ void **QListData::erase(void **xi) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 24 + \snippet code/src_corelib_tools_qlistdata.cpp 24 \sa toVector(), fromSet(), QSet::fromList() */ @@ -1786,7 +1786,7 @@ void **QListData::erase(void **xi) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 25 + \snippet code/src_corelib_tools_qlistdata.cpp 25 \sa toStdList(), QVector::fromStdVector() */ @@ -1796,7 +1796,7 @@ void **QListData::erase(void **xi) Returns a std::list object with the data contained in this QList. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlistdata.cpp 26 + \snippet code/src_corelib_tools_qlistdata.cpp 26 \sa fromStdList(), QVector::toStdVector() */ diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index b9f199e..791e8d0 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -681,7 +681,7 @@ QLocale::QLocale() The language and country that are actually used can be queried using language() and country(). - \sa setDefault() language() country() + \sa setDefault(), language(), country() */ QLocale::QLocale(Language language, Country country) @@ -720,7 +720,7 @@ QLocale::QLocale(Language language, Country country) The language, script and country that are actually used can be queried using language(), script() and country(). - \sa setDefault() language() script() country() + \sa setDefault(), language(), script(), country() */ QLocale::QLocale(Language language, Script script, Country country) @@ -883,7 +883,7 @@ QString QLocale::createSeparatedList(const QStringList &list) const should be set at application startup, before any non-GUI threads are created. - \sa system() c() + \sa system(), c() */ void QLocale::setDefault(const QLocale &locale) @@ -1202,7 +1202,7 @@ float QLocale::toFloat(const QString &s, bool *ok) const the "C" locale if the string cannot be interpreted in this locale. - \snippet doc/src/snippets/code/src_corelib_tools_qlocale.cpp 3 + \snippet code/src_corelib_tools_qlocale.cpp 3 Notice that the last conversion returns 1234.0, because '.' is the thousands group separator in the German locale. diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 32822c2..ed80984 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -42,7 +42,7 @@ Example: - \snippet doc/src/snippets/code/src_corelib_tools_qlocale.cpp 0 + \snippet code/src_corelib_tools_qlocale.cpp 0 QLocale supports the concept of a default locale, which is determined from the system's locale settings at application @@ -63,7 +63,7 @@ The following example illustrates how to use QLocale directly: - \snippet doc/src/snippets/code/src_corelib_tools_qlocale.cpp 1 + \snippet code/src_corelib_tools_qlocale.cpp 1 When a language/country pair is specified in the constructor, one of three things can happen: @@ -83,7 +83,7 @@ An alternative method for constructing a QLocale object is by specifying the locale name. - \snippet doc/src/snippets/code/src_corelib_tools_qlocale.cpp 2 + \snippet code/src_corelib_tools_qlocale.cpp 2 This constructor converts the locale name to a language/country pair; it does not use the system locale database. @@ -662,7 +662,7 @@ will fail if they encounter group separators in their input. The default is to accept numbers containing correctly placed group separators. - \sa setNumberOptions() numberOptions() + \sa setNumberOptions(), numberOptions() */ /*! diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp index 90521d3..8002e7c 100644 --- a/src/corelib/tools/qmap.cpp +++ b/src/corelib/tools/qmap.cpp @@ -388,21 +388,21 @@ void QMapDataBase::freeData(QMapDataBase *d) \endlist Here's an example QMap with QString keys and \c int values: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 0 + \snippet code/src_corelib_tools_qmap.cpp 0 To insert a (key, value) pair into the map, you can use operator[](): - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 1 + \snippet code/src_corelib_tools_qmap.cpp 1 This inserts the following three (key, value) pairs into the QMap: ("one", 1), ("three", 3), and ("seven", 7). Another way to insert items into the map is to use insert(): - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 2 + \snippet code/src_corelib_tools_qmap.cpp 2 To look up a value, use operator[]() or value(): - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 3 + \snippet code/src_corelib_tools_qmap.cpp 3 If there is no item with the specified key in the map, these functions return a \l{default-constructed value}. @@ -410,12 +410,12 @@ void QMapDataBase::freeData(QMapDataBase *d) If you want to check whether the map contains a certain key, use contains(): - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 4 + \snippet code/src_corelib_tools_qmap.cpp 4 There is also a value() overload that uses its second argument as a default value if there is no item with the specified key: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 5 + \snippet code/src_corelib_tools_qmap.cpp 5 In general, we recommend that you use contains() and value() rather than operator[]() for looking up a key in a map. The @@ -424,7 +424,7 @@ void QMapDataBase::freeData(QMapDataBase *d) const). For example, the following code snippet will create 1000 items in memory: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 6 + \snippet code/src_corelib_tools_qmap.cpp 6 To avoid this problem, replace \c map[i] with \c map.value(i) in the code above. @@ -436,11 +436,11 @@ void QMapDataBase::freeData(QMapDataBase *d) QMap::iterator). Here's how to iterate over a QMap using a Java-style iterator: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 7 + \snippet code/src_corelib_tools_qmap.cpp 7 Here's the same code, but using an STL-style iterator this time: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 8 + \snippet code/src_corelib_tools_qmap.cpp 8 The items are traversed in ascending key order. @@ -448,7 +448,7 @@ void QMapDataBase::freeData(QMapDataBase *d) insert() with a key that already exists in the QMap, the previous value will be erased. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 9 + \snippet code/src_corelib_tools_qmap.cpp 9 However, you can store multiple values per key by using insertMulti() instead of insert() (or using the convenience @@ -456,19 +456,19 @@ void QMapDataBase::freeData(QMapDataBase *d) single key, you can use values(const Key &key), which returns a QList: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 10 + \snippet code/src_corelib_tools_qmap.cpp 10 The items that share the same key are available from most recently to least recently inserted. Another approach is to call find() to get the STL-style iterator for the first item with a key and iterate from there: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 11 + \snippet code/src_corelib_tools_qmap.cpp 11 If you only need to extract the values from a map (not the keys), you can also use \l{foreach}: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 12 + \snippet code/src_corelib_tools_qmap.cpp 12 Items can be removed from the map in several ways. One way is to call remove(); this will remove any item with the given key. @@ -484,7 +484,7 @@ void QMapDataBase::freeData(QMapDataBase *d) < y} nor \c{y < x} is true. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 13 + \snippet code/src_corelib_tools_qmap.cpp 13 In the example, we start by comparing the employees' names. If they're equal, we compare their dates of birth to break the tie. @@ -881,7 +881,7 @@ void QMapDataBase::freeData(QMapDataBase *d) the iterator. For example, here's some code that iterates over all the items with the same key: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 14 + \snippet code/src_corelib_tools_qmap.cpp 14 \sa constFind(), value(), values(), lowerBound(), upperBound(), QMultiMap::find() */ @@ -911,7 +911,7 @@ void QMapDataBase::freeData(QMapDataBase *d) key. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 15 + \snippet code/src_corelib_tools_qmap.cpp 15 If the map contains multiple items with key \a key, this function returns an iterator that points to the most recently @@ -919,7 +919,7 @@ void QMapDataBase::freeData(QMapDataBase *d) the iterator. For example, here's some code that iterates over all the items with the same key: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 16 + \snippet code/src_corelib_tools_qmap.cpp 16 \sa qLowerBound(), upperBound(), find() */ @@ -937,7 +937,7 @@ void QMapDataBase::freeData(QMapDataBase *d) nearest item with a greater key. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 17 + \snippet code/src_corelib_tools_qmap.cpp 17 \sa qUpperBound(), lowerBound(), find() */ @@ -1042,7 +1042,7 @@ void QMapDataBase::freeData(QMapDataBase *d) start iterating. Here's a typical loop that prints all the (key, value) pairs stored in a map: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 18 + \snippet code/src_corelib_tools_qmap.cpp 18 Unlike QHash, which stores its items in an arbitrary order, QMap stores its items ordered by key. Items that share the same key @@ -1055,22 +1055,22 @@ void QMapDataBase::freeData(QMapDataBase *d) Here's an example that increments every value stored in the QMap by 2: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 19 + \snippet code/src_corelib_tools_qmap.cpp 19 Here's an example that removes all the items whose key is a string that starts with an underscore character: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 20 + \snippet code/src_corelib_tools_qmap.cpp 20 The call to QMap::erase() removes the item pointed to by the iterator from the map, and returns an iterator to the next item. Here's another way of removing an item while iterating: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 21 + \snippet code/src_corelib_tools_qmap.cpp 21 It might be tempting to write code like this: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 22 + \snippet code/src_corelib_tools_qmap.cpp 22 However, this will potentially crash in \c{++i}, because \c i is a dangling iterator after the call to erase(). @@ -1122,7 +1122,7 @@ void QMapDataBase::freeData(QMapDataBase *d) called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QMap::begin() QMap::end() + \sa QMap::begin(), QMap::end() */ /*! \fn QMap::iterator::iterator(QMapData::Node *node) @@ -1148,7 +1148,7 @@ void QMapDataBase::freeData(QMapDataBase *d) You can change the value of an item by using value() on the left side of an assignment, for example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 23 + \snippet code/src_corelib_tools_qmap.cpp 23 \sa key(), operator*() */ @@ -1289,7 +1289,7 @@ void QMapDataBase::freeData(QMapDataBase *d) QMap::find() before you can start iterating. Here's a typical loop that prints all the (key, value) pairs stored in a map: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 24 + \snippet code/src_corelib_tools_qmap.cpp 24 Unlike QHash, which stores its items in an arbitrary order, QMap stores its items ordered by key. Items that share the same key @@ -1344,7 +1344,7 @@ void QMapDataBase::freeData(QMapDataBase *d) called on an uninitialized iterator. Use operator=() to assign a value to it before using it. - \sa QMap::constBegin() QMap::constEnd() + \sa QMap::constBegin(), QMap::constEnd() */ /*! \fn QMap::const_iterator::const_iterator(QMapData::Node *node) @@ -1530,7 +1530,7 @@ void QMapDataBase::freeData(QMapDataBase *d) operator+=(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 25 + \snippet code/src_corelib_tools_qmap.cpp 25 Unlike QMap, QMultiMap provides no operator[]. Use value() or replace() if you want to access the most recently inserted item @@ -1539,7 +1539,7 @@ void QMapDataBase::freeData(QMapDataBase *d) If you want to retrieve all the values for a single key, you can use values(const Key &key), which returns a QList: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 26 + \snippet code/src_corelib_tools_qmap.cpp 26 The items that share the same key are available from most recently to least recently inserted. @@ -1548,7 +1548,7 @@ void QMapDataBase::freeData(QMapDataBase *d) the iterator for the first item with a key and iterate from there: - \snippet doc/src/snippets/code/src_corelib_tools_qmap.cpp 27 + \snippet code/src_corelib_tools_qmap.cpp 27 QMultiMap's key and value data types must be \l{assignable data types}. This covers most data types you are likely to encounter, diff --git a/src/corelib/tools/qpair.qdoc b/src/corelib/tools/qpair.qdoc index fdf1eaf..ddaf824 100644 --- a/src/corelib/tools/qpair.qdoc +++ b/src/corelib/tools/qpair.qdoc @@ -40,12 +40,12 @@ Here's an example of a QPair that stores one QString and one \c double value: - \snippet doc/src/snippets/code/doc_src_qpair.cpp 0 + \snippet code/doc_src_qpair.cpp 0 The components are accessible as public data members called \l first and \l second. For example: - \snippet doc/src/snippets/code/doc_src_qpair.cpp 1 + \snippet code/doc_src_qpair.cpp 1 QPair's template data types (T1 and T2) must be \l{assignable data types}. You cannot, for example, store a QWidget as a value; @@ -95,12 +95,6 @@ \sa qMakePair() */ -/*! - \fn QPair &QPair::operator=(const QPair &other) - - Assigns \a other to this pair. -*/ - /*! \fn bool operator==(const QPair &p1, const QPair &p2) \relates QPair @@ -186,7 +180,7 @@ Returns a QPair\ that contains \a value1 and \a value2. Example: - \snippet doc/src/snippets/code/doc_src_qpair.cpp 2 + \snippet code/doc_src_qpair.cpp 2 This is equivalent to QPair(\a value1, \a value2), but usually requires less typing. diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index ecbe9de..edc103f 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE Given a point \e p, the following statements are all equivalent: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 0 + \snippet code/src_corelib_tools_qpoint.cpp 0 A QPoint object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added @@ -126,7 +126,7 @@ QT_BEGIN_NAMESPACE Sets the x coordinate of this point to the given \a x coordinate. - \sa x() setY() + \sa x(), setY() */ /*! @@ -134,7 +134,7 @@ QT_BEGIN_NAMESPACE Sets the y coordinate of this point to the given \a y coordinate. - \sa y() setX() + \sa y(), setX() */ @@ -145,9 +145,9 @@ QT_BEGIN_NAMESPACE Using a reference makes it possible to directly manipulate x. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 1 + \snippet code/src_corelib_tools_qpoint.cpp 1 - \sa x() setX() + \sa x(), setX() */ /*! @@ -158,7 +158,7 @@ QT_BEGIN_NAMESPACE Using a reference makes it possible to directly manipulate y. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 2 + \snippet code/src_corelib_tools_qpoint.cpp 2 \sa y(), setY() */ @@ -170,7 +170,7 @@ QT_BEGIN_NAMESPACE Adds the given \a point to this point and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 3 + \snippet code/src_corelib_tools_qpoint.cpp 3 \sa operator-=() */ @@ -181,7 +181,7 @@ QT_BEGIN_NAMESPACE Subtracts the given \a point from this point and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 4 + \snippet code/src_corelib_tools_qpoint.cpp 4 \sa operator+=() */ @@ -204,7 +204,7 @@ QT_BEGIN_NAMESPACE Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 5 + \snippet code/src_corelib_tools_qpoint.cpp 5 Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy. @@ -331,7 +331,7 @@ QT_BEGIN_NAMESPACE Divides both x and y by the given \a divisor, and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 6 + \snippet code/src_corelib_tools_qpoint.cpp 6 Note that the result is rounded to the nearest integer as points are held as integers. Use QPointF for floating point accuracy. @@ -408,12 +408,12 @@ QDataStream &operator>>(QDataStream &s, QPoint &p) traditionally known as the "Manhattan length" of the vector from the origin to the point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 7 + \snippet code/src_corelib_tools_qpoint.cpp 7 This is a useful, and quick to calculate, approximation to the true length: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 8 + \snippet code/src_corelib_tools_qpoint.cpp 8 The tradition of "Manhattan length" arises because such distances apply to travelers who can only travel on a rectangular grid, like @@ -451,7 +451,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Given a point \e p, the following statements are all equivalent: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 9 + \snippet code/src_corelib_tools_qpoint.cpp 9 A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added @@ -534,7 +534,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Sets the x coordinate of this point to the given \a x coordinate. - \sa x() setY() + \sa x(), setY() */ /*! @@ -552,7 +552,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Using a reference makes it possible to directly manipulate x. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 10 + \snippet code/src_corelib_tools_qpoint.cpp 10 \sa x(), setX() */ @@ -564,9 +564,9 @@ QDebug operator<<(QDebug d, const QPointF &p) Using a reference makes it possible to directly manipulate y. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 11 + \snippet code/src_corelib_tools_qpoint.cpp 11 - \sa y() setY() + \sa y(), setY() */ /*! @@ -575,7 +575,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Adds the given \a point to this point and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 12 + \snippet code/src_corelib_tools_qpoint.cpp 12 \sa operator-=() */ @@ -586,7 +586,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Subtracts the given \a point from this point and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 13 + \snippet code/src_corelib_tools_qpoint.cpp 13 \sa operator+=() */ @@ -597,7 +597,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Multiplies this point's coordinates by the given \a factor, and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 14 + \snippet code/src_corelib_tools_qpoint.cpp 14 \sa operator/=() */ @@ -608,7 +608,7 @@ QDebug operator<<(QDebug d, const QPointF &p) Divides both x and y by the given \a divisor, and returns a reference to this point. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qpoint.cpp 15 + \snippet code/src_corelib_tools_qpoint.cpp 15 \sa operator*=() */ diff --git a/src/corelib/tools/qqueue.cpp b/src/corelib/tools/qqueue.cpp index 06d996a..c5aa4c6 100644 --- a/src/corelib/tools/qqueue.cpp +++ b/src/corelib/tools/qqueue.cpp @@ -57,7 +57,7 @@ the head item without removing it. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qqueue.cpp 0 + \snippet code/src_corelib_tools_qqueue.cpp 0 The example will output 1, 2, 3 in that order. diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp index aeab978..22bf39b 100644 --- a/src/corelib/tools/qrect.cpp +++ b/src/corelib/tools/qrect.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE height integers, or from a QPoint and a QSize. The following code creates two identical rectangles. - \snippet doc/src/snippets/code/src_corelib_tools_qrect.cpp 0 + \snippet code/src_corelib_tools_qrect.cpp 0 There is a third constructor that creates a QRect using the top-left and bottom-right coordinates, but we recommend that you @@ -1243,7 +1243,7 @@ QDebug operator<<(QDebug dbg, const QRect &r) { height integers, or from a QPoint and a QSize. The following code creates two identical rectangles. - \snippet doc/src/snippets/code/src_corelib_tools_qrect.cpp 1 + \snippet code/src_corelib_tools_qrect.cpp 1 There is also a third constructor creating a QRectF from a QRect, and a corresponding toRect() function that returns a QRect object @@ -1791,7 +1791,7 @@ QRectF QRectF::normalized() const \a y1), and the coordinates of its bottom-right corner to (\a x2, \a y2). - \sa getCoords() setRect() + \sa getCoords(), setRect() */ /*! diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 1db0fcf..79ceba5 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -437,7 +437,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, When the number of matches cannot be determined in advance, a common idiom is to use cap() in a loop. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 0 + \snippet code/src_corelib_tools_qregexp.cpp 0 \target assertions \section1 Assertions @@ -532,7 +532,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, To test a string against a wildcard expression, use exactMatch(). For example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 1 + \snippet code/src_corelib_tools_qregexp.cpp 1 \target perl-users \section1 Notes for Perl Users @@ -555,7 +555,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, applied to all the quantifiers in the pattern. For example, to match the Perl regexp \b{ro+?m} requires: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 2 + \snippet code/src_corelib_tools_qregexp.cpp 2 The equivalent of Perl's \c{/i} option is setCaseSensitivity(Qt::CaseInsensitive). @@ -584,7 +584,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, the other hand, C++'s rules for literal strings can be used to achieve the same: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 3 + \snippet code/src_corelib_tools_qregexp.cpp 3 Both zero-width positive and zero-width negative lookahead assertions (?=pattern) and (?!pattern) are supported with the same @@ -603,12 +603,12 @@ int qFindString(const QChar *haystack, int haystackLen, int from, \target code-examples \section1 Code Examples - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 4 + \snippet code/src_corelib_tools_qregexp.cpp 4 The third string matches '\underline{6}'. This is a simple validation regexp for integers in the range 0 to 99. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 5 + \snippet code/src_corelib_tools_qregexp.cpp 5 The second string matches '\underline{This_is-OK}'. We've used the character set abbreviation '\\S' (non-whitespace) and the anchors @@ -618,25 +618,25 @@ int qFindString(const QChar *haystack, int haystackLen, int from, 'letter' or 'correspondence' but only match whole words i.e. not 'email' - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 6 + \snippet code/src_corelib_tools_qregexp.cpp 6 The second string matches "Please write the \underline{letter}". The word 'letter' is also captured (because of the parentheses). We can see what text we've captured like this: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 7 + \snippet code/src_corelib_tools_qregexp.cpp 7 This will capture the text from the first set of capturing parentheses (counting capturing left parentheses from left to right). The parentheses are counted from 1 since cap(0) is the whole matched regexp (equivalent to '&' in most regexp engines). - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 8 + \snippet code/src_corelib_tools_qregexp.cpp 8 Here we've passed the QRegExp to QString's replace() function to replace the matched text with new text. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 9 + \snippet code/src_corelib_tools_qregexp.cpp 9 We've used the indexIn() function to repeatedly match the regexp in the string. Note that instead of moving forward by one character @@ -650,7 +650,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, One common use of regexps is to split lines of delimited data into their component fields. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 10 + \snippet code/src_corelib_tools_qregexp.cpp 10 In this example our input lines have the format company name, web address and country. Unfortunately the regexp is rather long and @@ -660,13 +660,13 @@ int qFindString(const QChar *haystack, int haystackLen, int from, QString::split() function can take a separator string or regexp as an argument and split a string accordingly. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 11 + \snippet code/src_corelib_tools_qregexp.cpp 11 Here field[0] is the company, field[1] the web address and so on. To imitate the matching of a shell we can use wildcard mode. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 12 + \snippet code/src_corelib_tools_qregexp.cpp 12 Wildcard matching can be convenient because of its simplicity, but any wildcard regexp can be defined using full regexps, e.g. @@ -4255,7 +4255,7 @@ bool QRegExp::exactMatch(const QString &str) const QString::replace(). Example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 13 + \snippet code/src_corelib_tools_qregexp.cpp 13 Although const, this function sets matchedLength(), capturedTexts() and pos(). @@ -4332,14 +4332,6 @@ int QRegExp::matchedLength() const #ifndef QT_NO_REGEXP_CAPTURE /*! - \fn int QRegExp::numCaptures() const - \obsolete - Returns the number of captures contained in the regular expression. - - \sa captureCount() - */ - -/*! \since 4.6 Returns the number of captures contained in the regular expression. */ @@ -4357,17 +4349,17 @@ int QRegExp::captureCount() const (capturing) subexpression of the regexp. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 14 + \snippet code/src_corelib_tools_qregexp.cpp 14 The above example also captures elements that may be present but which we have no interest in. This problem can be solved by using non-capturing parentheses: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 15 + \snippet code/src_corelib_tools_qregexp.cpp 15 Note that if you want to iterate over the list, you should iterate over a copy, e.g. - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 16 + \snippet code/src_corelib_tools_qregexp.cpp 16 Some regexps can match an indeterminate number of times. For example if the input string is "Offsets: 12 14 99 231 7" and the @@ -4420,7 +4412,7 @@ QStringList QRegExp::capturedTexts() match has index 0 and the parenthesized subexpressions have indexes starting from 1 (excluding non-capturing parentheses). - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 17 + \snippet code/src_corelib_tools_qregexp.cpp 17 The order of elements matched by cap() is as follows. The first element, cap(0), is the entire matching string. Each subsequent @@ -4449,7 +4441,7 @@ QString QRegExp::cap(int nth) of the whole match. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 18 + \snippet code/src_corelib_tools_qregexp.cpp 18 For zero-length matches, pos() always returns -1. (For example, if cap(4) would return an empty string, pos(4) returns -1.) This is @@ -4504,11 +4496,11 @@ QString QRegExp::errorString() Example: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 19 + \snippet code/src_corelib_tools_qregexp.cpp 19 This function is useful to construct regexp patterns dynamically: - \snippet doc/src/snippets/code/src_corelib_tools_qregexp.cpp 20 + \snippet code/src_corelib_tools_qregexp.cpp 20 \sa setPatternSyntax() */ diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 393b2bb..ff42390 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -122,23 +122,23 @@ QT_BEGIN_NAMESPACE You can set the pattern string by passing a string to the QRegularExpression constructor: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 0 + \snippet code/src_corelib_tools_qregularexpression.cpp 0 This sets the pattern string to \c{a pattern}. You can also use the setPattern() function to set a pattern on an existing QRegularExpression object: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 1 + \snippet code/src_corelib_tools_qregularexpression.cpp 1 Note that due to C++ literal strings rules, you must escape all backslashes inside the pattern string with another backslash: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 2 + \snippet code/src_corelib_tools_qregularexpression.cpp 2 The pattern() function returns the pattern that is currently set for a QRegularExpression object: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 3 + \snippet code/src_corelib_tools_qregularexpression.cpp 3 \section1 Pattern options @@ -149,17 +149,17 @@ QT_BEGIN_NAMESPACE You can set the options by passing them to the QRegularExpression constructor, as in: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 4 + \snippet code/src_corelib_tools_qregularexpression.cpp 4 Alternatively, you can use the setPatternOptions() function on an existing QRegularExpressionObject: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 5 + \snippet code/src_corelib_tools_qregularexpression.cpp 5 It is possible to get the pattern options currently set on a QRegularExpression object by using the patternOptions() function: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 6 + \snippet code/src_corelib_tools_qregularexpression.cpp 6 Please refer to the QRegularExpression::PatternOption enum documentation for more information about each pattern option. @@ -187,20 +187,20 @@ QT_BEGIN_NAMESPACE QRegularExpressionMatch object that can be used to inspect the results of the match. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 7 + \snippet code/src_corelib_tools_qregularexpression.cpp 7 If a match is successful, the (implicit) capturing group number 0 can be used to retrieve the substring matched by the entire pattern (see also the section about \l{extracting captured substrings}): - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 8 + \snippet code/src_corelib_tools_qregularexpression.cpp 8 It's also possible to start a match at an arbitrary offset inside the subject string by passing the offset as an argument of the match() function. In the following example \c{"12 abc"} is not matched because the match is started at offset 1: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 9 + \snippet code/src_corelib_tools_qregularexpression.cpp 9 \target extracting captured substrings \section2 Extracting captured substrings @@ -210,7 +210,7 @@ QT_BEGIN_NAMESPACE \l{QRegularExpressionMatch::}{captured()} function will return the string captured by the n-th capturing group: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 10 + \snippet code/src_corelib_tools_qregularexpression.cpp 10 Capturing groups in the pattern are numbered starting from 1, and the implicit capturing group 0 is used to capture the substring that matched @@ -221,12 +221,12 @@ QT_BEGIN_NAMESPACE \l{QRegularExpressionMatch::}{capturedStart()} and the \l{QRegularExpressionMatch::}{capturedEnd()} functions: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 11 + \snippet code/src_corelib_tools_qregularexpression.cpp 11 All of these functions have an overload taking a QString as a parameter in order to extract \e{named} captured substrings. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 12 + \snippet code/src_corelib_tools_qregularexpression.cpp 12 \target global matching \section1 Global matching @@ -240,7 +240,7 @@ QT_BEGIN_NAMESPACE which is a Java-like forward iterator that can be used to iterate over the results. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 13 + \snippet code/src_corelib_tools_qregularexpression.cpp 13 Since it's a Java-like iterator, the QRegularExpressionMatchIterator will point immediately before the first result. Every result is returned as a @@ -250,7 +250,7 @@ QT_BEGIN_NAMESPACE \l{QRegularExpressionMatchIterator::}{next()} will return the next result and advance the iterator. Continuing from the previous example: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 14 + \snippet code/src_corelib_tools_qregularexpression.cpp 14 You can also use \l{QRegularExpressionMatchIterator::}{peekNext()} to get the next result without advancing the iterator. @@ -326,17 +326,17 @@ QT_BEGIN_NAMESPACE This behaviour is implemented by the PartialPreferCompleteMatch match type. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 15 + \snippet code/src_corelib_tools_qregularexpression.cpp 15 If matching the same regular expression against the subject string leads to a complete match, it is reported as usual: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 16 + \snippet code/src_corelib_tools_qregularexpression.cpp 16 Another example with a different pattern, showing the behaviour of preferring a complete match over a partial one: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 17 + \snippet code/src_corelib_tools_qregularexpression.cpp 17 In this case, the subpattern \c{abc\\w+X} partially matches the subject string; however, the subpattern \c{def} matches the subject string @@ -346,7 +346,7 @@ QT_BEGIN_NAMESPACE match), then the QRegularExpressionMatch object will report the first one that is found. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 18 + \snippet code/src_corelib_tools_qregularexpression.cpp 18 \section2 Incremental/multi-segment matching @@ -369,13 +369,13 @@ QT_BEGIN_NAMESPACE as soon as it is found, and other match alternatives are not tried (even if they could lead to a complete match). For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 19 + \snippet code/src_corelib_tools_qregularexpression.cpp 19 This happens because when matching the first branch of the alternation operator a partial match is found, and therefore matching stops, without trying the second branch. Another example: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 20 + \snippet code/src_corelib_tools_qregularexpression.cpp 20 This shows what could seem a counterintuitve behaviour of quantifiers: since \c{?} is greedy, then the engine tries first to continue the match @@ -383,7 +383,7 @@ QT_BEGIN_NAMESPACE subject string, and therefore a partial match is reported. This is even more surprising in the following example: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 21 + \snippet code/src_corelib_tools_qregularexpression.cpp 21 It's easy to understand this behaviour if we remember that the engine expects the subject string to be only a substring of the whole text we're @@ -404,13 +404,13 @@ QT_BEGIN_NAMESPACE syntax errors in the pattern string. The isValid() function will return true if the regular expression is valid, or false otherwise: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 22 + \snippet code/src_corelib_tools_qregularexpression.cpp 22 You can get more information about the specific error by calling the errorString() function; moreover, the patternErrorOffset() function will return the offset inside the pattern string - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 23 + \snippet code/src_corelib_tools_qregularexpression.cpp 23 If a match is attempted with an invalid QRegularExpression, then the returned QRegularExpressionMatch object will be invalid as well (that is, @@ -455,19 +455,19 @@ QT_BEGIN_NAMESPACE putting the pattern between the \c{^} and the \c{$} anchors is enough in most cases: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 24 + \snippet code/src_corelib_tools_qregularexpression.cpp 24 However, remember that the \c{$} anchor not only matches at the end of the string, but also at a newline character right before the end of the string; that is, the previous pattern matches against the string "this pattern must - match exactly\n". Also, the behaviour of both the \c{^} and the \c{$} + match exactly\\n". Also, the behaviour of both the \c{^} and the \c{$} anchors changes if the MultiLineOption is set either explicitely (as a pattern option) or implicitly (as a directive inside the pattern string). Therefore, in the most general case, you should wrap the pattern between the \c{\A} and the \c{\z} anchors: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 25 + \snippet code/src_corelib_tools_qregularexpression.cpp 25 Note the usage of the non-capturing group in order to preserve the meaning of the branch operator inside the pattern. @@ -566,7 +566,7 @@ QT_BEGIN_NAMESPACE returns each substring captured, either by the capturing group's index or by its name: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 29 + \snippet code/src_corelib_tools_qregularexpression.cpp 29 For each captured substring it is possible to query its starting and ending offsets in the subject string by calling the capturedStart() and the @@ -616,7 +616,7 @@ QT_BEGIN_NAMESPACE For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 30 + \snippet code/src_corelib_tools_qregularexpression.cpp 30 Moreover, QRegularExpressionMatchIterator offers a peekNext() function to get the next result \e{without} advancing the iterator. @@ -1590,11 +1590,11 @@ bool QRegularExpression::operator==(const QRegularExpression &re) const meaning when used as a regular expression pattern string, and returns the escaped string. For instance: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 26 + \snippet code/src_corelib_tools_qregularexpression.cpp 26 This is very convenient in order to build patterns from arbitrary strings: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 27 + \snippet code/src_corelib_tools_qregularexpression.cpp 27 \note This function implements Perl's quotemeta algorithm and escapes with a backslash all characters in \a str, except for the characters in the @@ -1721,7 +1721,7 @@ QRegularExpression::MatchOptions QRegularExpressionMatch::matchOptions() const including the implicit capturing group 0. This can be used to extract all the substrings that were captured: - \snippet doc/src/snippets/code/src_corelib_tools_qregularexpression.cpp 28 + \snippet code/src_corelib_tools_qregularexpression.cpp 28 Note that some of the capturing groups with an index less than lastCapturedIndex() could have not matched, and therefore captured nothing. diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp index 5ecca89..bf2cac4 100644 --- a/src/corelib/tools/qscopedpointer.cpp +++ b/src/corelib/tools/qscopedpointer.cpp @@ -61,12 +61,12 @@ QT_BEGIN_NAMESPACE Consider this function which does heap allocations, and have various exit points: - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 0 + \snippet code/src_corelib_tools_qscopedpointer.cpp 0 It's encumbered by the manual delete calls. With QScopedPointer, the code can be simplified to: - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 1 + \snippet code/src_corelib_tools_qscopedpointer.cpp 1 The code the compiler generates for QScopedPointer is the same as when writing it manually. Code that makes use of \a delete are candidates for @@ -78,7 +78,7 @@ QT_BEGIN_NAMESPACE The const qualification on a regular C++ pointer can also be expressed with a QScopedPointer: - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 2 + \snippet code/src_corelib_tools_qscopedpointer.cpp 2 \section1 Custom cleanup handlers @@ -99,7 +99,7 @@ QT_BEGIN_NAMESPACE You can pass your own classes as handlers, provided that they have a public static function \c{void cleanup(T *pointer)}. - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 5 + \snippet code/src_corelib_tools_qscopedpointer.cpp 5 \section1 Forward Declared Pointers @@ -111,7 +111,7 @@ QT_BEGIN_NAMESPACE points to a forward declared class must have non-inline constructors, destructors and assignment operators: - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 4 + \snippet code/src_corelib_tools_qscopedpointer.cpp 4 Otherwise, the compiler output a warning about not being able to destruct \c MyPrivateClass. @@ -168,7 +168,7 @@ QT_BEGIN_NAMESPACE Returns \c true if this object is not \c null. This function is suitable for use in \tt if-constructs, like: - \snippet doc/src/snippets/code/src_corelib_tools_qscopedpointer.cpp 3 + \snippet code/src_corelib_tools_qscopedpointer.cpp 3 \sa isNull() */ diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc index b03cce8..51d9caa 100644 --- a/src/corelib/tools/qset.qdoc +++ b/src/corelib/tools/qset.qdoc @@ -40,19 +40,19 @@ Here's an example QSet with QString values: - \snippet doc/src/snippets/code/doc_src_qset.cpp 0 + \snippet code/doc_src_qset.cpp 0 To insert a value into the set, use insert(): - \snippet doc/src/snippets/code/doc_src_qset.cpp 1 + \snippet code/doc_src_qset.cpp 1 Another way to insert items into the set is to use operator<<(): - \snippet doc/src/snippets/code/doc_src_qset.cpp 2 + \snippet code/doc_src_qset.cpp 2 To test whether an item belongs to the set or not, use contains(): - \snippet doc/src/snippets/code/doc_src_qset.cpp 3 + \snippet code/doc_src_qset.cpp 3 If you want to navigate through all the values stored in a QSet, you can use an iterator. QSet supports both \l{Java-style @@ -60,18 +60,18 @@ iterators} (QSet::iterator and QSet::const_iterator). Here's how to iterate over a QSet using a Java-style iterator: - \snippet doc/src/snippets/code/doc_src_qset.cpp 4 + \snippet code/doc_src_qset.cpp 4 Here's the same code, but using an STL-style iterator: - \snippet doc/src/snippets/code/doc_src_qset.cpp 5 + \snippet code/doc_src_qset.cpp 5 QSet is unordered, so an iterator's sequence cannot be assumed to be predictable. If ordering by key is required, use a QMap. To navigate through a QSet, you can also use \l{foreach}: - \snippet doc/src/snippets/code/doc_src_qset.cpp 6 + \snippet code/doc_src_qset.cpp 6 Items can be removed from the set using remove(). There is also a clear() function that removes all items. @@ -194,7 +194,7 @@ This function is useful for code that needs to build a huge set and wants to avoid repeated reallocation. For example: - \snippet doc/src/snippets/code/doc_src_qset.cpp 7 + \snippet code/doc_src_qset.cpp 7 Ideally, \a size should be slightly more than the maximum number of elements expected in the set. \a size doesn't have to be prime, @@ -618,18 +618,18 @@ start iterating. Here's a typical loop that prints all the items stored in a set: - \snippet doc/src/snippets/code/doc_src_qset.cpp 8 + \snippet code/doc_src_qset.cpp 8 Here's a loop that removes certain items (all those that start with 'J') from a set while iterating: - \snippet doc/src/snippets/code/doc_src_qset.cpp 9 + \snippet code/doc_src_qset.cpp 9 STL-style iterators can be used as arguments to \l{generic algorithms}. For example, here's how to find an item in the set using the qFind() algorithm: - \snippet doc/src/snippets/code/doc_src_qset.cpp 10 + \snippet code/doc_src_qset.cpp 10 Multiple iterators can be used on the same set. However, you may not attempt to modify the container while iterating on it. @@ -661,13 +661,13 @@ start iterating. Here's a typical loop that prints all the items stored in a set: - \snippet doc/src/snippets/code/doc_src_qset.cpp 11 + \snippet code/doc_src_qset.cpp 11 STL-style iterators can be used as arguments to \l{generic algorithms}. For example, here's how to find an item in the set using the qFind() algorithm: - \snippet doc/src/snippets/code/doc_src_qset.cpp 12 + \snippet code/doc_src_qset.cpp 12 Multiple iterators can be used on the same set. However, you may not attempt to modify the container while iterating on it. @@ -901,7 +901,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qset.cpp 13 + \snippet code/doc_src_qset.cpp 13 \sa fromList(), QList::fromSet(), qSort() */ @@ -926,7 +926,7 @@ Example: - \snippet doc/src/snippets/code/doc_src_qset.cpp 14 + \snippet code/doc_src_qset.cpp 14 \sa toList(), QList::toSet() */ diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp index ffc8ac6..4c33beb 100644 --- a/src/corelib/tools/qshareddata.cpp +++ b/src/corelib/tools/qshareddata.cpp @@ -99,7 +99,7 @@ QT_BEGIN_NAMESPACE implicitly shared \c Employee class. In the header file we define the two classes \c Employee and \c EmployeeData. - \snippet doc/src/snippets/sharedemployee/employee.h 0 + \snippet sharedemployee/employee.h 0 In class \c Employee, note the single data member, a \e {d pointer} of type \c {QSharedDataPointer}. All accesses of @@ -121,14 +121,14 @@ QT_BEGIN_NAMESPACE straightforward. Both create a new instance of \c EmployeeData and assign it to the \e{d pointer} . - \snippet doc/src/snippets/sharedemployee/employee.h 1 + \snippet sharedemployee/employee.h 1 \codeline - \snippet doc/src/snippets/sharedemployee/employee.h 2 + \snippet sharedemployee/employee.h 2 Note that class \c Employee also has a trivial copy constructor defined, which is not strictly required in this case. - \snippet doc/src/snippets/sharedemployee/employee.h 7 + \snippet sharedemployee/employee.h 7 The copy constructor is not strictly required here, because class \c EmployeeData is included in the same file as class \c Employee @@ -162,9 +162,9 @@ QT_BEGIN_NAMESPACE detach() to ensure that the function operates on its own copy of the data. - \snippet doc/src/snippets/sharedemployee/employee.h 3 + \snippet sharedemployee/employee.h 3 \codeline - \snippet doc/src/snippets/sharedemployee/employee.h 4 + \snippet sharedemployee/employee.h 4 Note that if detach() is called more than once in a member function due to multiple dereferences of the \e {d pointer}, detach() will @@ -180,9 +180,9 @@ QT_BEGIN_NAMESPACE In \c Employee's \e const member functions, dereferencing the \e {d pointer} does \e not cause detach() to be called. - \snippet doc/src/snippets/sharedemployee/employee.h 5 + \snippet sharedemployee/employee.h 5 \codeline - \snippet doc/src/snippets/sharedemployee/employee.h 6 + \snippet sharedemployee/employee.h 6 Notice that there is no need to implement a copy constructor or an assignment operator for the \c Employee class, because the copy @@ -199,7 +199,7 @@ QT_BEGIN_NAMESPACE Consider a simple example that creates two instances of the implicitly shared \c Employee class. - \snippet doc/src/snippets/sharedemployee/main.cpp 0 + \snippet sharedemployee/main.cpp 0 After the second employee e2 is created and e1 is assigned to it, both \c e1 and \c e2 refer to Albrecht Durer, employee 1001. Both \c diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp index b276d2d..b4b99d2 100644 --- a/src/corelib/tools/qsize.cpp +++ b/src/corelib/tools/qsize.cpp @@ -194,7 +194,7 @@ void QSize::transpose() \endlist Example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 0 + \snippet code/src_corelib_tools_qsize.cpp 0 \sa setWidth(), setHeight(), scaled() */ @@ -252,7 +252,7 @@ QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Using a reference makes it possible to manipulate the width directly. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 1 + \snippet code/src_corelib_tools_qsize.cpp 1 \sa rheight(), setWidth() */ @@ -265,7 +265,7 @@ QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Using a reference makes it possible to manipulate the height directly. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 2 + \snippet code/src_corelib_tools_qsize.cpp 2 \sa rwidth(), setHeight() */ @@ -276,7 +276,7 @@ QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Adds the given \a size to \e this size, and returns a reference to this size. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 3 + \snippet code/src_corelib_tools_qsize.cpp 3 */ /*! @@ -285,7 +285,7 @@ QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const Subtracts the given \a size from \e this size, and returns a reference to this size. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 4 + \snippet code/src_corelib_tools_qsize.cpp 4 */ /*! @@ -622,7 +622,7 @@ void QSizeF::transpose() \endlist Example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 5 + \snippet code/src_corelib_tools_qsize.cpp 5 \sa setWidth(), setHeight(), scaled() */ @@ -636,11 +636,11 @@ void QSizeF::transpose() */ /*! - \fn QSizeF QSizeF::scaled(int width, int height, Qt::AspectRatioMode mode) const + \fn QSizeF QSizeF::scaled(qreal width, qreal height, Qt::AspectRatioMode mode) const \since 5.0 Returns a size scaled to a rectangle with the given \a width and - \a height, according to the specified \mode. + \a height, according to the specified \a mode. \sa scale() */ @@ -679,7 +679,7 @@ QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Using a reference makes it possible to manipulate the width directly. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 6 + \snippet code/src_corelib_tools_qsize.cpp 6 \sa rheight(), setWidth() */ @@ -692,7 +692,7 @@ QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Using a reference makes it possible to manipulate the height directly. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 7 + \snippet code/src_corelib_tools_qsize.cpp 7 \sa rwidth(), setHeight() */ @@ -703,7 +703,7 @@ QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Adds the given \a size to this size and returns a reference to this size. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 8 + \snippet code/src_corelib_tools_qsize.cpp 8 */ /*! @@ -712,7 +712,7 @@ QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Subtracts the given \a size from this size and returns a reference to this size. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qsize.cpp 9 + \snippet code/src_corelib_tools_qsize.cpp 9 */ /*! diff --git a/src/corelib/tools/qstack.cpp b/src/corelib/tools/qstack.cpp index 888fbfa..3597058 100644 --- a/src/corelib/tools/qstack.cpp +++ b/src/corelib/tools/qstack.cpp @@ -58,7 +58,7 @@ Example: - \snippet doc/src/snippets/qstack/main.cpp 0 + \snippet qstack/main.cpp 0 The example will output 3, 2, 1 in that order. diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a536a09..a9373d7 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -421,7 +421,7 @@ const QString::Null QString::null = { }; Most of the QChar member functions also exist in QCharRef. However, they are not explicitly documented here. - \sa QString::operator[]() QString::at() QChar + \sa QString::operator[](), QString::at(), QChar */ /*! @@ -467,7 +467,7 @@ const QString::Null QString::null = { }; *} to its constructor. For example, the following code creates a QString of size 5 containing the data "Hello": - \snippet doc/src/snippets/qstring/main.cpp 0 + \snippet qstring/main.cpp 0 QString converts the \c{const char *} data into Unicode using the fromAscii() function. fromAscii() treats ordinals above 128 as Latin-1 @@ -480,7 +480,7 @@ const QString::Null QString::null = { }; You can also provide string data as an array of \l{QChar}s: - \snippet doc/src/snippets/qstring/main.cpp 1 + \snippet qstring/main.cpp 1 QString makes a deep copy of the QChar data, so you can modify it later without experiencing side effects. (If for performance @@ -495,12 +495,12 @@ const QString::Null QString::null = { }; character that can be used on the left side of an assignment. For example: - \snippet doc/src/snippets/qstring/main.cpp 2 + \snippet qstring/main.cpp 2 For read-only access, an alternative syntax is to use the at() function: - \snippet doc/src/snippets/qstring/main.cpp 3 + \snippet qstring/main.cpp 3 The at() function can be faster than \l operator[](), because it never causes a \l{deep copy} to occur. Alternatively, use the @@ -519,7 +519,7 @@ const QString::Null QString::null = { }; usage. For example, if you want to compare a QString with a string literal, you can write code like this and it will work as expected: - \snippet doc/src/snippets/qstring/main.cpp 4 + \snippet qstring/main.cpp 4 You can also pass string literals to functions that take QStrings as arguments, invoking the QString(const char *) @@ -534,7 +534,7 @@ const QString::Null QString::null = { }; character data: append(), prepend(), insert(), replace(), and remove(). For example: - \snippet doc/src/snippets/qstring/main.cpp 5 + \snippet qstring/main.cpp 5 If you are building a QString gradually and know in advance approximately how many characters the QString will contain, you @@ -563,7 +563,7 @@ const QString::Null QString::null = { }; they return -1. For example, here's a typical loop that finds all occurrences of a particular substring: - \snippet doc/src/snippets/qstring/main.cpp 6 + \snippet qstring/main.cpp 6 QString provides many functions for converting numbers into strings and strings into numbers. See the arg() functions, the @@ -642,14 +642,14 @@ const QString::Null QString::null = { }; application is to add the following entry to your \l{qmake Project Files}{qmake project file}: - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 0 + \snippet code/src_corelib_tools_qstring.cpp 0 You then need to explicitly call fromAscii(), fromLatin1(), fromUtf8(), or fromLocal8Bit() to construct a QString from an 8-bit string, or use the lightweight QLatin1String class, for example: - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 1 + \snippet code/src_corelib_tools_qstring.cpp 1 Similarly, you must call toAscii(), toLatin1(), toUtf8(), or toLocal8Bit() explicitly to convert the QString to an 8-bit @@ -666,7 +666,7 @@ const QString::Null QString::null = { }; \l{implicitly shared}, QStrings may be treated like \c{int}s or other basic types. For example: - \snippet doc/src/snippets/qstring/main.cpp 7 + \snippet qstring/main.cpp 7 The \c result variable, is a normal variable allocated on the stack. When \c return is called, and because we're returning by @@ -685,7 +685,7 @@ const QString::Null QString::null = { }; string with size 0. A null string is always empty, but an empty string isn't necessarily null: - \snippet doc/src/snippets/qstring/main.cpp 8 + \snippet qstring/main.cpp 8 All functions except isNull() treat null strings the same as empty strings. For example, toAscii().constData() returns a pointer to a @@ -732,7 +732,7 @@ const QString::Null QString::null = { }; complex string from multiple substrings. You will often write code like this: - \snippet doc/src/snippets/qstring/stringbuilder.cpp 0 + \snippet qstring/stringbuilder.cpp 0 There is nothing wrong with either of these string constructions, but there are a few hidden inefficiencies. Beginning with Qt 4.6, @@ -770,13 +770,13 @@ const QString::Null QString::null = { }; \c{QStringBuilder} wherever you want to use it, and use the \c{'%'} operator instead of \c{'+'} when concatenating strings: - \snippet doc/src/snippets/qstring/stringbuilder.cpp 5 + \snippet qstring/stringbuilder.cpp 5 A more global approach which is the most convenient but not entirely source compatible, is to this define in your .pro file: - \snippet doc/src/snippets/qstring/stringbuilder.cpp 3 + \snippet qstring/stringbuilder.cpp 3 and the \c{'+'} will automatically be performed as the \c{QStringBuilder} \c{'%'} everywhere. @@ -1200,12 +1200,12 @@ void QString::free(Data *d) Example: - \snippet doc/src/snippets/qstring/main.cpp 45 + \snippet qstring/main.cpp 45 If you want to append a certain number of identical characters to the string, use \l operator+=() as follows rather than resize(): - \snippet doc/src/snippets/qstring/main.cpp 46 + \snippet qstring/main.cpp 46 If you want to expand the string so that it reaches a certain width and fill the new positions with a particular character, use @@ -1213,7 +1213,7 @@ void QString::free(Data *d) If \a size is negative, it is equivalent to passing zero. - \snippet doc/src/snippets/qstring/main.cpp 47 + \snippet qstring/main.cpp 47 \sa truncate(), reserve() */ @@ -1278,7 +1278,7 @@ void QString::resize(int size) we're fairly sure that size is large enough to make a call to reserve() worthwhile: - \snippet doc/src/snippets/qstring/main.cpp 44 + \snippet qstring/main.cpp 44 \sa squeeze(), capacity() */ @@ -1422,7 +1422,7 @@ QString &QString::operator=(QChar ch) Example: - \snippet doc/src/snippets/qstring/main.cpp 26 + \snippet qstring/main.cpp 26 If the given \a position is greater than size(), the array is first extended using resize(). @@ -1506,11 +1506,11 @@ QString& QString::insert(int i, QChar ch) Example: - \snippet doc/src/snippets/qstring/main.cpp 9 + \snippet qstring/main.cpp 9 This is the same as using the insert() function: - \snippet doc/src/snippets/qstring/main.cpp 10 + \snippet qstring/main.cpp 10 The append() function is typically very fast (\l{constant time}), because QString preallocates extra space at the end of the string @@ -1602,7 +1602,7 @@ QString &QString::append(QChar ch) Example: - \snippet doc/src/snippets/qstring/main.cpp 36 + \snippet qstring/main.cpp 36 \sa append(), insert() */ @@ -1657,7 +1657,7 @@ QString &QString::append(QChar ch) position + \a n is beyond the end of the string, the string is truncated at the specified \a position. - \snippet doc/src/snippets/qstring/main.cpp 37 + \snippet qstring/main.cpp 37 \sa insert(), replace() */ @@ -1708,7 +1708,7 @@ QString &QString::remove(const QString &str, Qt::CaseSensitivity cs) Example: - \snippet doc/src/snippets/qstring/main.cpp 38 + \snippet qstring/main.cpp 38 This is the same as \c replace(ch, "", cs). @@ -1741,7 +1741,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs) Removes every occurrence of the regular expression \a rx in the string, and returns a reference to the string. For example: - \snippet doc/src/snippets/qstring/main.cpp 39 + \snippet qstring/main.cpp 39 \sa indexOf(), lastIndexOf(), replace() */ @@ -1753,7 +1753,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs) Removes every occurrence of the regular expression \a re in the string, and returns a reference to the string. For example: - \snippet doc/src/snippets/qstring/main.cpp 96 + \snippet qstring/main.cpp 96 \sa indexOf(), lastIndexOf(), replace() */ @@ -1766,7 +1766,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs) Example: - \snippet doc/src/snippets/qstring/main.cpp 40 + \snippet qstring/main.cpp 40 \sa insert(), remove() */ @@ -1817,13 +1817,13 @@ QString &QString::replace(int pos, int len, QChar after) Example: - \snippet doc/src/snippets/qstring/main.cpp 41 + \snippet qstring/main.cpp 41 \note The replacement text is not rescanned after it is inserted. Example: - \snippet doc/src/snippets/qstring/main.cpp 86 + \snippet qstring/main.cpp 86 */ QString &QString::replace(const QString &before, const QString &after, Qt::CaseSensitivity cs) { @@ -2242,7 +2242,7 @@ bool QString::operator<(const QLatin1String &other) const \overload operator<() The \a other byte array is converted to a QString using the - fromAscii() function. If any NUL characters ('\0') are embedded + fromAscii() function. If any NUL characters ('\\0') are embedded in the byte array, they will be included in the transformation. You can disable this operator by defining \c @@ -2264,8 +2264,7 @@ bool QString::operator<(const QLatin1String &other) const go through QObject::tr(), for example. */ -/*! \fn bool operator<=(const QString &s1, const QString &s2) - \relates QString +/*! \fn bool QString::operator<=(const QString &s1, const QString &s2) Returns true if string \a s1 is lexically less than or equal to string \a s2; otherwise returns false. @@ -2286,7 +2285,7 @@ bool QString::operator<(const QLatin1String &other) const \overload operator<=() The \a other byte array is converted to a QString using the - fromAscii() function. If any NUL characters ('\0') are embedded + fromAscii() function. If any NUL characters ('\\0') are embedded in the byte array, they will be included in the transformation. You can disable this operator by defining \c @@ -2308,8 +2307,7 @@ bool QString::operator<(const QLatin1String &other) const go through QObject::tr(), for example. */ -/*! \fn bool operator>(const QString &s1, const QString &s2) - \relates QString +/*! \fn bool QString::operator>(const QString &s1, const QString &s2) Returns true if string \a s1 is lexically greater than string \a s2; otherwise returns false. @@ -2346,7 +2344,7 @@ bool QString::operator>(const QLatin1String &other) const \overload operator>() The \a other byte array is converted to a QString using the - fromAscii() function. If any NUL characters ('\0') are embedded + fromAscii() function. If any NUL characters ('\\0') are embedded in the byte array, they will be included in the transformation. You can disable this operator by defining \c @@ -2390,7 +2388,7 @@ bool QString::operator>(const QLatin1String &other) const \overload operator>=() The \a other byte array is converted to a QString using the - fromAscii() function. If any NUL characters ('\0') are embedded in + fromAscii() function. If any NUL characters ('\\0') are embedded in the byte array, they will be included in the transformation. You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII @@ -2434,7 +2432,7 @@ bool QString::operator>(const QLatin1String &other) const \overload operator!=() The \a other byte array is converted to a QString using the - fromAscii() function. If any NUL characters ('\0') are embedded + fromAscii() function. If any NUL characters ('\\0') are embedded in the byte array, they will be included in the transformation. You can disable this operator by defining \c QT_NO_CAST_FROM_ASCII @@ -2466,7 +2464,7 @@ bool QString::operator>(const QLatin1String &other) const Example: - \snippet doc/src/snippets/qstring/main.cpp 24 + \snippet qstring/main.cpp 24 If \a from is -1, the search starts at the last character; if it is -2, at the next to last character and so on. @@ -2489,7 +2487,7 @@ int QString::indexOf(const QString &str, int from, Qt::CaseSensitivity cs) const Example: - \snippet doc/src/snippets/qstring/main.cpp 24 + \snippet qstring/main.cpp 24 If \a from is -1, the search starts at the last character; if it is -2, at the next to last character and so on. @@ -2664,7 +2662,7 @@ static int lastIndexOfHelper(const ushort *haystack, int from, const ushort *nee Example: - \snippet doc/src/snippets/qstring/main.cpp 29 + \snippet qstring/main.cpp 29 \sa indexOf(), contains(), count() */ @@ -2703,7 +2701,7 @@ int QString::lastIndexOf(const QString &str, int from, Qt::CaseSensitivity cs) c Example: - \snippet doc/src/snippets/qstring/main.cpp 29 + \snippet qstring/main.cpp 29 \sa indexOf(), contains(), count() */ @@ -2793,13 +2791,13 @@ struct QStringCapture string with \a after. Returns a reference to the string. For example: - \snippet doc/src/snippets/qstring/main.cpp 42 + \snippet qstring/main.cpp 42 For regular expressions containing \l{capturing parentheses}, occurrences of \b{\\1}, \b{\\2}, ..., in \a after are replaced with \a{rx}.cap(1), cap(2), ... - \snippet doc/src/snippets/qstring/main.cpp 43 + \snippet qstring/main.cpp 43 \sa indexOf(), lastIndexOf(), remove(), QRegExp::cap() */ @@ -2951,13 +2949,13 @@ QString& QString::replace(const QRegExp &rx, const QString &after) string with \a after. Returns a reference to the string. For example: - \snippet doc/src/snippets/qstring/main.cpp 87 + \snippet qstring/main.cpp 87 For regular expressions containing capturing groups, - occurrences of \bold{\\1}, \bold{\\2}, ..., in \a after are replaced + occurrences of \b{\\1}, \b{\\2}, ..., in \a after are replaced with the string captured by the corresponding capturing group. - \snippet doc/src/snippets/qstring/main.cpp 88 + \snippet qstring/main.cpp 88 \sa indexOf(), lastIndexOf(), remove(), QRegularExpression, QRegularExpressionMatch */ @@ -3125,7 +3123,7 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const case sensitive; otherwise the search is case insensitive. Example: - \snippet doc/src/snippets/qstring/main.cpp 17 + \snippet qstring/main.cpp 17 \sa indexOf(), count() */ @@ -3179,7 +3177,7 @@ int QString::count(const QStringRef &str, Qt::CaseSensitivity cs) const Example: - \snippet doc/src/snippets/qstring/main.cpp 25 + \snippet qstring/main.cpp 25 */ int QString::indexOf(const QRegExp& rx, int from) const { @@ -3200,7 +3198,7 @@ int QString::indexOf(const QRegExp& rx, int from) const Example: - \snippet doc/src/snippets/qstring/main.cpp 25 + \snippet qstring/main.cpp 25 */ int QString::indexOf(QRegExp& rx, int from) const { @@ -3216,7 +3214,7 @@ int QString::indexOf(QRegExp& rx, int from) const Example: - \snippet doc/src/snippets/qstring/main.cpp 30 + \snippet qstring/main.cpp 30 */ int QString::lastIndexOf(const QRegExp& rx, int from) const { @@ -3237,7 +3235,7 @@ int QString::lastIndexOf(const QRegExp& rx, int from) const Example: - \snippet doc/src/snippets/qstring/main.cpp 30 + \snippet qstring/main.cpp 30 */ int QString::lastIndexOf(QRegExp& rx, int from) const { @@ -3253,7 +3251,7 @@ int QString::lastIndexOf(QRegExp& rx, int from) const This function counts overlapping matches, so in the example below, there are four instances of "ana" or "ama": - \snippet doc/src/snippets/qstring/main.cpp 18 + \snippet qstring/main.cpp 18 */ int QString::count(const QRegExp& rx) const @@ -3284,7 +3282,7 @@ int QString::count(const QRegExp& rx) const Example: - \snippet doc/src/snippets/qstring/main.cpp 93 + \snippet qstring/main.cpp 93 */ int QString::indexOf(const QRegularExpression& re, int from) const { @@ -3310,7 +3308,7 @@ int QString::indexOf(const QRegularExpression& re, int from) const Example: - \snippet doc/src/snippets/qstring/main.cpp 94 + \snippet qstring/main.cpp 94 */ int QString::lastIndexOf(const QRegularExpression &re, int from) const { @@ -3361,7 +3359,7 @@ bool QString::contains(const QRegularExpression &re) const This function counts overlapping matches, so in the example below, there are four instances of "ana" or "ama": - \snippet doc/src/snippets/qstring/main.cpp 95 + \snippet qstring/main.cpp 95 */ int QString::count(const QRegularExpression &re) const { @@ -3436,13 +3434,13 @@ int QString::count(const QRegularExpression &re) const to skip empty fields and how to deal with leading and trailing separators; see \l{SectionFlags}. - \snippet doc/src/snippets/qstring/main.cpp 52 + \snippet qstring/main.cpp 52 If \a start or \a end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on. - \snippet doc/src/snippets/qstring/main.cpp 53 + \snippet qstring/main.cpp 53 \sa split() */ @@ -3450,8 +3448,8 @@ int QString::count(const QRegularExpression &re) const /*! \overload section() - \snippet doc/src/snippets/qstring/main.cpp 51 - \snippet doc/src/snippets/qstring/main.cpp 54 + \snippet qstring/main.cpp 51 + \snippet qstring/main.cpp 54 \sa split() */ @@ -3560,12 +3558,12 @@ static QString extractSections(const QList §ions, This string is treated as a sequence of fields separated by the regular expression, \a reg. - \snippet doc/src/snippets/qstring/main.cpp 55 + \snippet qstring/main.cpp 55 \warning Using this QRegExp version is much more expensive than the overloaded string and character versions. - \sa split() simplified() + \sa split(), simplified() */ QString QString::section(const QRegExp ®, int start, int end, SectionFlags flags) const { @@ -3600,12 +3598,12 @@ QString QString::section(const QRegExp ®, int start, int end, SectionFlags fl This string is treated as a sequence of fields separated by the regular expression, \a re. - \snippet doc/src/snippets/qstring/main.cpp 89 + \snippet qstring/main.cpp 89 \warning Using this QRegularExpression version is much more expensive than the overloaded string and character versions. - \sa split() simplified() + \sa split(), simplified() */ QString QString::section(const QRegularExpression &re, int start, int end, SectionFlags flags) const { @@ -3646,7 +3644,7 @@ QString QString::section(const QRegularExpression &re, int start, int end, Secti The entire string is returned if \a n is greater than size() or less than zero. - \snippet doc/src/snippets/qstring/main.cpp 31 + \snippet qstring/main.cpp 31 \sa right(), mid(), startsWith() */ @@ -3664,7 +3662,7 @@ QString QString::left(int n) const The entire string is returned if \a n is greater than size() or less than zero. - \snippet doc/src/snippets/qstring/main.cpp 48 + \snippet qstring/main.cpp 48 \sa left(), mid(), endsWith() */ @@ -3687,7 +3685,7 @@ QString QString::right(int n) const Example: - \snippet doc/src/snippets/qstring/main.cpp 34 + \snippet qstring/main.cpp 34 \sa left(), right() */ @@ -3718,7 +3716,7 @@ QString QString::mid(int position, int n) const If \a cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive. - \snippet doc/src/snippets/qstring/main.cpp 65 + \snippet qstring/main.cpp 65 \sa endsWith() */ @@ -3774,7 +3772,7 @@ bool QString::startsWith(const QStringRef &s, Qt::CaseSensitivity cs) const If \a cs is Qt::CaseSensitive (default), the search is case sensitive; otherwise the search is case insensitive. - \snippet doc/src/snippets/qstring/main.cpp 20 + \snippet qstring/main.cpp 20 \sa startsWith() */ @@ -4280,7 +4278,7 @@ QString& QString::setUnicode(const QChar *unicode, int size) Example: - \snippet doc/src/snippets/qstring/main.cpp 57 + \snippet qstring/main.cpp 57 \sa trimmed() */ @@ -4370,7 +4368,7 @@ QString QString::simplified() const Example: - \snippet doc/src/snippets/qstring/main.cpp 82 + \snippet qstring/main.cpp 82 Unlike simplified(), trimmed() leaves internal whitespace alone. @@ -4418,7 +4416,7 @@ QString QString::trimmed() const Example: - \snippet doc/src/snippets/qstring/main.cpp 85 + \snippet qstring/main.cpp 85 The return value is of type QCharRef, a helper class for QString. When you get an object of type QCharRef, you can use it as if it @@ -4457,7 +4455,7 @@ modifiable reference. Equivalent to \c at(position). Example: - \snippet doc/src/snippets/qstring/main.cpp 83 + \snippet qstring/main.cpp 83 If \a position is negative, it is equivalent to passing zero. @@ -4477,7 +4475,7 @@ void QString::truncate(int pos) If \a n is greater than size(), the result is an empty string. Example: - \snippet doc/src/snippets/qstring/main.cpp 15 + \snippet qstring/main.cpp 15 If you want to remove characters from the \e beginning of the string, use remove() instead. @@ -4497,7 +4495,7 @@ void QString::chop(int n) Example: - \snippet doc/src/snippets/qstring/main.cpp 21 + \snippet qstring/main.cpp 21 \sa resize() */ @@ -4536,7 +4534,7 @@ QString& QString::fill(QChar ch, int size) Example: - \snippet doc/src/snippets/qstring/main.cpp 58 + \snippet qstring/main.cpp 58 \sa isEmpty(), resize() */ @@ -4547,7 +4545,7 @@ QString& QString::fill(QChar ch, int size) Example: - \snippet doc/src/snippets/qstring/main.cpp 28 + \snippet qstring/main.cpp 28 Qt makes a distinction between null strings and empty strings for historical reasons. For most applications, what matters is @@ -4564,7 +4562,7 @@ QString& QString::fill(QChar ch, int size) Example: - \snippet doc/src/snippets/qstring/main.cpp 27 + \snippet qstring/main.cpp 27 \sa size() */ @@ -4576,7 +4574,7 @@ QString& QString::fill(QChar ch, int size) Example: - \snippet doc/src/snippets/qstring/main.cpp 84 + \snippet qstring/main.cpp 84 This operation is typically very fast (\l{constant time}), because QString preallocates extra space at the end of the string @@ -4598,7 +4596,7 @@ QString& QString::fill(QChar ch, int size) \overload operator+=() Appends the byte array \a ba to this string. The byte array is converted - to Unicode using the fromAscii() function. If any NUL characters ('\0') + to Unicode using the fromAscii() function. If any NUL characters ('\\0') are embedded in the \a ba byte array, they will be included in the transformation. @@ -4805,7 +4803,7 @@ QString& QString::fill(QChar ch, int size) a human would expect. Consider sorting user-visible strings with localeAwareCompare(). - \snippet doc/src/snippets/qstring/main.cpp 16 + \snippet qstring/main.cpp 16 \sa operator==(), operator<(), operator>() */ @@ -5089,13 +5087,13 @@ const ushort *QString::utf16() const If \a truncate is false and the size() of the string is more than \a width, then the returned string is a copy of the string. - \snippet doc/src/snippets/qstring/main.cpp 32 + \snippet qstring/main.cpp 32 If \a truncate is true and the size() of the string is more than \a width, then any characters in a copy of the string after position \a width are removed, and the copy is returned. - \snippet doc/src/snippets/qstring/main.cpp 33 + \snippet qstring/main.cpp 33 \sa rightJustified() */ @@ -5125,7 +5123,7 @@ QString QString::leftJustified(int width, QChar fill, bool truncate) const Returns a string of size() \a width that contains the \a fill character followed by the string. For example: - \snippet doc/src/snippets/qstring/main.cpp 49 + \snippet qstring/main.cpp 49 If \a truncate is false and the size() of the string is more than \a width, then the returned string is a copy of the string. @@ -5134,7 +5132,7 @@ QString QString::leftJustified(int width, QChar fill, bool truncate) const \a width, then the resulting string is truncated at position \a width. - \snippet doc/src/snippets/qstring/main.cpp 50 + \snippet qstring/main.cpp 50 \sa leftJustified() */ @@ -5163,7 +5161,7 @@ QString QString::rightJustified(int width, QChar fill, bool truncate) const /*! Returns a lowercase copy of the string. - \snippet doc/src/snippets/qstring/main.cpp 75 + \snippet qstring/main.cpp 75 The case conversion will always happen in the 'C' locale. For locale dependent case folding use QLocale::toLower() @@ -5286,7 +5284,7 @@ QString QString::toCaseFolded() const /*! Returns an uppercase copy of the string. - \snippet doc/src/snippets/qstring/main.cpp 81 + \snippet qstring/main.cpp 81 The case conversion will always happen in the 'C' locale. For locale dependent case folding use QLocale::toUpper() @@ -5369,14 +5367,14 @@ QString QString::toUpper() const \c{long long}). If you need those, use the standard snprintf() function instead: - \snippet doc/src/snippets/qstring/main.cpp 63 + \snippet qstring/main.cpp 63 \warning We do not recommend using QString::sprintf() in new Qt code. Instead, consider using QTextStream or arg(), both of which support Unicode strings seamlessly and are type-safe. Here's an example that uses QTextStream: - \snippet doc/src/snippets/qstring/main.cpp 64 + \snippet qstring/main.cpp 64 For \l {QObject::tr()}{translations}, especially if the strings contains more than one escape sequence, you should consider using @@ -5749,7 +5747,7 @@ QString &QString::vsprintf(const char* cformat, va_list ap) Example: - \snippet doc/src/snippets/qstring/main.cpp 74 + \snippet qstring/main.cpp 74 \sa number(), toULongLong(), toInt(), QLocale::toLongLong() */ @@ -5784,7 +5782,7 @@ qint64 QString::toLongLong(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 79 + \snippet qstring/main.cpp 79 \sa number(), toLongLong(), QLocale::toULongLong() */ @@ -5821,7 +5819,7 @@ quint64 QString::toULongLong(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 73 + \snippet qstring/main.cpp 73 \sa number(), toULong(), toInt(), QLocale::toLong() */ @@ -5856,7 +5854,7 @@ long QString::toLong(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 78 + \snippet qstring/main.cpp 78 \sa number(), QLocale::toULong() */ @@ -5890,7 +5888,7 @@ ulong QString::toULong(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 72 + \snippet qstring/main.cpp 72 \sa number(), toUInt(), toDouble(), QLocale::toInt() */ @@ -5923,7 +5921,7 @@ int QString::toInt(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 77 + \snippet qstring/main.cpp 77 \sa number(), toInt(), QLocale::toUInt() */ @@ -5956,7 +5954,7 @@ uint QString::toUInt(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 76 + \snippet qstring/main.cpp 76 \sa number(), toUShort(), toInt(), QLocale::toShort() */ @@ -5989,7 +5987,7 @@ short QString::toShort(bool *ok, int base) const Example: - \snippet doc/src/snippets/qstring/main.cpp 80 + \snippet qstring/main.cpp 80 \sa number(), toShort(), QLocale::toUShort() */ @@ -6014,25 +6012,25 @@ ushort QString::toUShort(bool *ok, int base) const If a conversion error occurs, \c{*}\a{ok} is set to false; otherwise \c{*}\a{ok} is set to true. - \snippet doc/src/snippets/qstring/main.cpp 66 + \snippet qstring/main.cpp 66 Various string formats for floating point numbers can be converted to double values: - \snippet doc/src/snippets/qstring/main.cpp 67 + \snippet qstring/main.cpp 67 The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toDouble() - \snippet doc/src/snippets/qstring/main.cpp 68 + \snippet qstring/main.cpp 68 For historic reasons, this function does not handle thousands group separators. If you need to convert such numbers, use QLocale::toDouble(). - \snippet doc/src/snippets/qstring/main.cpp 69 + \snippet qstring/main.cpp 69 - \sa number() QLocale::setDefault() QLocale::toDouble() trimmed() + \sa number(), QLocale::setDefault(), QLocale::toDouble(), trimmed() */ double QString::toDouble(bool *ok) const @@ -6052,7 +6050,7 @@ double QString::toDouble(bool *ok) const Example: - \snippet doc/src/snippets/qstring/main.cpp 71 + \snippet qstring/main.cpp 71 \sa number(), toDouble(), toInt(), QLocale::toFloat() */ @@ -6081,7 +6079,7 @@ float QString::toFloat(bool *ok) const The base is 10 by default and must be between 2 and 36. For bases other than 10, \a n is treated as an unsigned integer. - \snippet doc/src/snippets/qstring/main.cpp 56 + \snippet qstring/main.cpp 56 The formatting always uses QLocale::C, i.e., English/UnitedStates. To get a localized string representation of a number, use @@ -6220,7 +6218,7 @@ QString &QString::setNum(double n, char f, int prec) To get a localized string representation of a number, use QLocale::toString() with the appropriate locale. - \snippet doc/src/snippets/qstring/main.cpp 35 + \snippet qstring/main.cpp 35 \sa setNum() */ @@ -6318,7 +6316,7 @@ QString QString::number(double n, char f, int prec) Example: - \snippet doc/src/snippets/qstring/main.cpp 62 + \snippet qstring/main.cpp 62 \sa QStringList::join(), section() */ @@ -6369,18 +6367,18 @@ QStringList QString::split(QChar sep, SplitBehavior behavior, Qt::CaseSensitivit Here's an example where we extract the words in a sentence using one or more whitespace characters as the separator: - \snippet doc/src/snippets/qstring/main.cpp 59 + \snippet qstring/main.cpp 59 Here's a similar example, but this time we use any sequence of non-word characters as the separator: - \snippet doc/src/snippets/qstring/main.cpp 60 + \snippet qstring/main.cpp 60 Here's a third example where we use a zero-length assertion, \b{\\b} (word boundary), to split the string into an alternating sequence of non-word and word tokens: - \snippet doc/src/snippets/qstring/main.cpp 61 + \snippet qstring/main.cpp 61 \sa QStringList::join(), section() */ @@ -6418,18 +6416,18 @@ QStringList QString::split(const QRegExp &rx, SplitBehavior behavior) const Here's an example where we extract the words in a sentence using one or more whitespace characters as the separator: - \snippet doc/src/snippets/qstring/main.cpp 90 + \snippet qstring/main.cpp 90 Here's a similar example, but this time we use any sequence of non-word characters as the separator: - \snippet doc/src/snippets/qstring/main.cpp 91 + \snippet qstring/main.cpp 91 Here's a third example where we use a zero-length assertion, - \bold{\\b} (word boundary), to split the string into an + \b{\\b} (word boundary), to split the string into an alternating sequence of non-word and word tokens: - \snippet doc/src/snippets/qstring/main.cpp 92 + \snippet qstring/main.cpp 92 \sa QStringList::join(), section() */ @@ -6770,7 +6768,7 @@ static QString replaceArgEscapes(const QString &s, const ArgEscapeData &d, int f This example shows how we might create a \c status string for reporting progress while processing a list of files: - \snippet doc/src/snippets/qstring/main.cpp 11 + \snippet qstring/main.cpp 11 First, \c arg(i) replaces \c %1. Then \c arg(total) replaces \c %2. Finally, \c arg(fileName) replaces \c %3. @@ -6806,7 +6804,7 @@ QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const strings \a a1 and \a a2 are replaced in one pass. This can make a difference if \a a1 contains e.g. \c{%1}: - \snippet doc/src/snippets/qstring/main.cpp 13 + \snippet qstring/main.cpp 13 */ /*! @@ -6893,8 +6891,8 @@ QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const locale was specified, the "C" locale is used. The 'L' flag is ignored if \a base is not 10. - \snippet doc/src/snippets/qstring/main.cpp 12 - \snippet doc/src/snippets/qstring/main.cpp 14 + \snippet qstring/main.cpp 12 + \snippet qstring/main.cpp 14 If \a fillChar is '0' (the number 0, ASCII 48), the locale's zero is used. For negative numbers, zero padding might appear before the @@ -6930,8 +6928,8 @@ QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const using QLocale::setDefault(). The 'L' flag is ignored if \a base is not 10. - \snippet doc/src/snippets/qstring/main.cpp 12 - \snippet doc/src/snippets/qstring/main.cpp 14 + \snippet qstring/main.cpp 12 + \snippet qstring/main.cpp 14 If \a fillChar is '0' (the number 0, ASCII 48), the locale's zero is used. For negative numbers, zero padding might appear before the @@ -7114,7 +7112,7 @@ QString QString::arg(char a, int fieldWidth, QChar fillChar) const value produces right-aligned text; a negative value produces left-aligned text. - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 2 + \snippet code/src_corelib_tools_qstring.cpp 2 The '%' can be followed by an 'L', in which case the sequence is replaced with a localized representation of \a a. The conversion @@ -7310,7 +7308,7 @@ bool QString::isRightToLeft() const Example: - \snippet doc/src/snippets/qstring/main.cpp 19 + \snippet qstring/main.cpp 19 Note that the pointer remains valid only as long as the string is not modified by other means. For read-only access, constData() is @@ -7398,8 +7396,8 @@ bool QString::isRightToLeft() const Here's an example of how we can use a QRegExp on raw data in memory without requiring to copy the data into a QString: - \snippet doc/src/snippets/qstring/main.cpp 22 - \snippet doc/src/snippets/qstring/main.cpp 23 + \snippet qstring/main.cpp 22 + \snippet qstring/main.cpp 23 \warning A string created with fromRawData() is \e not '\\0'-terminated, unless the raw data contains a '\\0' character @@ -7475,11 +7473,11 @@ QString &QString::setRawData(const QChar *unicode, int size) the \c{const char *} data. For example, assuming \c str is a QString, - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 3 + \snippet code/src_corelib_tools_qstring.cpp 3 is much faster than - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 4 + \snippet code/src_corelib_tools_qstring.cpp 4 because it doesn't construct four temporary QString objects and make a deep copy of the character data. @@ -7491,7 +7489,7 @@ QString &QString::setRawData(const QChar *unicode, int size) just a very thin wrapper around a \c{const char *}. Using QLatin1String, the example code above becomes - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 5 + \snippet code/src_corelib_tools_qstring.cpp 5 This is a bit longer to type, but it provides exactly the same benefits as the first version of the code, and is faster than @@ -7501,7 +7499,7 @@ QString &QString::setRawData(const QChar *unicode, int size) QLatin1String can be used everywhere a QString is expected. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 6 + \snippet code/src_corelib_tools_qstring.cpp 6 \sa QString, QLatin1Char, QStringLiteral */ @@ -8369,7 +8367,7 @@ QString &QString::append(const QStringRef &str) If \a n is greater than size() or less than zero, a reference to the entire string is returned. - \snippet doc/src/snippets/qstring/main.cpp leftRef + \snippet qstring/main.cpp leftRef \sa left(), rightRef(), midRef(), startsWith() */ @@ -8389,7 +8387,7 @@ QStringRef QString::leftRef(int n) const If \a n is greater than size() or less than zero, a reference to the entire string is returned. - \snippet doc/src/snippets/qstring/main.cpp rightRef + \snippet qstring/main.cpp rightRef \sa right(), leftRef(), midRef(), endsWith() */ @@ -8416,7 +8414,7 @@ QStringRef QString::rightRef(int n) const Example: - \snippet doc/src/snippets/qstring/main.cpp midRef + \snippet qstring/main.cpp midRef \sa mid(), leftRef(), rightRef() */ @@ -9160,7 +9158,7 @@ QVector QStringRef::toUcs4() const Example: - \snippet doc/src/snippets/code/src_corelib_tools_qstring.cpp 7 + \snippet code/src_corelib_tools_qstring.cpp 7 */ QString QString::toHtmlEscaped() const { diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 6999972..a044cca 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -95,7 +95,7 @@ QT_BEGIN_NAMESPACE \c QChar, \c QCharRef, \c QLatin1Char, and \c char. */ -/*! \fn QByteArray QStringBuilder::toLatin1() const +/* \fn QByteArray QStringBuilder::toLatin1() const Returns a Latin-1 representation of the string as a QByteArray. The returned byte array is undefined if the string contains non-Latin1 characters. diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index bfe2c5e..c25d326 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE {QList::operator+=()}{operator+=()} and \l {QStringList::operator<<()}{operator<<()} functions. For example: - \snippet doc/src/snippets/qstringlist/main.cpp 0 + \snippet qstringlist/main.cpp 0 \section1 Iterating over the strings @@ -111,15 +111,15 @@ QT_BEGIN_NAMESPACE Indexing: - \snippet doc/src/snippets/qstringlist/main.cpp 1 + \snippet qstringlist/main.cpp 1 Java-style iterator: - \snippet doc/src/snippets/qstringlist/main.cpp 2 + \snippet qstringlist/main.cpp 2 STL-style iterator: - \snippet doc/src/snippets/qstringlist/main.cpp 3 + \snippet qstringlist/main.cpp 3 The QStringListIterator class is simply a type definition for QListIterator. QStringList also provide the @@ -133,12 +133,12 @@ QT_BEGIN_NAMESPACE string list into a single string (with an optional separator) using the join() function. For example: - \snippet doc/src/snippets/qstringlist/main.cpp 4 + \snippet qstringlist/main.cpp 4 To break up a string into a string list, use the QString::split() function: - \snippet doc/src/snippets/qstringlist/main.cpp 6 + \snippet qstringlist/main.cpp 6 The argument to split can be a single character, a string, or a QRegExp. @@ -152,7 +152,7 @@ QT_BEGIN_NAMESPACE contain a particular substring (or match a particular regular expression): - \snippet doc/src/snippets/qstringlist/main.cpp 7 + \snippet qstringlist/main.cpp 7 The contains() function tells you whether the list contains a given string, while the indexOf() function returns the index of @@ -163,7 +163,7 @@ QT_BEGIN_NAMESPACE Finally, the replaceInStrings() function calls QString::replace() on each string in the string list in turn. For example: - \snippet doc/src/snippets/qstringlist/main.cpp 8 + \snippet qstringlist/main.cpp 8 \sa QString */ @@ -180,7 +180,7 @@ QT_BEGIN_NAMESPACE Constructs a string list that contains the given string, \a str. Longer lists are easily created like this: - \snippet doc/src/snippets/qstringlist/main.cpp 9 + \snippet qstringlist/main.cpp 9 \sa append() */ @@ -255,13 +255,13 @@ void QtPrivate::QStringList_sort(QStringList *that, Qt::CaseSensitivity cs) comparison is case sensitive; otherwise the comparison is case insensitive. - \snippet doc/src/snippets/qstringlist/main.cpp 5 - \snippet doc/src/snippets/qstringlist/main.cpp 10 + \snippet qstringlist/main.cpp 5 + \snippet qstringlist/main.cpp 10 This is equivalent to - \snippet doc/src/snippets/qstringlist/main.cpp 11 - \snippet doc/src/snippets/qstringlist/main.cpp 12 + \snippet qstringlist/main.cpp 11 + \snippet qstringlist/main.cpp 12 \sa contains() */ @@ -348,8 +348,8 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula For example: - \snippet doc/src/snippets/qstringlist/main.cpp 5 - \snippet doc/src/snippets/qstringlist/main.cpp 13 + \snippet qstringlist/main.cpp 5 + \snippet qstringlist/main.cpp 13 \sa QString::replace() */ @@ -372,8 +372,8 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QString &b For example: - \snippet doc/src/snippets/qstringlist/main.cpp 5 - \snippet doc/src/snippets/qstringlist/main.cpp 14 + \snippet qstringlist/main.cpp 5 + \snippet qstringlist/main.cpp 14 For regular expressions that contain \l{capturing parentheses}, occurrences of \b{\\1}, \b{\\2}, ..., in \a after are @@ -381,8 +381,8 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QString &b For example: - \snippet doc/src/snippets/qstringlist/main.cpp 5 - \snippet doc/src/snippets/qstringlist/main.cpp 15 + \snippet qstringlist/main.cpp 5 + \snippet qstringlist/main.cpp 15 */ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &rx, const QString &after) { diff --git a/src/corelib/tools/qtimeline.cpp b/src/corelib/tools/qtimeline.cpp index f0d8c24..0c1ed4d 100644 --- a/src/corelib/tools/qtimeline.cpp +++ b/src/corelib/tools/qtimeline.cpp @@ -182,7 +182,7 @@ void QTimeLinePrivate::setCurrentTime(int msecs) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qtimeline.cpp 0 + \snippet code/src_corelib_tools_qtimeline.cpp 0 You can also use QTimeLine with the \l{Graphics View}{Graphics View framework} for diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc index e92f91a..7481260 100644 --- a/src/corelib/tools/qvarlengtharray.qdoc +++ b/src/corelib/tools/qvarlengtharray.qdoc @@ -35,12 +35,12 @@ The C++ language doesn't support variable-length arrays on the stack. For example, the following code won't compile: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 0 + \snippet code/doc_src_qvarlengtharray.cpp 0 The alternative is to allocate the array on the heap (with \c{new}): - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 1 + \snippet code/doc_src_qvarlengtharray.cpp 1 However, if myfunc() is called very frequently from the application's inner loop, heap allocation can be a major source @@ -53,7 +53,7 @@ it is much faster than heap allocation. Example: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 2 + \snippet code/doc_src_qvarlengtharray.cpp 2 In the example above, QVarLengthArray will preallocate 1024 elements on the stack and use them unless \c{n + 1} is greater @@ -260,7 +260,7 @@ be used to access and modify the items in the array. Example: - \snippet doc/src/snippets/code/doc_src_qvarlengtharray.cpp 3 + \snippet code/doc_src_qvarlengtharray.cpp 3 The pointer remains valid as long as the array isn't reallocated. diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 0026338..20501f9 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -119,20 +119,20 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Here's an example of a QVector that stores integers and a QVector that stores QString values: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 0 + \snippet code/src_corelib_tools_qvector.cpp 0 QVector stores a vector (or array) of items. Typically, vectors are created with an initial size. For example, the following code constructs a QVector with 200 elements: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 1 + \snippet code/src_corelib_tools_qvector.cpp 1 The elements are automatically initialized with a \l{default-constructed value}. If you want to initialize the vector with a different value, pass that value as the second argument to the constructor: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 2 + \snippet code/src_corelib_tools_qvector.cpp 2 You can also call fill() at any time to fill the vector with a value. @@ -142,11 +142,11 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) non-const vectors, operator[]() returns a reference to the item that can be used on the left side of an assignment: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 3 + \snippet code/src_corelib_tools_qvector.cpp 3 For read-only access, an alternative syntax is to use at(): - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 4 + \snippet code/src_corelib_tools_qvector.cpp 4 at() can be faster than operator[](), because it never causes a \l{deep copy} to occur. @@ -164,7 +164,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) backward. Both return the index of the matching item if they found one; otherwise, they return -1. For example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 5 + \snippet code/src_corelib_tools_qvector.cpp 5 If you simply want to check whether a vector contains a particular value, use contains(). If you want to find out how @@ -411,7 +411,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) can be used to access and modify the items in the vector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 6 + \snippet code/src_corelib_tools_qvector.cpp 6 The pointer remains valid as long as the vector isn't reallocated. @@ -482,7 +482,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Inserts \a value at the end of the vector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 7 + \snippet code/src_corelib_tools_qvector.cpp 7 This is the same as calling resize(size() + 1) and assigning \a value to the new last element in the vector. @@ -499,7 +499,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Inserts \a value at the beginning of the vector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 8 + \snippet code/src_corelib_tools_qvector.cpp 8 This is the same as vector.insert(0, \a value). @@ -519,7 +519,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) value is appended to the vector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 9 + \snippet code/src_corelib_tools_qvector.cpp 9 For large vectors, this operation can be slow (\l{linear time}), because it requires moving all the items at indexes \a i and @@ -538,7 +538,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) vector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 10 + \snippet code/src_corelib_tools_qvector.cpp 10 */ /*! \fn QVector::iterator QVector::insert(iterator before, const T &value) @@ -592,7 +592,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) size beforehand. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 11 + \snippet code/src_corelib_tools_qvector.cpp 11 \sa resize() */ @@ -604,7 +604,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Returns -1 if no item matched. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 12 + \snippet code/src_corelib_tools_qvector.cpp 12 This function requires the value type to have an implementation of \c operator==(). @@ -620,7 +620,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) last item. Returns -1 if no item matched. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 13 + \snippet code/src_corelib_tools_qvector.cpp 13 This function requires the value type to have an implementation of \c operator==(). @@ -966,7 +966,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 14 + \snippet code/src_corelib_tools_qvector.cpp 14 \sa fromList(), QList::fromVector() */ @@ -977,7 +977,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 15 + \snippet code/src_corelib_tools_qvector.cpp 15 \sa toList(), QList::toVector() */ @@ -989,7 +989,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 16 + \snippet code/src_corelib_tools_qvector.cpp 16 \sa toStdVector(), QList::fromStdList() */ @@ -999,7 +999,7 @@ int QVectorData::grow(int sizeOfHeader, int size, int sizeOfT) Returns a std::vector object with the data contained in this QVector. Example: - \snippet doc/src/snippets/code/src_corelib_tools_qvector.cpp 17 + \snippet code/src_corelib_tools_qvector.cpp 17 \sa fromStdVector(), QList::toStdList() */ diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index df2c2f9..769cdc9 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -291,7 +291,7 @@ QXmlStreamEntityResolver *QXmlStreamReader::entityResolver() const A typical loop with QXmlStreamReader looks like this: - \snippet doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp 0 + \snippet code/src_corelib_xml_qxmlstream.cpp 0 QXmlStreamReader is a well-formed XML 1.0 parser that does \e not @@ -2900,11 +2900,11 @@ QStringRef QXmlStreamReader::documentEncoding() const The following abridged code snippet shows the basic use of the class to write formatted XML with indentation: - \snippet doc/src/snippets/qxmlstreamwriter/main.cpp start stream + \snippet qxmlstreamwriter/main.cpp start stream \dots - \snippet doc/src/snippets/qxmlstreamwriter/main.cpp write element + \snippet qxmlstreamwriter/main.cpp write element \dots - \snippet doc/src/snippets/qxmlstreamwriter/main.cpp finish stream + \snippet qxmlstreamwriter/main.cpp finish stream QXmlStreamWriter takes care of prefixing namespaces, all you have to do is specify the \c namespaceUri when writing elements or @@ -3561,7 +3561,7 @@ void QXmlStreamWriter::writeEmptyElement(const QString &namespaceUri, const QStr This is a convenience function equivalent to: - \snippet doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp 1 + \snippet code/src_corelib_xml_qxmlstream.cpp 1 */ void QXmlStreamWriter::writeTextElement(const QString &qualifiedName, const QString &text) @@ -3578,7 +3578,7 @@ void QXmlStreamWriter::writeTextElement(const QString &qualifiedName, const QStr This is a convenience function equivalent to: - \snippet doc/src/snippets/code/src_corelib_xml_qxmlstream.cpp 2 + \snippet code/src_corelib_xml_qxmlstream.cpp 2 */ void QXmlStreamWriter::writeTextElement(const QString &namespaceUri, const QString &name, const QString &text) diff --git a/src/corelib/xml/qxmlutils.cpp b/src/corelib/xml/qxmlutils.cpp index 7ec2088..89912b4 100644 --- a/src/corelib/xml/qxmlutils.cpp +++ b/src/corelib/xml/qxmlutils.cpp @@ -227,7 +227,7 @@ bool QXmlUtils::isBaseChar(const QChar c) Determines whether \a encName is a valid instance of production [81]EncName in the XML 1.0 specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml/#NT-EncName} + \sa {http://www.w3.org/TR/REC-xml/#NT-EncName}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [81] EncName} */ bool QXmlUtils::isEncName(const QString &encName) @@ -248,7 +248,7 @@ bool QXmlUtils::isEncName(const QString &encName) Determines whether \a c is a valid instance of production [84]Letter in the XML 1.0 specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml/#NT-Letter} + \sa {http://www.w3.org/TR/REC-xml/#NT-Letter}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [84] Letter} */ bool QXmlUtils::isLetter(const QChar c) @@ -262,7 +262,7 @@ bool QXmlUtils::isLetter(const QChar c) Determines whether \a c is a valid instance of production [2]Char in the XML 1.0 specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml/#NT-Char} + \sa {http://www.w3.org/TR/REC-xml/#NT-Char}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [2] Char} */ bool QXmlUtils::isChar(const QChar c) @@ -281,7 +281,7 @@ bool QXmlUtils::isChar(const QChar c) production [4]NameChar in the XML 1.0 specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml/#NT-NameChar} + \sa {http://www.w3.org/TR/REC-xml/#NT-NameChar}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [4] NameChar} */ bool QXmlUtils::isNameChar(const QChar c) @@ -304,7 +304,7 @@ bool QXmlUtils::isNameChar(const QChar c) production [12] PubidLiteral in the XML 1.0 specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml/#NT-PubidLiteral} + \sa {http://www.w3.org/TR/REC-xml/#NT-PubidLiteral}, {Extensible Markup Language (XML) 1.0 (Fourth Edition), [12] PubidLiteral} */ bool QXmlUtils::isPublicID(const QString &candidate) @@ -363,7 +363,7 @@ bool QXmlUtils::isPublicID(const QString &candidate) production [4]NCName in the XML 1.0 Namespaces specification. If it is, true is returned, otherwise false. - \sa \l {http://www.w3.org/TR/REC-xml-names/#NT-NCName} + \sa {http://www.w3.org/TR/REC-xml-names/#NT-NCName}, {W3CNamespaces in XML 1.0 (Second Edition), [4] NCName} */ bool QXmlUtils::isNCName(const QStringRef &ncName) -- 2.7.4