that makes the log file mostly self-contained.
for code re-use, the qtSystemQuote() function was factored out.
Change-Id: Ie3469518ba384131b69f5f15c577240e2674d507
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
the options may need to take effect before the regular test processing
commences (which is actually going to be the case in the next commit).
the indirection via the callback only obfuscated the code anyway.
Change-Id: I5307b0be15cf4cc2c2db391ce5b5a93f81076b5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is a version of QByteArrayMatcher that calculates the
Boyer-Moore skip table at compile-time instead of at run-time,
making this class more generally applicable than QByteArray-
Matcher itself, at least for statically-known strings.
The compile-time part requires C++14 constexpr support, but
the class should compile and work even in C++98 mode, just
with runtime initialization of the skip-table.
While touching tst_qbytearraymatcher, clean up the static
global QByteArrayMatchers there and add tests with needles
longer than 255 characters for QByteArrayMatcher, too.
[ChangeLog][QtCore] Added QStaticByteArrayMatcher.
Change-Id: I0662f262ab19b79ae4096f3ab384d5b3ada72347
Reviewed-by: David Faure <david.faure@kdab.com>
Bring back the call to InvalidateRect() removed by change
6086c81e4d since it seems that GL Software rendering
requires it (also for single buffer mode).
Task-number: QTBUG-58178
Change-Id: I197a1b3c3906c4afa43943db30dbc07dfb656cc7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We enforce the check of saving the icon when the indicator
process name isn't available (as we might be running in a
confined world), but we're running in Unity.
Change-Id: I80d3be1a8c6eba8c391364260746e78cf89a5b98
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The regression was introduced by 593ab63860 which fixed another bug
related to window modality. To determine whether the window needs to be
(made key and ordered front) or just (ordered front), instead of calling
currentModalSession() which might change internal state of event
dispatcher we just check if cocoaModalSessionStack is empty or not.
Task-number: QTBUG-57991
Task-number: QTBUG-56166
Change-Id: I6c4f92860d8c93decd44e572af1690ed7be6f1f0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QHostAddress is one of the few classes in Qt which is pimpl'd but not
implictly shared, making it suprisingly expensive to copy around, return
by value and so on. Being pimpl'd it is also still lacking a move
constructor, like most of such types in Qt.
Remove a bit of the surprise factor and make it implictly shared. In
practice this means making it eagerly parse host addresses from strings.
Since it was entirely implemented out of line, replacing it with a
implictly shared implementation is binary compatible.
[ChangeLog][QtNetwork][QHostAddress] QHostAddress is now implicitly
shared.
Change-Id: Ia7ff94efcb74e7321b7607cd690c5c162f685605
Reviewed-by: Richard J. Moore <rich@kde.org>
When going via the advanced settings for a printer in the print
dialog it is possible to specify a custom page size directly. This
needs to be picked up via the POSTSCRIPT_IDENTIFY ExtEscape
identifier to see if it is supported at all and then queried to see
if a custom size is set.
Change-Id: Id5e94c1b25be1c6e28d9e26d8001cd1c96d8f5d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since not all elements of the original page settings can be kept, it needs
to be set bit by bit in order to apply what it can.
Change-Id: I82a2de91e3b8e344a61a290bb4486885fde62b4e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The \c command is not supported within the \brief command.
If used, QDoc omits the value and the command. Rewrite briefs
to avoid using the \c command in them.
Task-number: QTBUG-58212
Change-Id: Ia29eae8b17a5fd46bec39e113aabf22e010217a4
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
When a platform menu bar is used, the QMenuBar is hidden, so shortcuts
for QActions attached only to it do not work.
Extend the macOS-specific code to treat such menubars as visible to
other platforms, to make the shortcuts work.
The exception is made for internal QMenuBar shortcuts, which are
forwarded to the platform menu. A follow-up change will add support
for this to QDBusPlatformMenu. The updateGeometries() method is called
for platform menu bars too to make sure the internal shortcuts are
registered even if the global menu is in use.
Add two cases to the tst_QMenuBar::activatedCount() test to test
both native and non-native menu bars when possible (it now passes with
native menu bars too).
Change-Id: I2d7128512719ac199cd3f8f7ba28333d04d84ed4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This way the Qt accelerator shortcuts (i.e. Alt+F for the File menu)
will cause the matching menu to be opened on the server side.
Change-Id: I02a5b3c20c6eae130d0f133b33c9e247cff38d44
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
With this new policy, after emitting 'redirected', QNetworkReplyHttpImpl
waits for client code to decide if QNAM should follow this redirect or
not. The client can either allow this redirect by emitting 'redirectAllowed'
or abort the reply.
Task-number: QTPM-236
Change-Id: Ia04619f6bd1f0caa477833ae859b24033027b2e1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Not having a way to say that a given output should be registered as the
primary screen (meaning it comes first in the QGuiApplication::screens() list,
emits primaryScreenChanged() signal etc.) can be a problem for some systems.
The order of the outputs array in the JSON configuration file is not relevant
in this respect since screens are registered either in the original DRM connector
order, or, when the virtual desktop layout is specified via virtualIndex, in the
order specified by virtualIndex. The primary screen status is independent from this.
Therefore, add a new, optional boolean property: primary. For example, the following
forces the QScreen corresponding to the VGA output to be the primary screen on the
Renesas R-Car H2 board, even though by default it is the HDMI one that happens to
be reported first by the system.
{
"device": "/dev/dri/card0",
"outputs": [
{ "name": "HDMI1", "mode": "1280x720" },
{ "name": "VGA1", "mode": "1280x720", "primary": true },
{ "name": "LVDS1", "mode": "off" }
]
}
In addition, improve the quality of the logging output.
[ChangeLog][Platform Specific Changes] Added support for specifying the primary screen
in the JSON config file in QT_QPA_EGLFS_KMS_CONFIG when running on DRM/KMS with eglfs.
Task-number: QTBUG-57980
Change-Id: Iba490800dee3b7162c68c4d40b0822f3f6d81b69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The original implementation is only suitable as long as the only client
is the GL paint engine which will call the function with the GL context
current. In other cases this cannot be ensured. For instance, doing
triangulation on the gui thread in a Quick application using the threaded
render loop will have to deal with not having a current context on that
thread at all. Doing triangulation on worker threads has the same problem
as well.
In addition, in modern Qt versions a -no-opengl build does not imply no
accelerated graphics API.
Therefore, drop the ElementIndexUint check from qtriangulator.cpp and leave
it up to the caller to tell if uint indices are supported or not.
Change-Id: I7491d84981ee22d05c5fde08994dbb3a4e2432e9
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
tst_qaccessibility.cpp: In member function 'void tst_QAccessibility::treeTest()':
tst_qaccessibility.cpp:3005:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qaccessibility.cpp:3008:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
tst_qaccessibility.cpp: In member function 'void tst_QAccessibility::tableTest()':
tst_qaccessibility.cpp:3133:75: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
Change-Id: I175af3215258c70da8284907f5ddfe95abf41029
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
The hint is not appropriate for Windows 10 tablet mode as it affects
only main windows. Dialogs should still show up in normal size.
Partially reverts change d377f14fd5.
Task-number: QTBUG-58227
Change-Id: If9cf4990eb40913904cd97e17a7622bc6cbe84ca
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
QPlatformFontDatabase::resolveFontFamilyAlias returns the input
unchanged if the font-name is not found. This means we never register
the system default font when it is only a virtual font name.
Task-number: QTBUG-58225
Change-Id: Ib4f80bb758aa66a163d223573bfe624bb3c134ab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QRect::setX/setY will change both position and size. In this case,
the width and/or height of the input rectangle could end up
negative. The correct functions to use are moveLeft/moveTop which
will preserve the size when changing the position.
Task-number: QTBUG-58179
Change-Id: I71a2e38958754dc53e062ad1c780e2337f72ec32
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QImage::reinterpretAsFormat can be used to change the format of an image
without converting the data, to correct wrong formats or narrow the
format to an opaque one if found to be opaque.
[ChangeLog][QtGui][QImage] A new method reinterpretAsFormat is has been
added to change the format of a QImage without converting the data.
Change-Id: I5e15bc5a1c474a35d3921b06299008ab2effd945
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
When an executable is being linked and uses a library that has been
built with exceptions enabled, the executable will need the exceptions
flag in order to link in the exceptions handling code.
Change-Id: I3acdb571afbbcaf860fb0ef0482f704f605a9bbe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
[ChangeLog][QtBase][General] Removed support for WinRT/Windows Phone 8.1.
Task-number: QTBUG-57288
Change-Id: Ifd6d6780cbbdb710d99556ba3d2fb2e514d4f789
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit simplifies defaultParameters() to simply construct an empty
QSslDiffieHellmanParameters and assigning the DER-form of the DH parameters
to QSslDiffieHellmanParametersPrivate's derData field.
This creates a valid QSslDiffieHellmanParameters instance, but skips any
potentially expensive verification steps.
The previous implementation of defaultParameters() would use the public
fromEncoded() method to construct an instance of the default parameters.
This triggers a verification of the passed-in data, which can be expensive.
To ensure our defaultParameters() QSslDiffieHellmanParameters instance does
pass verification, this commit adds an autotest to verify that.
Fixes QTBUG-57815.
Change-Id: I6b1d9dbbfde526b232c319195ddbad42326be27c
Task-number: QTBUG-57815
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Previously, the code grabbed the client rectangle of GetDesktopWindow(),
which is always the primary screen. Fix by using the geometry of
the QPlatformScreen. In addition, subtract x, y from the effective
size when sizes < 0 were passed in as does XCB.
Task-number: QTBUG-58110
Change-Id: I6ed439d2e1da8affd0a1475717d5570017fb1f2b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
These code paths have not needed to be exercised since Xcode < 3.2 was
dropped from support, which is beyond ancient at this point.
Incidentally, this removes use of a deprecated function.
Change-Id: I3e5a45794c21b434b31a48da8a8b0ff22f2852fa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
operator== and operator!= have been disabled, as they are likely to be
misused and are not particularly useful in practice. The same goes for
the QVersionNumber conversion convenience functions.
The constructor normalizes version component values so that invalid
versions like [5, -1, 3] cannot be constructed and made to wreak havoc
on assumed logic.
Change-Id: Iabb6876bd5dc11522032837f78cf825b921a49b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Manual revert of 73e68a9c0f, which was flawed. macOS can, and will,
dealloc and realloc NSScreen instances for a given screen index, for
example when deallocing an NSWindow, which has the screen as an
auxiliary resource. This is also documented for +[NSScreen screens],
which states that "The array should not be cached".
Task-number: QTBUG-58128
Change-Id: I926513a26cb7af52acd7fc5ee9380ef29ede65e6
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
NSSetFocusRingStyle() doesn't take the device pixel ratio
into account for offscreen graphics contexts. As a result,
the focus ring would appear too thin on retina displays.
Therefore, we need to render the focus ring in a more manual
way. The only added dependency is the focus ring's opacity
value and thickness.
This patch fixes CE_FocusFrame and the focus ring around
regular QPushButtons. More work needs to be done for other
widgets that currently rely on HITheme or NSControl–NSCell
to draw their focus ring.
Task-number: QTBUG-57843
Change-Id: I2c6f273698fdfd5ad7344a9688e96aef6da906f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When testing peer's SETTINGS frames, namely MAX_CONCURRENT_STREAM identifier,
we should test against upper limit _new_ values from these frames, not our
own pre-set maxConcurrentStreams (it apparently was a typo).
Change-Id: I2036e45b0f931914f75ca99142192e2f9385623e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch makes it possible to enable/disable redirects on QNAM
level (before it was per-request only). This policy would be applied
to all subsequent requests* created by QNAM.
The policies we support at the moment:
a. Manual - that's what we always had - it's up to a user to handle
redirects.
b. NoLessSafeRedirectsPolicy - we allow http->http, http->https and
https->https redirects, but no protocol 'downgrade' (no
https->http redirects).
c. SameOriginPolicy - we check that protocol/host/port are
the same.
Updated tst_qnetworkreply.
*We previously were enabling redirect for each request, by
setting FollowRedirectsAttribute on QNetworkRequest object.
For backward compatibility this attribute has a higher priority
(if set) than QNAM's policy (and it will work as NoLessSafeRedirectsPolicy).
[ChangeLog][QtNetwork] Added redirects policy to QNAM
Task-number: QTPM-239
Task-number: QTPM-237
Change-Id: I493d1728254b71b61b5504937e8e01dca5953527
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
info.wrap is already checked in the outer if condition.
Change-Id: I3a40dbaae22f00c66acb6f483b7b4786c5580d94
Reviewed-by: David Faure <david.faure@kdab.com>
The size of flowPositions is larger by one than the number
of rows in the model so the last correct row number is
flowPositions.count()-2, not flowPositions.count()-1.
Change-Id: Idf8bbd155151d553947d5d299dd01ffaff0c95fa
Task-number: QTBUG-47694
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: David Faure <david.faure@kdab.com>
Check on QMAKE_TARGET_PRODUCT/QMAKE_TARGET_DESCRIPTION before assigning
values. This enables providing other values by for example the
Qt tool applications.
Change-Id: I62270ca38b7a9110185f6163b280409dbaf395f6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
When triggering a combination of keys which is causing a dead key then
it will send Key_unknown which is not a valid key to be used in a
shortcut so it should just skip past it as if it were a modifier key.
Task-number: QTBUG-57932
Change-Id: I16e004b84f3aa854f8f8f2bbdf86beb6d764de48
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
We observed a stack-trace in which, while handling an error,
QHttpNetworkConnectionChannel::close()'s call to its socket->close()
triggered (when the socket was a QSslSocket) a flush() which asked its
backend to transmit() which tripped over the original error, which
duly triggered endless recursion. Transiently clear the socket
member, during its ->close(), to prevent this; do the same in abort(),
to preserve its structural correspondence to close(). Restructure
both so that any recursive call's setting of state is overwritten by
the top-level call's, while this still uses the prior socket state
(not the state after close() or abort() and any recursion) to
determine final state.
Task-number: QTBUG-56476
Change-Id: If69e97f7a77a729bf2338ed14214c65aa95f8b05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
To work around qmake deficiencies src/angle/src/compiler/translator.pro
contains a no-op extra compiler that "creates" glslang_tab.cpp and adds
a dependency to glslang_tab.h.
However, both files are created in one bison call, and for some reason
the .cpp file is created before the .h file. Then the dependency
glslang_tab.cpp -> glslang_tab.h results in recompiling glslang_tab.cpp
on every incremental build.
Ensure that glslang_tab.cpp is newer than glslang_tab.h.
Change-Id: I6f59e213c84af85c59c02d90ac220bd347faddd1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Sometimes it is desirable to use a new connection but keep already
entered user credentials for usability reasons. This is now possible by
clearing the connection cache (but keeping the authentication cache).
Change-Id: I2f5f64836ce19f81c8525701783a3da823dd468e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>