Commit Graph

28559 Commits

Author SHA1 Message Date
Christian Ehrlicher
7ec7f338bc XCB plugin: replace deprecated QList::swap()
QList::swap(int, int) was deprecated. Replace it with swapItemsAt()

Change-Id: I077c5b7222e40b928ee9035b8cbf4ebcc91aa15e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-17 19:50:11 +00:00
Christian Ehrlicher
4c522e0226 QPalette: mark foreground()/background() as deprecated
QPalette::foreground()/background()/ColorRole::Foreground/Background
are deprecated since Qt4 times. Therefore mark them as deprecated so
they can be removed in Qt6.

Change-Id: I24a47e080241b7f16b8adde1f9f16e29133462a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-12-17 19:49:57 +00:00
Christian Ehrlicher
f4d72b3a12 Styles: replace deprecated QPalette functions
QPalette::foreground()/background() are deprecated since 5.13 - replace
those functions with their successors.

Change-Id: I158b6403437d3d48c0859360823133ca4ced2c23
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-17 19:49:03 +00:00
Christian Ehrlicher
108f0cc998 Widgets: replace deprecated QPalette functions
QPalette::foreground()/background() are deprecated since 5.13 - replace
those functions with their successors.

Change-Id: I80e49dadd7be1007d73ac920f6db2b8e608db06a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-17 19:46:51 +00:00
Sergio Martins
9c2cb3d83e Remove x11Info() and x11PictureHandle() from QPixmap docs
These functions were removed in Qt 5.

Also removed old note about X11 QPixmap being invalid after
QApplication is destroyed. It was redundant as that's the case
with many other Qt classes.

Change-Id: I9dfe2679057fbd4d7b69ca94affb673c383cf519
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-12-16 19:30:24 +00:00
Qt Forward Merge Bot
911fd6f2f7 Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-15 01:03:08 +00:00
Qt Forward Merge Bot
4b04e47be9 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Iad06d8c07dfc288c9d1a9f7ee3520285cea60546
2018-12-15 01:00:31 +01:00
Thiago Macieira
5384b1f2c8 Repack some classes in Moc to avoid padding holes
Change-Id: I8f261579aad648fdb4f0fffd155385477abadf9e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-12-14 22:12:37 +00:00
Thiago Macieira
3e4f8aa8f4 Doc: fix null pointer passing to fprintf
When these docs were written, the context.file and context.function
pointers were never null. But in commit d78fb442d7
(Qt 5.4), we made the logging pass null pointers in release builds. The
C standard does not say that passing null pointers is permitted. In
fact, it says "If no l length modifier is present, the argument shall be
a pointer to the initial element of an array of character type." and
that's pretty explicit that it needs to point to the initial element of
a string.

Fixes: QTBUG-72478
Change-Id: I4ac1156702324f0fb814fffd156f624ffefa1445
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-12-14 18:25:28 +00:00
Friedemann Kleint
3c3a2eb3ce uic: Generate version check macros around newly introduced palette color role
Change ebd3a13b80 introduced a new
QPaletter::PlaceholderText color role which causes the uic-generated
code not to compile when using Qt Designer embedded in Qt Creator with
older (5.9 LTS) kits. Generate a version check macro to fix this.

Change-Id: I6d9f7edb0c6047c2f64ef3357b29f91655c52aac
Fixes: QTBUG-72555
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-12-14 18:20:41 +00:00
Topi Reinio
d900463283 Doc: Fix linking from Qt Test to Qt Quick Test
Change-Id: I5552fde06f7cc383e1b16cd90ca9fe7cfeb3a436
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-12-14 12:42:48 +00:00
Bernhard M. Wiedemann
1ffcca4cc2 rcc: Use SOURCE_DATE_EPOCH for mtime
Use the standard variable name in addition to the QT-specific one
to make builds reproducible out-of-the-box.

See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.

Task-number: QTBUG-62511
Change-Id: I401a2a9d258e751b83ae7b83f4100d9088b9ad71
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-14 12:09:06 +00:00
Mårten Nordheim
81dd1bcad1 QSslSocket Doc: Don't refer to obsoleted functions
Update references in documentation from the obsoleted/deprecated version
because it doesn't make sense here to refer to these versions.

Change-Id: I5e9bdf46191e3ba0c7d91855cb3ccc30097cd412
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-12-14 10:38:18 +00:00
Lars Knoll
d545d36c8e Remove QRegExp dependency from QtXml
Use QRegularExpression instead.

Change-Id: I6fc9400064ef6b7e425b140f5ffac0c9248c1ec0
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2018-12-14 07:52:39 +00:00
Lars Knoll
88d5eb13d7 Use QRegularExpression instead of QRegExp
Change-Id: I14abbf81a9d0fb72f75417da06b6456b8f1a20a2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2018-12-14 07:52:27 +00:00
Lars Knoll
43720ec200 Deprecate QObject::findChildren(const QRegExp &, ...)
Use the overload using QRegularExpression instead.

Change-Id: I1bf468b248c0a3f5b2304b1831379a127093df06
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-14 07:52:10 +00:00
Giuseppe D'Angelo
13ba85a70d OpenSSL: remove some more pre-1.0 fallbacks
Again, 1.0 is required now.

Change-Id: Icca5dc38eb33c1579653d96d6c079b335a401aad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-14 02:16:54 +00:00
Giuseppe D'Angelo
fd83e03e7f OpenSSL: remove some < 1.0 codepaths
We require OpenSSL >= 1.0 now.

Change-Id: I6ffe8b2dd606d600671565ebc8bc8ac2b9e0d6c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-13 16:00:36 +00:00
Giuseppe D'Angelo
455951f590 OpenSSL: drop support for SSLv2 and SSLv3
As per RFC 6176 (2011) and RFC 7568 (2015).

Code-wise, we're left with the decision of what to do with a few
enumerators in QSsl::Protocol; I've made TlsV1SslV3 act as TlsV1,
and adjusted the description of AnyProtocol.
A new test was introduced - deprecatedProtocol() - to test that
we, indeed, do not allow use of SSL v2 and v3. protocol() and
protocolServerSide() were reduced to exclude the (now) no-op
and meaningless tests - neither client nor server side can
start a handshake now, since we bail out early in initSslContext().

[ChangeLog][QtNetwork][SSL] Support for SSLv2 and SSLv3
sockets has been dropped, as per RFC 6176 (2011)
and RFC 7568 (2015).

Change-Id: I2fe4e8c3e82adf7aa10d4bdc9e3f7b8c299f77b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-13 15:59:37 +00:00
Nick D'Ademo
3364be7859 QDockWidget: Make floating docks respect DockWidgetMovable feature
Currently, even if DockWidgetFeature::DockWidgetMovable is unset
(i.e. moving docks to different dock areas is disabled), it is still
possible to move a dock to a different dock area after it is made
floating (i.e. the DockWidgetMovable setting is ignored). This
change prevents this unexpected/inconsistent behavior.

Fixes: QTBUG-71703
Change-Id: Iaecc293a5ba12dd5b53f5f0bd0cfe77ae54ab393
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 12:45:47 +00:00
Mitch Curtis
32fd79a20f QAbstractSlider: fix invertedControls having no effect for left/right keys
There was a comment in the code that said:

// It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.

It's not clear what that was referring to, but in its current state,
a slider with invertedControls set to true will not behave as expected:
pressing the left arrow key will decrease its value instead of increasing it,
and vice versa for the right arrow key.

As stated in the documentation (and by its name), invertedAppearance only
controls the appearance of the slider, and not the effect of key events.

Remove the comment and use invertedControls instead.

Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf
Fixes: QTBUG-25988
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 10:46:22 +00:00
Friedemann Kleint
e6d1071dd3 uic: Refactor DOM class lookup in class Driver
Change the API to take const Dom * classes and use a helper
function to do the insertion.

Task-number: PYSIDE-797
Change-Id: I079f5c92bae85d6246c14077db06e381b572cda5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-13 07:14:53 +00:00
Friedemann Kleint
4aac7b92c4 QFusionStyle: Fix deprecation warning about QFontMetrics::width()
Fix an oversight of 4d88d79aa5.

Change-Id: I03e403c6d6aefc4f3118ea8efd822fc563b7a514
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-13 07:13:36 +00:00
Friedemann Kleint
a0f3b2b503 QtGui: Use Q_DISABLE_COPY_MOVE for QPA interface classes
Introduce Q_DISABLE_COPY_MOVE or replace existing Q_DISABLE_COPY
and add default constructors where needed.

Change-Id: Ibd14ee9d1d69e64f6289efe789d4b64a3d6cb998
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-12-13 07:13:26 +00:00
Friedemann Kleint
ac7265e950 uic: No longer generate static_cast for enum values in legacy forms
Add a lookup for the affected enum values and use the names instead.

Task-number: PYSIDE-797
Change-Id: I6be166409000aff83d9465c9a3b2f37b44c5c085
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-13 07:11:12 +00:00
Qt Forward Merge Bot
4e2e7078b8 Merge "Merge remote-tracking branch 'origin/5.12' into dev" into refs/staging/dev 2018-12-13 02:30:54 +00:00
Qt Forward Merge Bot
ad4f359f80 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I0fe623517af28e408b642c879efd59f633ab63ac
2018-12-13 01:00:11 +01:00
Allan Sandfeld Jensen
fc2ec95587 Add Grayscale16 Image Format
[ChangeLog][QtGui][QImage] Added support for 16-bit grayscale format.

Together-with: Aaron Linville<aaron@linville.org>
Task-number: QTBUG-41176
Change-Id: I5fe4f54a55ebe1413aa71b882c19627fe22362ac
Reviewed-by: Nick D'Ademo <nickdademo@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-12 22:26:49 +00:00
Thiago Macieira
d20c980576 Resources: reject compressed content we can't decompress
This solution is composed of two features:

1) C++ code generated by RCC uses two symbols exported from QtCore that
are only present if the feature was compiled in. If the feature was not
compiled in, this will cause a linker error either at build time or at
load time (if they were functions, the error could be at runtime).

2) Binary files generated by RCC have a new header field containing
flags. We're currently using two flags, one for Zlib and one for
Zstandard.

This means we now have binary RCC format version 3.

Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-12 16:36:09 +00:00
Thiago Macieira
2c6ec2c653 Fix tautological compare in error checking
size is size_t, so it's never less than zero.

Fixes: QTBUG-72286
Change-Id: Idd0c85a4e7b64f9c9c7dfffd156d404d0de5ed8d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-12-12 16:30:20 +00:00
Friedemann Kleint
d1cafa3eba qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps with low depths
Insufficient memory was allocated when asking GetDIBits() to convert to 32bit.
Fix allocation size and use a QScopedArrayPointer.

Fixes: QTBUG-72343
Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-12 16:08:10 +00:00
Sergio Martins
da37291f28 When warning about invalid style override also print available ones
Change-Id: Ia017a342648a1f1e1185e74ddec1a77cb6dcfebe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-12-12 13:33:34 +00:00
Lars Knoll
c47b3f61af Use a QMultiMap for the weighted rules
and get rid of one usage of insertMulti()

Change-Id: I26a61dcdd4d778590145c38ae7f39d77ad39a51f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-12 07:43:48 +00:00
Lars Knoll
51dc108e10 Use QMultiMap::insert() instead of insertMulti()
Change-Id: Ia989347730e68f9af0638292f76205bdca61d04f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-12 07:43:36 +00:00
Lars Knoll
4e507464e4 Use a QMultiMap for issuer/subjectInfo
The map can contain multiple entries for one key,
so a multi map is the correct data structure.

Change-Id: I852ba3548f46415d8078fd0e8fdd7953ec6c370b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-12 07:43:30 +00:00
Lars Knoll
5823d391b4 Use QMultiMap::insert() instead of insertMulti()
Change-Id: Idaeb99562d39abfd020ff81b1818cba825c4e802
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-12-12 07:43:24 +00:00
Friedemann Kleint
b86d0b6215 uic: Small refactorings
- Do not use QString::number() to stream numbers.
- Do not use QLatin1String/Char to stream strings or characters.
- Add a convenience methods to determine the container page add method
  for simple containers.
- Similarly, extract a method to determine the layout method and
  simplify the code accordingly.
- Fix Clang warnings about else if after return/continue.
- Use QString::isEmpty() instead of size() to check emptiness.
- Fix QHash-contains()/value() Antipattern

Task-number: PYSIDE-797
Change-Id: I9c61d20f46c8d142b947126a27faaf54b41f9e0c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-12-12 07:27:15 +00:00
Frederik Gladhorn
384b9d8fed macOS accessibility: Implement accessibilityFrame
Change-Id: Id78d3826eb18ff5ca306ac190543a7ff37b2f014
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-12-12 07:25:28 +00:00
Friedemann Kleint
e209321966 Use Q_DISABLE_COPY_MOVE for private classes
Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-12-12 07:23:54 +00:00
Friedemann Kleint
589f9f179c QFileDialog: Remember last visited directory correctly
QFileDialogPrivate::init() sets the working directory derived
from the URL passed in, causing the lastVisitedDir to be set.
This in turn prevented the restoreState() logic from setting
the directory retrieved from the file. Clear lastVisitedDir
in init() in case the initial URL was invalid.

Fixes: QTBUG-70798
Change-Id: I19084e24eb6d469330c4dd8c50495b4996279189
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-12 07:22:29 +00:00
Jędrzej Nowacki
b28502182b Handle errors in moc generate.sh script
The script was happily ignoring all errors, relaying on a user reading
output.

Change-Id: I85edd228a40b5459c4649ab0c0bbbe3042a3abf5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-12-12 06:21:24 +00:00
Thiago Macieira
58f2aa907f Work around GCC bug in generating 64-bit population of SSE register
We know what code we want it to generate, so I just replaced the
_mm_set1_epi64x() with the code we want it to generate. Except that GCC
sees through and tries to "optimize" my code... so that asm() statement
makes it separate the two operations.

This generates optimal code for both 32- and 64-bit.  64-bit:
        vmovq   %rdi, %xmm0
        vpbroadcastq    %xmm0, %ymm0
32-bit:
        vmovq   8(%esp), %xmm0
        vpbroadcastq    %xmm0, %ymm0

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80820 and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87976

Change-Id: I42a48bd64ccc41aebf84fffd15664109b97fe42b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-12 03:44:31 +00:00
Thiago Macieira
3df79b2953 Add an SSSE3 implementation of qt_memfill24
Brought to you by the PSHUFB instruction, introduced in SSSE3
(implementation also uses PALIGNR just because we can).

The tail functionality makes use of the fact that the low half of
"mval2" ends in the correct content, so we overwrite up to 8 bytes close
to the end.

Change-Id: Iba4b5c183776497d8ee1fffd15646a620829c335
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-12 03:44:28 +00:00
Allan Sandfeld Jensen
33177b0456 Add a qt_memfill24 implementation
This function gets called from qt_rectfill_quint24, which is used by the
RGB666, ARGB6666_Premultiplied, ARGB8555_Premultiplied, and RGB888
formats.

Together-with: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Iba4b5c183776497d8ee1fffd1564585fdee835c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-12 03:44:11 +00:00
Tor Arne Vestbø
db0616097f Actually make QT_MAX_CACHED_GLYPH_SIZE the max glyph size
This effectively means we'll start drawing text with a pixel size
of 64 using cached glyphs, whereas before we would treat this as
the cutoff and draw it using painter paths.

Change-Id: Ie58212ef9217c8f8a69a92e48a8788f191b99415
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-12-11 23:41:37 +00:00
Edward Welbourne
ab448f731e Handle QCollator with locale C by delegating to QString
Previously, the C locale was treated as English because each back-end
takes the locale's bcp47Name(), which maps C to en. However, the C
locale has its own rules; which QString helpfully implements; so we
can delegate to it in this case. Extended this to sort keys, where
possible. Clean up existing implementations in the process.

Extended tst_QCollator::compare() with some cases to check this. That
required wrapping the test's calls to collator.compare() in a sign
canonicalizer, since it can return any -ve for < or +ve for >, not
just -1 and +1 for these cases (and it'd be rash to hard-code specific
negative and positive values, as they may vary between backends).

[ChangeLog][QtCore][QCollator] Added support for collation in the C
locale, albeit this is only well-defined for ASCII. Collation sort
keys remain unsupported on Darwin.

Fixes: QTBUG-58621
Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-11 19:05:07 +00:00
Thiago Macieira
986e49992c Use Q_DECL_VECTORCALL in a few more places
There were a few functions that passed vectors in parameters but did not
mark as vectorcall.

I've taken the opportunity to de-macroify one macro, but I'm not going
to do it for the rest.

Change-Id: I42a48bd64ccc41aebf84fffd1564bfc21faa2a14
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:05:01 +00:00
Thiago Macieira
40894d1a60 Add AVX2 versions of qt_memfill32 and qt_memfill64
The implementation is almost the same 4-way-unrolled loop, but because
of the wider registers, we fill 128 bytes per loop. Unlike the SSE2
implementation, the AVX2 version uses unaligned stores and won't try to
align in the prologue, matching glibc's __memset_avx2 (also unaligned).

Change-Id: Iba4b5c183776497d8ee1fffd15637ccb2a7b83bc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:04:59 +00:00
Thiago Macieira
a440aada72 Add SSE2 qt_memfill64
Implemented by merging with the qt_memfill32 implementation in a
non-inlining function.

Change-Id: I343f2beed55440a7ac0bfffd15636f8ba995a2bd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-12-11 19:04:58 +00:00
Thiago Macieira
12e843581a QResource: quick refactor of registerSelf for files to support LFS
This commit adds sufficient support for large files in resources, but
not completely because the rest Qt is not ready for it (and not
tested). We've had the QT_MMAP macro in qplatformdefs.h for a while, so
let's use it and use qsizetype where we can.

This also the check that the file existed before opening it (you can
only open it if it exists), plus a few nullptr updates.

Change-Id: I42a48bd64ccc41aebf84fffd15653ffdabb0e66b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-12-11 19:02:59 +00:00