Commit Graph

33585 Commits

Author SHA1 Message Date
Paul Olav Tvete
2e1ad4335c Don't send extra mouse press to popups on dblClick
QWidget::event() will turn an unhandled double click into a
mouse press. Therefore, we must avoid sending a separate mouse press
in that case.

This copies the logic from 9063edef79,
the previous fix for QTBUG-25831, which only applied to the non-popup
case.

Task-number: QTBUG-25831
Change-Id: I616f398a5ebe1f95d4b65b9f6ce2fe39a6fad83e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-17 12:25:10 +00:00
Edward Welbourne
b9557296cb Fix crash when reading a PKCS12 file with no private key
The only reason our code wants PKCS12 files is for a private key, but
a valid file needn't contain one; and reading a file without lead to a
crash in QSslKeyPrivate::fromEVP_PKEY().  So check for missing key and
fail the load, since the file is useless to us.  Also ensure the
caller's pkey is initialized, as we aren't promised that
PKCS12_parse() will set it when there is no private key.

Add a test for this case (it crashes without the fix) and update the
instructions for how to generate test data to cover it also.
(Corrected the wording there, too; at the interactive prompt,
"providing no password" really provides an empty password.)

Task-number: QTBUG-62335
Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-08-17 06:43:49 +00:00
Thiago Macieira
0dee566e98 QFileSystemEngine: verify that the file name isn't empty
Making system calls with empty file names is not a good idea. When you
run qmake $srcdir, you see this in strace:

 stat("", 0x7ffed229e250)                = -1 ENOENT (No such file or directory)
(twice)

I've also inlined the isEmpty() function for better code generation.

Some functions take QSystemError and some don't. That needs to be
corrected at some point, possibly with something like std::expected.

Change-Id: I1eba2b016de74620bfc8fffd14ccbfa162f93631
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-17 04:45:29 +00:00
Giuseppe D'Angelo
d7db2b4359 QPicture: check that pictureFormat doesn't return dangling pointers
The function returns a const char * out of a QByteArray. We must
be sure that the QByteArray outlives the function, otherwise the
pointer returned would be dangling. Add an assertion for that.

Found by clazy.

Change-Id: I3416af4eb5ec79ddb3e4baf3bdcfe046b44d4225
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-08-16 16:19:52 +00:00
Thiago Macieira
cdc79f5ebc XCB: Don't core-dump if we can't connect to the X displayName
Exit with error, but don't crash.

Change-Id: Ie05c6480d8a44fda817ffffd14d9dfd8c951beef
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-08-16 15:52:02 +00:00
Tor Arne Vestbø
9a50333dd0 Fix CMake version resolving
Otherwise 3.8.1 is treated as not recent enough than the required 2.8.3

Change-Id: I198fc7d54e3da935fd163c9b9bb7dc12b986d1c2
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
2017-08-16 15:35:40 +00:00
Ville Voutilainen
38db7b1464 Fix an ABI break caused by too-aggressive deprecation
Task-number: QTBUG-62516
Change-Id: Ia3b36cddae982cc6fb9f857505be6e38bc8aaa64
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-16 15:35:26 +00:00
Andy Shaw
baf1158c48 Doc: Mark the dbmsType() function and DbmsType enum as internal
The function and type is only used in the tests and has no benefit in
applications so it should be marked as internal to avoid confusion for
those implementing their own drivers.

Task-number: QTBUG-56278
Change-Id: I0f2ae27d41b133c4f0d3b0d390688fd3307592ce
Reviewed-by: Andre Somers <andre.somers@kdab.com>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-08-16 13:14:33 +00:00
Andy Shaw
a3d59c7c7f Block input to a window shown while an application modal dialog is visible
Although the window is refused input for the most part from the system,
it does not act like that it is blocked by the application modal dialog.
This ensures that it is the case and prevents things like being able to
double click on the title bar to maximize the window on Windows.

Task-number: QTBUG-49102
Change-Id: If1582819b90cb2ec9d891f664da24f13bfec7103
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-08-16 13:13:55 +00:00
Eskil Abrahamsen Blomfeldt
a26a3cfbc7 macOS: Fix matching of font weights for application fonts
5ad2e1cea1 exposed a
latent bug when matching font weights that do not exactly
match any of the canonical weights in the system .

It seems that when we registered the font with FontManager,
it would modify the font weight to match a system weight,
while we now get raw values from the font instead.

So for Roboto Medium, for instance, we would now get
0.2 instead of 0.23, and since our conversion logic
would convert everything between Light (-0.4) to
Medium (0.23) to QFont::Normal, we would regard this
as normal weight instead of medium.

But on a linear scale, it makes more sense to match
to the closest canonical weight instead of requiring
exact matches.

Note that the definition says that the middle between
two weights should tend upwards, therefore we do the
comparisons in decreasing order.

[ChangeLog][QtGui][Text] Fixed matching of non-regular
font weights for application fonts on macOS.

Task-number: QTBUG-61520
Change-Id: Ieda4927c2c69ec72125257340cf06c683b031d05
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-16 12:48:15 +00:00
Tony Sarajärvi
f9f5b35e73 Blacklist tst_QFont::DefaultFamily in B2Qt
Task-number: QTBUG-62528
Change-Id: Iadf9a923b2a624c5082fd1bd61691f8100178f94
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-16 07:32:09 +00:00
Gabriel de Dietrich
5c21c3c23a QMenu: Prevent torn-off menus from extending behind the taskbar
On Windows and macOS, that area of the menu can become inaccessible
if the menu is tall enough. Since these are not popups but tool
windows, the test for UseFullScreenForPopupMenu should not apply
for torn-off menus.

Change-Id: Ife7836bef568896a5bb67d42a2af412f06a871d6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-08-16 04:08:46 +00:00
Volker Krause
bad6b8e400 Propagate all module defines to CMake config files
So far this only covered the QT_xxx_LIB define, but not any other defines
a module might export (such as QT_NO_QML_DEBUGGER which hasn't been ported
to the new configure system yet).

Change-Id: I8aae2354fed77a6f0e527ad8d63d25654bb067d0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-15 16:44:38 +00:00
Liang Qi
106d3b9bf9 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoamenu.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/widgets/styles/qstylehelper_p.h

Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
2017-08-15 16:31:48 +02:00
Mårten Nordheim
eb2b635154 Check for loopback address if network access is unavailable
A loopback address warrants the same exception as local files.

Task-number: QTBUG-59219
Change-Id: Ie0a75faa558d6596455da38656c8749c994d0fd8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-15 14:26:51 +00:00
Oswald Buddenhagen
8bebded9ab qmake: don't limit command line length when not actually on windows
QMAKE_LINK_OBJECT_MAX is actually a property of the host, not the
target.

this works around binutil's inability to use thin LTO objects in
conjunction with an MRI script
(https://sourceware.org/bugzilla/show_bug.cgi?id=21702).

Task-number: QTBUG-61335
Change-Id: I90a1334b9c905c433b35546e8f3f3b5089d2c65b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-15 10:55:52 +00:00
Oswald Buddenhagen
d64abf8166 refuse to build examples inside the qt source tree stand-alone
doing so is somewhat likely to cause follow-up issues, as it turns the
source tree into a build tree as a side effect.

note that this change does not affect building examples inside an
install tree, even if doing that is still ugly.

Change-Id: I386bf2ab959269f55553c70b7551dd9afec2bcba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:48 +00:00
Oswald Buddenhagen
1da25fe85a fix excessive execution of code meant for examples only
qt_example_installs.prf is loaded by every sub-project inside the qt
tree, as qt_build_config adds it.

Change-Id: Ice7e81b280b6964ed5cc1b9f1501bf74df737d7e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:44 +00:00
Oswald Buddenhagen
1480066592 employ return() inside qt_example_installs.prf gainfully
reduces the indentation level.

Change-Id: I7851ffc5e9ecaaa3ae375d14fd245ea3747f61b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:40 +00:00
Oswald Buddenhagen
4e5af88a8c configure: fix detection of icu in static build
don't complain about library inline sources which have 'builds' but no
'libs'.

Task-number: QTBUG-62150
Change-Id: Ib215d438fc02ebdafde95f31cd48088b1bafc663
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:35 +00:00
Oswald Buddenhagen
ad70f2ed20 configure: simplify construction of QMAKE_CONFIG_CACHE
there doesn't appear to be a reason for the former complexity.
QMAKE_CONFIG_LOG was already assigned the simple way.

Change-Id: I6b7e3b5b97c7647237841fa5e16c4959079edc16
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-08-15 10:55:31 +00:00
Oswald Buddenhagen
190aa94be7 Change source identifier type in ProString
The strings remember in which file they were created/assigned.

However, this used a non-counting reference to a ProFile, which could
become dangling. If a subsequent ProFile re-used the exact same address,
a string's source would be mis-identified, which would be fatal in
conjunction with discard_from().

Since we actually need only a unique id for comparison, let's use an
integer for that.

Task-number: QTBUG-62434
Started-by: Simon Hausmann <simon.hausmann@qt.io>
Change-Id: I395153afaf7c835d0119690ee7f4b915e6f90d4a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-15 10:54:50 +00:00
Topi Reinio
79f679da94 Doc: Add styling for function groups
Add CSS rules for grouped function documentation; that is, multiple
function signatures sharing the same documentation body.

Change-Id: I28de3805a8f5f972a59f6ea4ae32262ac36b69a6
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-08-15 09:40:13 +00:00
Stephan Binner
e6fad35155 Convert features.graphicsview to QT_[REQUIRE_]CONFIG
Change-Id: I1083097802772624e5d414678b4612308683a56f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-15 05:10:10 +00:00
Gabriel de Dietrich
306071e50e QCocoaMenu: Sync menubar menu when adding items
Empty menus on a menubar are hidden by default. If the menu gets
added to the menubar before it contains any item, we need to get
the menubar to sync the menu, which will update its native menu
item hidden property.

Menurama manual test's 'Add Many Items' button should now work.

Change-Id: I8ce1df21031c171789318fdf28ae495819458d71
Task-number: QTBUG-62260
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-15 01:21:44 +00:00
Gabriel de Dietrich
f27d1ccbb2 QCocoaMenu: De-pessimize the number of calls to validateMenuItem:
Calling -[NSMenu update] every time we add a new item can result in
a quadratic behavior since the function itself will iterate over all
the items in the menu. We solve this by using a 0-timer which will
trigger the call to update the next time the event loop spins.

Menurama manual test updated.

Change-Id: Ic155d364515cc93eb81b1c8085c8e44c93799954
Task-number: QTBUG-62396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-08-15 01:21:37 +00:00
Romain Pokrzywka
c161c6db78 Fix a race condition in QEvdevTabletHandler::readData()
Statics and threads don't mix well. There can be multiple threads
calling QEvdevTabletHandler::readData() simultaneously if you have
several tablet devices registered with the plugin, creating a race on
the static buffer array.

Make the buffer a simple local variable instead, the array is small
enough that we can afford the per-thread stack allocation.

Change-Id: I4487add8df50743b8178ca6faeb9be45231ccb78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-08-14 19:02:23 +00:00
Romain Pokrzywka
9193b6cc85 QNAM: requeue pipelined HTTP requests after unrecoverable socket errors
If we reach the maximum reconnect attempts for an HTTP request with
pipelining enabled, those also need to be requeued during cleanup for
the connection channel. Otherwise future successful requests on that
same channel will incorrectly assign the data to replies from the old
pipelined requests, resulting in swapped data in the replies.

Task-number: QTBUG-62286
Change-Id: I804b8ac280957b518d63b2341e469a13315a8c27
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
2017-08-14 14:20:52 +00:00
Milla Pohjanheimo
0273391dbe Update binary compatibility files for Qt 5.9.0 for QtBase
Added binary compatibility files for Qt 5.9.0.
'QOpenGLExtraFunctionsPrivate::Functions' and
'QOpenGLExtraFunctionsPrivate' have been blacklisted in
qtqa/tests/postbuild/bic/tst_bic.cpp, because those give false
positive fail in the binary compatibility tests.

Change-Id: I2231daef61a0c4677af36c85575b8dcd81070d44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-14 13:48:17 +00:00
Thiago Macieira
b7bcd03d19 Doc: indicate the QSharedMemory::size() that the size may be bigger
Task-number: QTBUG-62468
Change-Id: I6e9274c1e7444ad48c81fffd14da78718828c4a6
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-08-13 20:47:37 +00:00
Thiago Macieira
10b46fe474 Autotest: Fix test when running on a non-Unicode-capable locale
Like my default FreeBSD environment.

Change-Id: I3868166e5efc45538544fffd14d8a7f2dffa6ac9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-08-12 07:56:39 +00:00
Jarkko Koivikko
8de79dbcec Widgets: Fix ImSurroundingText query for a QLineEdit with mask
QLineEdit with a mask does not return empty fields with the
ImSurroundingText query. This is a problem for the input
context that is not aware of the mask and relies on the
fact that the cursor position never exceeds the boundaries
of the surrounding text.

This change fixes the issue by returning unmasked text with
the ImSurroundingText query.

[ChangeLog][QtWidgets][QLineEdit] Fixed behavior of the
ImSurroundingText query. Previously, it returned a masked
text whose length may be less than the cursor position.
Now it returns unmasked text, so the text length is always
greater than or equal to the cursor position.

Task-number: QTBUG-60319
Change-Id: I1c8009164836a1baa2e3a45958bf1ea5fa9be38d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-08-11 13:27:37 +00:00
Mårten Nordheim
858634d5f4 Fix 64-bit build using MinGW
The relevant changes was made for 32-bit, but not 64

Change-Id: I7dc1a299d72a742efca7c56717274c0c2ea0c579
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-08-11 13:10:46 +00:00
Tor Arne Vestbø
096b56f336 macOS: Create NSView as initially hidden, to match QWindow behavior
Change-Id: I25af6635ea9b6aa3fcc642fa2da0553341aabda8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2017-08-11 13:08:24 +00:00
Gatis Paeglis
255abc1e5a xcb: add support for peeking into the XCB event queue
This will be used by the Qt X11 Extras module.

Task-number: QTBUG-50358
Change-Id: Ie095cd211c393ea6d78660b4d53cac28b435a3b2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-11 13:06:38 +00:00
Jesus Fernandez
a6c4d54eaf Add override keyword to QPlatformSurface derived classes
Change-Id: I9ce58fb48fd41f4fc340188c1df358d9ef215c3f
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-11 09:06:06 +00:00
Oswald Buddenhagen
49cb039a5c make compiler invocation error messages mention host/target
it's unclear where to look for the error when the message talks about
'g++' when '${CROSS_COMPILE}g++' would have been expected. help it by
saying whether it was supposed to be the host or target compiler.

this also centralizes the error emissions in a function.

Change-Id: I454c6ff7c0e7dd945dcee0de01e2818caeeb7409
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-08-11 06:38:56 +00:00
Thiago Macieira
feb2415363 Fix write and read-write ioctls on certain 64-bit OS
Using int as the operation parameter was wrong. It meant any write or RW
ioctls (which have the MSB set) would be sign-extended to 64-bit when
calling the native API. Depending on the OS, the upper 32 bits were not
cleared prior to comparing with the call number, resulting in
unexpected errors.

Linux and FreeBSD operated properly; I only got the error on Darwin.

Change-Id: Iaf4157b7efa2416d898cfffd14d985af65c1ff89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-10 22:51:56 +00:00
Tor Arne Vestbø
22998e64d9 macOS: Remove dead code from Leopard times
Change-Id: I02bc0a8488763fea525771636538b9d0943b8971
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-10 20:51:39 +00:00
Tor Arne Vestbø
7fd9da94bb macOS: Log target view for backingstore flush without quotes
Change-Id: I0d5f9f9172aaa7b9b7575dce6ba59b23567b35ce
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-08-10 20:51:31 +00:00
Gatis Paeglis
5f1df771b6 xcb: re-factor QXcbConnection::printXcbEvent
- To use categorized logging.

- Print also non-core event types.

- Added QLoggingCategory as one of the parameters because I will
  need it in a subsequent patch.

- A call to this function in QXcbConnection::handleXcbEvent I left
  disabled from builds by default as the "handled" variable is broken.

Change-Id: I15cd71c40b5772a4352a69cdc24a0ae026626060
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2017-08-10 17:14:36 +00:00
David Faure
60ad66ce3c QSqlTableModel: avoid copying QSqlRecord instances
Profiling a large model showed that QSqlRecord was being copied and
destroyed from a few places, due to use of QMap<int, ModifiedRow>::value()
where ModifiedRow has two QSqlRecord members. This can easily be avoided
(in the common case with no modified rows) by using constFind() instead.

My testcase (iterating over a model with 126936 rows) went from 1266 ms
to 896 ms.

Change-Id: I04e98b5573ef24165bf6cff19946e5bedd0fb0ba
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-08-10 14:50:29 +00:00
Tero Alamäki
f4e0ffb11c Enable custom shared memory schemes on INTEGRITY
Replaced dependency to libdl.a with libshm_client.a. Defined symbols
'shm_area_password' and 'shm_area_name' internally. The build for
INTEGRITY is static only so libdl.a is not needed.

Change-Id: I7e34528835132d79ea582a30cf9ff61cdda198da
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Rolland Dudemaine <rolland@ghs.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-08-10 12:20:33 +00:00
Allan Sandfeld Jensen
74bbb6ba8a Fix handling of mirroring upscaling in simple bilinear upscaler
Calculates the correct offsets and coordinate transforms for the
intermediate buffer. This means we can conceptually simplify our
path switches instead of having downscale routines handling mirrored
upscaling.

Change-Id: I60efa7feaba80165672ca0ce064515fdf620869d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2017-08-10 06:42:22 +00:00
Stephan Binner
ee29be91c0 Convert features.toolbutton to QT_[REQUIRE_]CONFIG
Change-Id: I4227e1868da21bded76a8ec55996c436c8a8d763
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:30 +00:00
Stephan Binner
e58fdbaeb0 Convert features.splitter to QT_[REQUIRE_]CONFIG
Change-Id: I2eea5004938c581beb5a7c0c01409c576c5e5b39
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:25 +00:00
Stephan Binner
39851c6905 Convert features.groupbox to QT_[REQUIRE_]CONFIG
Change-Id: I034286043a880ab777ec3f2311572bdc38e7fafc
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:21 +00:00
Stephan Binner
414026ad9c Convert features.scrollbar to QT_[REQUIRE_]CONFIG
Change-Id: Id6ea899c0fddf0de636701cfdc5f01ba20024976
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:17 +00:00
Stephan Binner
d1a3e674b6 Convert features.toolbox to QT_[REQUIRE_]CONFIG
Change-Id: I7abfe0166a021c439f6ed4465631ba62660ef001
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:13 +00:00
Stephan Binner
0987bda99e Convert features.progressbar to QT_[REQUIRE_]CONFIG
Change-Id: I66d00d5bac98ff337ba5877e5f23be5e14a97551
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-08-10 05:37:08 +00:00