Commit Graph

34430 Commits

Author SHA1 Message Date
Martin Smith
64d976ef1a Add template text to \fn commands in QScopedPointer
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.

Change-Id: If45465880933174f1481a8be292474be191cfd45
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:39 +00:00
Martin Smith
b2cad63cc1 doc: Add template text to \fn commands in qglobal.cpp
This update corrects many qdoc warnings in qglobal.cpp caused by
incomplete \fn commands. It also corrects many undocumented parameter
errors caused by clang's requirement that the formal parameter names
be the same in both the declaration in the include file and the \fn
command.

Some formal parameter names were changed in the declarations in the
header file.

Change-Id: I4cd38f30461c585b97ec11923cdbc81a41fe00b8
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:30 +00:00
Martin Smith
efdcc88462 doc: Change invokeMethod() comments to work with clang
There were four dummy declarations for struct QMetaObject that were
needed by old qdoc to allow documentation of some very complicated
function signatures that old qdoc could not parse. clangqdoc can now
parse these signatures, but, unfortunately, old qdoc is still used to
parse \fn commands in .cpp and .qdoc files, so the dummy declarations
are still needed in struct QMetaObject. However, clangqdoc now
sees that two of the four dummy declarations are actually duplicates
of the other two, and then old qdoc complains when it can't find all
four of the function nodes, when it parses the four \fn commands.
This update removes the duplicate dummy declarations and the two
redundant \fn comments. The remaining two \fn comments are
updated accordingly.

This change also moves a couple of qdoc comments so they are located
with the function definitions that they are documenting.

Change-Id: I85e2492ba0380b01c3700b3dc7db0913d6429701
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-08 14:05:17 +00:00
Edward Welbourne
960c712b48 Remove spurious execute permissions
Change-Id: I2aa16d49bb8eb474200c70f312b4eb7cfc1604cb
Reviewed-by: David Faure <david.faure@kdab.com>
2017-12-08 13:27:42 +00:00
Edward Welbourne
1c1f42b4dc Deduplicate a common check for legacy codes
All of QLocalePrivate::codeToLanguage()'s legacy codes were
two-letter, so duplicated a "third letter is 0" check; pulling it out
in front of them all will get any three-letter code more promptly to
the final fall-back, while saving the two-letter codes repetition of
the check.

Change-Id: I8ee81a526adaa7b24c11c1de7a1750d87deb5fb3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2017-12-08 13:27:31 +00:00
Ville Voutilainen
9856f869f5 Fix documentation for function objects with map/reduce
The documentation claims that function objects just work with
map-reduce. They work for the map function, but not for the reduce
function. Making them work for the reduce function was deemed
too complex for questionable benefit, so this patch explains
the situation and provides a work-around.

Task-number: QTBUG-22710
Change-Id: I7f706468e36031bc261234310d331001b96e5137
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-12-08 04:43:38 +00:00
Shawn Rutledge
216b680830 Improve QTabletEvent::rotation documentation
- There was a typo
- It has not been limited to the 4D mouse for some time now
- The Apple Pencil now supports rotation too

Change-Id: I96e20a56491fbcb80e19dc39d0b48b543217aa24
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-07 20:07:16 +00:00
Marc Mutz
48230dc882 QRegion: deprecate rects()
It was superseded by begin()/end() in Qt 5.8.

The eventual removal of rects() will allow greater flexibility
in the implementation's choice of data structure (std::vector,
e.g., or QVarLengthArray).

Remove all traces of rects() from the documentation. This means
we need to copy information previously contained in the rects()
docs to functions which previously just referred to rects(), in
particular the begin()/end() familiy of functions.

Change-Id: I90809809783252f7c552f24b4841f1e965580284
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-07 19:10:15 +00:00
Marc Mutz
f33a1f574a Port away from QRegion::rects()
Use being()/end() instead.

These were the last remaining uses of QRegion::rects() within qtbase.

Change-Id: I264beb6f660968f40eecbbee2260341fca94ddb5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-07 19:10:12 +00:00
Marc Mutz
a31f65d8c8 tst_QRegion: compile under QT_DISABLE_DEPRECATED_BEFORE=0x051200
The introduction of begin()/end() actually made most tests
that still use rects() duplicates. Keep them, though, for
test coverage (rects() takes a very different code path
from begin()/end()), but, under the assumption that Qt at
some point will default to built with deprecated APIs dis-
abled, make the test compile with disabled deprecated API.

Port some checks that still used rects() to begin()/end().

Change-Id: Ia7da80f0cd6ef69693f54a474924683624a2c3eb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-07 19:10:09 +00:00
Jan Murawski
b461ac36ed Add command line switch to help output
Add the command line switch added in change
184c5470f534119b27c1a4caec29d699aba9c234 on qtdeclarative to the
help output of the qmltestrunner application.

Change-Id: I9f42719500e0039afa6a5b0f1f365611855229b3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2017-12-07 08:22:29 +00:00
Marc Mutz
33be3fe92b QVector: drop QRegion friendship: it's not needed
I don't know when it ceased to be needed, but QRegion no longer
does anything fancy with QVector.

Change-Id: I1bdfefc84724c379fab76dada35575666144df12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-06 22:40:15 +00:00
Marc Mutz
8aacde5937 QAlphaPaintEngine: port away from QRegion::rects()
Use begin()/end() instead.

The old code extracted the rects from the region, then checked for a 'complex'
region (by comparing the number of rectangles against 10), and replacing the
region with the bounding rect if it was too complex. It then went on to adjust
the rectangle list it had gotten from the original region to match the new.

Simply delay getting the rectangles until after we have modified the region.
Since there are many member function calls in-between, take a copy of the
region to iterate over later, rather than relying on the region to be left
untouched by all the code in-between.

Change-Id: I49ddf4d545520ab435ab6b89eec3d24cf371823e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:31:28 +00:00
Marc Mutz
a016bed95f xcb: port away from last QRegion::rects()
Use begin()/end() instead.

In QXcbShmImage::flushPixmap(), instead of gettings different rects(),
depending on a bool parameter, just call yourself again with the
modified QRegion, which we can then just iterate over.

Change-Id: I6d4f7c6e4e5d2a24520716847ca9331bf39337c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:31:00 +00:00
Marc Mutz
9e18722086 xcb: share code for QRegion -> xcb_rectangle_t[] conversion
... between QXcbWindow and QxcbShmImage.

Replaces one QRegion::rects() call (to be deprecated), fixes potential overflows
that QXcbShmImage did not handle, but QXcbWindow did, and saves ~1KiB of text size.

Change-Id: I55d37021164feefe0cb3e60bd6d22b1976a6467b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:30:57 +00:00
Marc Mutz
0302697370 QtGui: port away from QRegion::rects()
Use begin()/end()/rectCount() instead, which don't require QRegionPrivate
::vectorize() calls.

In QPaintEngineEx::clip(), the rectCount() == 1 case called clip(QRect), but
forgot to return, causing another clip(QVectorPath) call with the same
arguments. Fixed.

Change-Id: Ife33112fc8006ed4bdff6409e2b8465ce7acb9d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-06 18:30:55 +00:00
Marc Mutz
85d8975bc9 tst_QWidget: port away from QRegion::rects()
Drop the useless copy 'r' of 'region', reuse 'r' for the rects in 'region',
to clean up the region handling in verifyColor().

Change-Id: I8e159976b4b0152823be864488d2ef25d7cb0078
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2017-12-06 18:30:52 +00:00
Marc Mutz
28fbd13e22 xcb: use a more efficient unique_ptr instantiation
Wrap std::free() in a function object, to avoid having to carry around
state (the function pointer) inside unique_ptr objects. This shrinks
unique_ptrs back to sizeof(void*).

Change-Id: I32a711192c5485dc04e3b36a1ddabf02d1e9d4f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-12-06 18:30:49 +00:00
Martin Smith
6fed5cf4e2 doc: Add missing template parameters to \fn commands
This update corrects many qdoc warnings in qsharedpointer.cpp and
qshareddata.cpp caused by incomplete \fn commands. Template stuff
was added to the \fn commands.

Change-Id: Ic10bcf04477d5f3d5380aeb1e58050a88f03005a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 10:04:28 +00:00
Martin Smith
aefb3a9a07 doc: Ensure clangqdoc sees declarations
This update corrects several uses of #ifdef macros
that needed updating because qdoc now uses clang to
parse header files.

Change-Id: I285efa4629a1a5d5bcbfaf701eeafbd0e9f1e43e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 10:02:31 +00:00
Albert Astals Cid
ceccdff4e9 Remove QPageSetupWidget::selectPrinter
t's only ever called after setPrinter so merge the code

Change-Id: I4b5d593edbe62b64354e81c19112fa87b0555fdc
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 09:57:24 +00:00
Albert Astals Cid
072dd59de7 Remove QPrintPropertiesDialog::selectPrinter
It is only ever called after the constructor, so merge the code

Change-Id: I5c75a2cd367af401b41920f51754a64dc6c6eb40
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:37 +00:00
Albert Astals Cid
881690969c Remove QCupsJobWidget::setPrinter
It is only ever called after the constructor so merge the code

Change-Id: I381165ad90c85342e5db3c16327d729388b71fb2
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:11 +00:00
Albert Astals Cid
f135d515e8 Remove QPrintPropertiesDialog::applyPrinterProperties
It's only ever called after the constructor so merge its code to the constructor

Change-Id: Icca88764f725b9aeaa08ee7387da8885be247fba
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:28:00 +00:00
Albert Astals Cid
fb1836898f Remove QUnixPrintWidgetPrivate::applyPrinterProperties
And move it's code to the only place it is called, the QUnixPrintWidget constructor,
that means we can remove the if that checks if propertiesDialog is not null since
at that stage we know it is null

Change-Id: I81cdaa0505fa6fe64a45c7d1f5c3e277400cbbf7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:27:48 +00:00
Albert Astals Cid
2ecfdf87b8 Remove QPrintDialogPrivate::applyPrinterProperties, no one calls it
Change-Id: Ic140f62e5cb63c6a4b7f4fa10ca243d8bb055c4e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-12-06 07:27:39 +00:00
Gatis Paeglis
083d3b885e xcb: remove redundant QT_XCB_DEBUG_XINPUT* envvars
In Qt 5.4 these envvars were replaced with categorized logging
59ba84d31c. This is not a public
API, the log output is useful mostly for developers and it can
still be used via QT_LOGGING_RULES, so there is no good reason
to keep the old envvars around. By using QT_LOGGING_RULES, we
can access even more xinput2 logs than is available via
QT_XCB_DEBUG_XINPUT*.

Change-Id: I2b12b8696043bc8bf8310f49f0cdc2ba1b8708ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-12-06 07:27:13 +00:00
Martin Smith
e827fec40f doc: Add class qualifiers to parameter types
This change supplies several missing class qualifiers for
parameter types and function return types.

Change-Id: I569026e4da0948902fcc13557003d3748b85dd82
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:12:44 +00:00
Martin Smith
929ea50393 doc: Document remaining anonymous enums
This change adds qdoc comments for the remaining nameless
enum types.

Change-Id: I4da8b67883c8020323437cf74c938d3655d8c384
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:11:48 +00:00
Martin Smith
329e09a3c3 doc: Add missing template text to \fn commands
This update corrects about 200 qdoc warnings caused by incomplete
\fn commands for member functions of template classes. It can be
used as an example of how to fix \fn commands that suddenly cause
qdoc warnings now that qdoc uses clang to parse the \fn commands.

For example, with the old qdoc, we had this \fn command, which the
old qdoc handled correctly:

\fn QAtomicInteger::operator T() const

For the new clang-based qdoc, this \fn command must be written this way:

\fn template <typename T> QAtomicInteger<T>::operator T() const

However, the documentation generated by the clang-based qdoc looks the
same as it did in the old qdoc.

Change-Id: I7803b3b7ec7c6b8b3cc1be789bc36921438f527e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-06 07:06:16 +00:00
Marc Mutz
6fd1895900 styles: port away from QRegion::rects()
Use begin()/end() instead.

Drop the special handling of rectCount() == 1, since with begin()/end(),
we no longer take the hit of creating a QVector just to be able to return
it from rects().

Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:17:05 +00:00
Marc Mutz
634344411e platform plugins: port away from QRegion::rects()
Use begin()/end()/rectCount() instead.

Change-Id: I5c642c4a2c64da65d3f37159396c86073818ca95
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:17:02 +00:00
Marc Mutz
1d47df8d52 tst_QWidget: port some easy QRegion::rects() calls to begin()/end()
QRegion::rects() will be deprecated.

Change-Id: If890e70e3e44b22e15342d280aaa9d44013c4d7d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:16:59 +00:00
Marc Mutz
784ed9b4f7 QtTestLib: port away from QRegion::rects()
Use begin()/rectCount() instead.

Change-Id: I08cef424bf24ecf3c058e9b87411f2a5775ffb33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-12-06 05:16:56 +00:00
Martin Smith
8c8459258f doc: Fix qdoc errors in qfsfilengine.cpp
A few parameter types in \fn commands were not
qualified with their class name. They had to be
qualified because they were in a base class of
the class being documented.

Change-Id: Ic0b43be689d17a0a539ee977c0db6e20eb05d5fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-05 13:41:50 +00:00
Gabriel de Dietrich
8d5842a2d8 minimal QPA: Make font DB creation more flexible
Prioritize CoreText over Fontconfig since the former is the
native one on macOS, and any other native font DB on its
respective platform. We introduce a new 'fontconfig' option
to allow using Fontconfig instead. This works similarly to
'freetype' overriding the default font engine on Windows. A
propos of which, 'freetype' now does the same on macOS.

Change-Id: Ic8168820d1d01fddc2f26e046abb65b8ab765f89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-12-04 22:32:48 +00:00
Martin Smith
e6aae7df04 doc: Fix all qdoc errors in qnumeric_p.h
These errors resulted from clang parsing function
declarations for functions that were not meant to
be documented. Here they are hidden from clang
with #ifndef Q_CLANG_QDOC

Change-Id: I256b49830b63188bf0a685cb393d469f2f2ca315
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 19:11:36 +00:00
Martin Smith
5e0ef2defd doc: Add missing template text
There are two fake classes in qendian.h that exist only documenting
a lot of operator functions, but now that clang is being used to parse
all C++ code, when a class is a template class, clangqdoc must see its
template stuff to recognize template type T, for example. Hence, this
update adds template<typename T> to some fake class declarations used
only for documentation purposes. ie, inside #ifdef Q_CLANG_QDOC.

Change-Id: I1988b77cd7f3bb97067e7107dd00de34770e9fed
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-04 13:39:57 +00:00
Martin Smith
49bb359580 doc: Fix qdoc errors for \fn commands in endian functions
This change updates the \fn commands in the endian
functions, which are template-based. clangqdoc now
parses these \fn commands and expects to see all the
template stuff in the signatures.

Change-Id: I94c1aba8d710c97b8d41184d64b5341c88ece297
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 12:04:10 +00:00
Martin Smith
a69675a9f9 Add template text to \fn commands for QGlobalStatic
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.

Change-Id: I920d9cc4bef710f276267a34b6b9d49f7412adb0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-04 07:19:36 +00:00
Peng Wu
8f1b4a9081 Support ForwardKeyEvent signal in ibus input context
For ibus-hangul, it needs ForwardKeyEvent signal to fix
the commit issue.

[ChangeLog][plugins][ibus] Support ForwardKeyEvent signal

Change-Id: If41e75bed9ec4e3126db05c8ece4a51d2bc3c3fd
Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-12-04 06:36:07 +00:00
Martin Smith
e27bb2fd25 Remove two obsolete qdoc comments
The macros Q_GLOBAL_STATIC(Type, VariableName) and
Q_GLOBAL_STATIC_WITH_ARGS(Type, VariableName, Arguments)
were documented in qglobal.cpp, but both qdoc comments
were marked \internal. More recent documentation for the
macros also exists in qglobalstatic.qdoc, and the qdoc
comments there are not marked \internal. clang-qdoc
reports errors indicating that both macros havew been
documented in two places. This update removes the older
comments that are marked \internal.

Change-Id: I1c319b831d705d86eb4142b9963dbf56edc72772
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-03 18:34:15 +00:00
Martin Smith
c3e0f09e33 doc: Fix qdoc errors for \fn commands in QGenericMatrix
This change updates the \fn commands in QGenericMatrix
clangqdoc now parses these \fn commands and expects to see
all the template stuff in the signatures.

Change-Id: Icf815606f98271aae1959adc633e918e7f241aa0
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-12-03 11:37:25 +00:00
Alex Trotsenko
0873e5abb6 QProcess/Unix: do not toggle a state of the write notifier twice
_q_canWrite() unconditionally disabled the write notifier before the
writing, and might have enabled it again afterwards. This caused
unnecessary processing in the event dispatcher and could result in
extra system calls.

Actually setting the state at the moment when the write buffer size
is determined is enough.

Change-Id: I81f9ec27d95a5a9bdb83cc6a842b6ae95f002b96
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-12-02 19:42:11 +00:00
Martin Smith
24a0b641c1 doc: clangqdoc needs to see all GLxxx typedefs
Clang needs to see declarations for GLclampf, GLSizei,
and GLboolean.

Change-Id: Id1c1310e4877b32bb8fc2e6d4f743999842b3f06
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 17:30:17 +00:00
Martin Smith
f1817ea9ce doc: Add default openGL typedefs for clangqdoc
When Q_CLANG_QDOC is defined, ensure that the following openGL
types are defined:
typedef int GLint;
typedef int GLsizei;
typedef unsigned int GLuint;
typedef unsigned int GLenum;
typedef unsigned int GLbitfield;
typedef float GLfloat;
typedef float GLclampf;
typedef bool GLboolean;
typedef void GLvoid;
typedef char GLchar;
Running clangqdoc with these on macOS fixed over 500 qdoc errors!

There were also some functions that declared the parameter list as void.
It was also shown as void in the \fn command for each function in the
.cpp file, which is wrong. When the function is declared in the header
as int func(void), it should just be \fn int classname::func() in the
.cpp file.

Change-Id: I6489d499f0830e5ba97c085ed5dadfad5affecb7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 17:29:59 +00:00
Martin Smith
1a78e16d19 doc: Fix three "Cannot tie" errors
Two of the three functions were for functions that
should not be documented. The third was a function
protected by #ifndef Q_OS_DARWIN, which required a
test of Q_CLANG_QDOC in the header and cpp files.

Change-Id: Id2ab3e4f2ea896dc628a622de2e80a19c18eb9fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:58:07 +00:00
Martin Smith
7cfd6f0e1e doc: Fix some ref qualifier documentation errors
Some member functions of QImage were upgraded to use ref qualifiers,
but the documentation wasn't updated correctly to account for this.
This change update the documentation for those member functions to
show the ref qualifiers in the documentation.

Change-Id: I0ff4011e9d0251062d5616d69e9dda6bdbc1c136
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:47 +00:00
Martin Smith
87cce3e061 doc: Don't let qdoc see some defines that cause trouble
This update surrounds some #defines with #ifndef Q_CLANG_QDOC
because they define some names that conflict with formal parameter
names. Otherwise, clang starts replacing formal parameter names
with $27 etc, when qdoc runs, and that causes trouble for qdoc.
The change also replaces one use of Q_QDOC with Q_CLANG_QDOC.

Change-Id: I6e93bf1e0d30d7590280b6f18f0e694556050685
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:26 +00:00
Martin Smith
e210b1233d doc: Correct a few minor qdoc errors
A use of Q_QDOC is changed to Q_CLANG_QDOC.
A misspelled std type name is corrected.
A few extraneous ';' are removed.

Change-Id: Ic49f64a3b97f645268a8ecbbca5f0eef0456bb33
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-12-02 14:57:07 +00:00