There are two cases:
In a BlockingQueuedConnection, QMetaCallEvent doesn't allocate memory
and instead passes already existing pointers through. A QSemaphore
is used to serialize data access between threads. So the constructor
taking a QSemaphore can be simplified to only accept an existing arg
array.
In a QueuedConnection, QMetaCallEvent needs to make deep copies of
the arguments, and memory needs to be allocated based on the number
of arguments. The previous code put the burden of memory allocation
on the code generating the event, while the memory was free'd by
~QMetaCallEvent. Instead, make it QMetaCallEvent's responsibility
to allocate and free the memory as needed, and adjust the code
generating QMetaCallEvents.
We can allocate the memory for types and pointers to arguments in a
single block, starting with the space for the array of void*, followed
by the space for the array of integers to avoid byte alignment issues.
By pre-allocating the space that's needed by three arguments, we can
avoid all mallocs for the majority of QMetaCallEvents.
Until this change has propagated through qt5.git, we need to keep the
old API that is still used by QtDeclarative around. Once QtDeclarative
has migrated to the new API, it can be removed.
Change-Id: Id7359ffc14897237ea9672dabae9ef199a821907
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
If a project has DESTDIR and TARGET set to fixed values, then the
target paths conflict when doing debug_and_release builds.
With this change we're detecting this situation and yield a warning.
Fixes: QTBUG-2736
Change-Id: Ib163db3463322792ab9fa5b997285ac9fc9819ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
- add conditional noexcept to move special member functions
- use qExchange() in the move ctor implementation (turns a copy into a move)
- separate the default ctor from the ctor that acquires a resource, then
- overload the latter for rvalue payloads
Change-Id: I6816143a94fe6a74cf0d02569b83a752a8da3089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds a manual test for the QTextTable border logic.
Two HTML files are bundled as resources:
table-border-test.html: Contains various test cases for the border
logic.
table-border-test-header.html: Contains a test case for printing a table
with a repeated header.
The test application allows:
- editing
- previewing
- printing
- opening the HTML in the system browser (via temp. file)
It is possible to edit the HTML with "live preview" so new test cases
can easily be implemented.
Change-Id: Ic88488bc8b7dd74d5c03c3363f55840423462325
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The template for the "This is a generated file" notice made a clumsy
intrusion in the code in which it appeared, so split it out as a
constant of the module and access it by name where it's used.
Change-Id: Ic4dfb8e873078c54410b191654d6c21d082c9016
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Every property name was already monospace, except this one.
Change-Id: I69f4e7cd67e6d4ab2a25b4f1d251ec5a2c925098
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This allows to set the width, style and color of each table cell's edge
(left, right, top, bottom).
Setting the table's border-collapse mode will disable explicit cell
spacing. The basic CSS border collision rules are applied (wider border
wins, vertical over horizontal).
Setting the table's border width to a value >= 1 and enabling
borderCollapse will now draw a simple and clean table grid (1px) with an
outer border of the specified width and color.
[ChangeLog][QtGui][QTextDocument] Added CSS style table cell border
formatting with border-collapse mode.
Change-Id: I324d82284802df4c88c13c5b902fec1f4768b67e
Fixes: QTBUG-36152
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
C++11 is a requirement since Qt 5.7. There is no point in highlighting
the condition anymore.
Change-Id: I0f7d6044db2528d3b5264c324cf71156ec833775
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The new helper class BorderPaginator encapsulates the existing pagination
logic for drawing correctly clipped borders on all pages a cell appears
on.
This will allow reuse of that logic for drawing CSS-style borders.
Change-Id: I47ed4a8802513aef30d97f14591c7d4716bfdbb8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
87748cc18e introduces rounding of column
widths to avoid table border render artifacts.
For variable columns we must make sure that the maxWidth (= unwrapped
content width) is not rounded down as this can cause erroneous
wrapping of the content at rendering time.
Fixes: QTBUG-43589
Change-Id: Iee155702a12374116a63050e5025df91f097a8e4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Except in the auto-generated files.
Required to add a cast operator from QDBusObjectPath to QVariant, as the
variadic call() uses QVariant(arg) instead of QVariant::fromValue(arg).
[ChangeLog][QtDBus][QDBusObjectPath] Added explicit cast operator to QVariant.
Change-Id: I3f3004f7b9300a6340d27488f5b97981cbab3c24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Don't manage the ref-count yourself, as this requires the code to use
the QAtomic copy ctor, which we want to remove going forward. Using
QSharedData, we can let the compiler write the code for us.
Since 'ref' this way moves to the first spot in the list of effective
members, creating a 4B hole between itself and 'msecs', swap 'status'
and 'msecs' to fill the hole:
offset: 0 8 16 24
| | | |
without v v v v
adj.mnt: |*R*| | msecs | S | U | TZ....
before: | msecs | S | U |*R*| | TZ...
after: |*R*| S | msecs | U | | TZ....
This keeps the padding out of the critical first word, which improves
latency. That said, for accessing the members the old layout surely was
optimal. This layout optimizes copies and pessimizes access to 'msecs'
on 32-bit platforms without the Critical Word First optimization.
Requires adjustments to tst_toolsupport and the qhooks version.
Also default members using NSDMI, consequently drop the manual default
ctor.
Change-Id: I3c48e68694ad29b28a13aa47ea0f283fae52edd7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Now that all QLinkedList uses are removed from Qt, make sure
QT_NO_LINKED_LIST is set by default for Qt modules, so new
modules don't need to explicitly specify it in their
.qmake.conf.
Modules can still opt out of the QLinkedList ban by adding
DEFINES -= QT_NO_LINKED_LIST
to their .qmake.conf.
Change-Id: I34b7ab1c009795649bb7b4f1e7493556eafadd5a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
For symmetry with QSize and QRect and because there were some users in Qt.
Port those users.
[ChangeLog][QtCore][QPoint/QPointF] Added transposed().
Change-Id: If4f23dbcf7d67983a6b1885e0d1d538115b49e2b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Amends 2e1763d83a.
The new range ctors need deduction guides, since the compiler can't
deduce the value_type from a pair of iterators.
Change-Id: I3ec1e5f91305b317c443b6a70246be416b55bad9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The three cases - with classic slot, with functor and context object,
and with lambda - are all doing the same work, they just differ in
how they signal the application code about the results.
The detour through an explicitly posted QMetaCallEvent is needed
if we have a functor or lambda; making sure that the temporary
QHostInfoResult object lives in the right thread guarantees that the
event is received in the correct thread, so we can directly call the
functor (as long as the context object is still alive).
Since we guarantee that the QHostInfoResult object lives in the
thread of the receiver, we can simply emit the signal for old-style
signal/slot connections; the regular signal/slot mechanism will do
the work for us.
Change-Id: I584df17df879af01c653e354490c4691dbedd3fa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Also clarify what this check includes (backends are expected to
register only QRhiResource instances that actually own native
graphics objects - the ones that don't are not included in the
leak checking)
Change-Id: If0f43b302b148f043391fa7fd7bb77cfc8d93b79
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The Thursday in the same week has the same week-number and determines
the right year to use for the week. So calculate its week-number and
save a whole lot of complications.
Change-Id: I9c28267e6083afdd04a15245e1609c64beb82b37
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
In MakefileGenerator::initOutPaths() we ensure that directory
variables end with a directory separator, except for DLLDESTDIR.
There doesn't seem to be a valid reason for this exception.
Remove it for the sake of simplifying the code base.
Change-Id: I60eb01b410161e6e1d147d76f044f5140a7573bd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This undocumented option was introduced in
69c22301806b56d56cbe5f5076b889ba98e41a2b (old internal history, 2006) to
prepare some unspecified change to configure that was never done.
Change-Id: I60de731ac9bc6f6424c57574e59e9f6b4f6c5eb3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(or forward-declare std types)
(with apologies to Mr Walter Brown)
This applies the changes to our other smart pointers that
a0c4b6f345 applied to QSharedPointer,
with the same rationale: wg21.link/p0551.
It also fixes a fwd declaration of std::function, including
<functional> instead. Rationale: wg21.link/p684r0.
Change-Id: If275af91f6eac15eb418b200ac7d08ba084a6130
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Adds setters for transfer-functions and primaries.
This allows us to remove use of private QColorSpace API from the PNG
handler.
Change-Id: Ieeff81c813c253649500acd1e53f35247b872325
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Also make sure the gl backend is consistent with the other three.
Change-Id: I2f6b783f5fa474c94ede460f5d7ac6fe8129a4f6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Note that SPIRV-Cross does not translate 'bool' to GLSL versions
that do not have uint. So in practice we will still need to use
'int' instead in shaders that also target old GL versions.
Change-Id: I070f5414fe761796ab92937034b7182cdfb73a14
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Following the Quick scenegraph (qt.scenegraph.*), we now have
qt.rhi.general. Other categories may get added later.
This does not change the printing of real errors, those will
continue to use qWarning().
Change-Id: Id95416fc82ba8add9527212e431bcbd47d416f1a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Replace our use of 'gamut' with 'primaries'. One is the axes of the
color space, the other the volume of representable values. For the
currently supported color spaces those are mostly equivalent, but when
we later add support for scRgb, this would be misleading as it has the
same primaries as sRGB but a much wider gamut, and we would like to use
the same primaries/"gamut" id for it.
Also few people would know what "the sRGB gamut" is, but
"the sRGB primaries" is easily googable.
Change-Id: I3348ccaae27a071ec77a4356331b9bbbf92e0d19
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Re-generation of the Makefile depends on a correctly set up
QMAKE_INTERNAL_INCLUDED_FILES variable. In debug_and_release builds
this variable is set up for Makefile.Debug and Makefile.Release, but
not for the meta Makefile. However, that's where the Makefile
re-generation target is located.
We now collect the contents of QMAKE_INTERNAL_INCLUDED_FILES for
Makefile.Debug/Release and use that for the meta Makefile.
Fixes: QTBUG-13334
Change-Id: I6124a91447d5c54d51680e23570c4e97f44e6a73
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Build docs for deprecated APIs conditionally, based on deprecation
version. Remove the docs of methods deprecated since 5.0.0, these
methods are not compiled anymore.
Change-Id: If9302eecc8b3fff4a27c2e4a66ac102add7d66c5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
- Replace the usages of deprecated APIs by corresponding
alternatives in the library code and documentation.
- Build docs for deprecated APIs conditionally, based on deprecation
version. Remove the docs of methods deprecated since 5.0.0, these
methods are not compiled anymore.
- Modify the tests to make them build when deprecated APIs disabled:
* Make the the parts of the tests testing the deprecated APIs to
be compiled conditionally, only when the corresponding methods
are enabled.
* If the test-case tests only the deprecated API, but not the
corresponding replacement, add tests for the replacement
Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
- No need to use QSignalMapper here, replace its uses with lambdas.
- Replace index 'for' loop with iterator loop, to simplify the code.
Change-Id: Ide3d2db99a074c0233eb5c2fd7a9b217d804973f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
From the comments on QTBUG-73407 and the last comments on
29bcbeab90, it seems like there are still
use-cases when QSignalMapper is useful.
Change-Id: I8402286cb8a395a4601cda8a4cdda51f19aef073
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Done-with: Sona Kurazyan <sona.kurazyan@qt.io>
Change-Id: I5b584cbe468429c53c2d661a0d7957d74e7ad691
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Add overloads for qCompare() for QStringView making use of the fast
formatting helper introduced by 94aa350621
for int.
Speeds up the bug report example by a factor of 3..4.
Task-number: QTBUG-38890
Change-Id: Icc706618b2f1d23b37d354a04d4e1d1cc4b5aee3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Somehow missed these during my first iteration.
Change-Id: Iaef0ab84d9320a98f49ec071c93cd6f2907d92c3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Introduced recently when the smart-pointer was made manual.
Change-Id: I29a041631e94a8e131dd29dae32975d68b386e00
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This change removes the leftovers form other cleanup commits.
Task-number: QTBUG-76491
Change-Id: I61440f87c5a280f9666b78e19aac4d8ac603767e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
In two cases, we now detach. ¯\_(ツ)_/¯ This is test code.
Change-Id: I244f5e20dd923281049f38b76366163c16b6498c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Each call to reourceList() uses atomic operations to check whether
resourceGLobalData has not expired, yet.
Some functions already cached the value, but then went on to use the
function directly afterwards. In some cases, this was due to the
cached value being a pointer-to-const and the function later deciding
to mutate the list. But all the code is safe from detaches, so this
distinction need not be made.
Standardize on caching, and using the cached value, except in
functions which call it only once.
Change-Id: I79780b990da539bf7beaa8104e13cb8187f84812
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Move location of stream ID from a dynamic property to an internal QHash.
Change-Id: I9bab4cbfaebe6a04d54afa7889aac748070e1f2e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add missing implicit size checks of tags by passing the already checked
explicitly given size forward.
Also adds my fuzzing test for the ICC parser as it is security critical,
by being used by multiple image formats.
Change-Id: Ieb632ccb78f9b445a276959ffbd66fa04a7a5b45
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Clean up QSortFilterProxyModel by using const refs instead copies and
range-based for loops instead plain loops
Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>