Commit Graph

38711 Commits

Author SHA1 Message Date
Tasuku Suzuki
9d9b944b44 Fix configure comment in/for -device linux-rasp-pi3-vc4-g++
The name was renamed in 8e445f8434

Change-Id: I5a74b65309cf5dc64621db281fad3a62a2f026b1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-04 17:22:35 +09:00
Tor Arne Vestbø
b53994de5f macOS: Use QMacNotificationObserver over manual notification handling
This also fixes a bug where we were implicitly capturing this inside
the block, which meant that we would crash if the theme was recreated.
The capture is now tied to the lifetime of QCocoaTheme.

Change-Id: I37df8e6c0b33bf41e76d66be3cf29576041a7546
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-29 17:11:40 +02:00
Friedemann Kleint
15d73a9f47 Qt Widgets: Make tests pass on High DPI screens and scaling
Use the comparison helpers to do fuzzy checking of geometries.

Change-Id: I00f4403f3bca2e8a3996e938a85ba799e083058c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-29 12:52:51 +02:00
Mikhail Svetkin
9a47768b46 macOS: Fix reported mouse event buttons
Use m_buttons instead of currentlyPressedMouseButtons. The latter returns
the state of devices combined with synthesized events at the moment,
independent of which events have been delivered via the event stream,
so this method is not suitable for tracking.

Task-number: QTBUG-74057
Task-number: QTBUG-74121
Change-Id: Iabf99ada6c3d25a995c9ddf895059b70833a9051
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-06-03 05:08:44 +00:00
Joerg Bornemann
4da47d0fba Make sure .pc, .prl and .la files are created for header_only modules
Those modules are TEMPLATE=aux, so they weren't triggering the file creation
here.

To make this work properly we have to:
  - check for TEMPLATE aux in the right places
  - add a dummy target to INSTALLS to actually trigger the creation
  - initialize PRL_TARGET for aux templates

Fixes: QTBUG-75901
Started-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Idce141629dd34287808bfffd159f92ac28c6c8b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 15:06:29 +02:00
Joerg Bornemann
c64f8ca232 Do not write 'Libs:' into .pc files if TEMPLATE is not 'lib'
Especially for header modules we don't want a 'Libs:' entry in their
.pc file.

Task-number: QTBUG-75901
Change-Id: I39037d3132e39dd360532e1425f794ebec28e0bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Joerg Bornemann
60136b1a84 Fix meta file replacements if matches are empty
QMake code like
    rplc.match =
    QMAKE_PRL_INSTALL_REPLACE += rplc
led to the generation of invalid sed calls in the Makefile.

It is already actively checked for empty matches, but if *all* matches
are empty, the sed call looks like
    sed foo > bar
which is invalid.

Task-number: QTBUG-75901
Change-Id: I173ed99826414dcf06253a15a247f7d067ee3977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-03 14:58:39 +02:00
Liang Qi
7029ecade9 cmake: correct version dependency for qt5_add_big_resources
qt5_add_big_resources is only available if using CMake 3.9 and later.

This amends cdccd0222b.

Task-number: QTBUG-55680
Task-number: QTBUG-75806
Change-Id: Ibba7af6ee7edfb226368937d543b7ec5cc93eb16
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-20 12:49:37 +02:00
Joerg Bornemann
68866b1a7b Fix QMAKE_EXTRA_COMPILER names in VS projects
Use the whole value of 'name', not just the first element, and also
replace variables like ${QMAKE_FILE_IN}.

This fixes the file_copies feature (COPIES) for Visual Studio
projects, because for every entry in COPIES an extra compiler is
created with a name 'COPY ${QMAKE_FILE_IN}'. Before this patch the
name and the generated file filter would be just 'COPY'. However,
duplicate filters are being skipped by the VS project generator. All
but the first COPIES entry was ignored.

Fixes: QTBUG-76010
Change-Id: Icaa5d2cb8d88ae3ef8ce86220198bca1b9e673f5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-31 10:48:35 +02:00
Friedemann Kleint
67c569add0 Make tst_qwidget pass on High-DPI screens (Windows)
- Move the fuzz check introduced by
  6309062722 to a shared header for
  reuse. Use it in in more places to account for rounding errors
  introduced by odd window frame sizes when scaling is active.

- Use the test widget size to ensure windows do not violate the
  minimum decorated window size on Windows when scaling is inactive
  on large monitors.

Task-number: QTBUG-46615
Change-Id: Icf803a4bc2c275eadb8f98e60b08e39b2ebebedd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-03 10:41:08 +02:00
Joerg Bornemann
085d1335d1 Warn about invalid SUBDIRS content
Invalid SUBDIRS values like

SUBDIRS += foo \
           bar \ \
           baz

would produce a Makefile with a sub-- target that will call the make
on the same Makefile again recursively, letting make run forever.

Ignore values like this and print a warning message.

Fixes: QTBUG-76068
Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-28 13:40:42 +02:00
Friedemann Kleint
90c683e41c Q(Plain)TextEdit: Observe color hints from style sheet depending on focus state
Ask the style sheet style to adapt the palette in
WidgetTextControl::getPaintContext() as is done for QLineEdit.
Use the palette color in QPlainTextEdit.

Change-Id: I67758716b66feaeac8c2433c2a4d3744cd0d5327
Fixes: QTBUG-72100
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-24 13:06:20 +02:00
Andy Shaw
81b33a8252 Fusion: Fill the rect with base brush when drawing the combobox frame
Instead of doing this directly inside the PE_FrameLineEdit as this can
be used directly when a stylesheet is set the rect of the lineedit used
in the combobox in fusion style is filled directly with the base brush.
This ensures it still renders the background correctly when using fusion
style, but enables stylesheets to work as it will not override that if
the background is set in a stylesheet for a combobox.

Fixes: QTBUG-75816
Change-Id: I50a0600b500088ebcf1d70a02f9c74c6040d34d9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-27 14:35:18 +02:00
Laszlo Agocs
364240ed11 macOS: Enable VK_MVK_macos_surface on the instance
Reports say some systems get "Failed to find vkCreateMacOSSurfaceMVK"
even though MoltenVK and the corresponding extensionare there. While not
reproducable on single GPU Intel systems, it could be that not enabling
the extension on the Vulkan instance is causing this. Not opting in to
the extension is incorrect in theory anyway. So fix it in cocoa as well,
similarly to how other platform plugins do this already.

Task-number: QTBUG-76117
Change-Id: I75220f3582a700ce0037003086123d3d38524648
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-05-30 19:11:01 +02:00
Morten Johan Sørvig
1eac947ce2 Work around crash where a destroyed window becomes focus_window
Clear QGuiApplication::focus_window (again) in the
QWindow destructor.

Task-number: QTBUG-75326
Change-Id: Ief00b6adfb267fcc7e3881fd728e12df07fc1094
Reviewed-by: Christian Andersen <csandersen3@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-22 12:08:55 +00:00
Tor Arne Vestbø
a67b25067e Rename QMacScopedObserver to the more fittingly QMacNotificationObserver
Change-Id: I1d8280fe88871572a3a27e612de49717b3b9ef77
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-29 17:11:40 +02:00
Edward Welbourne
c3571d2922 Correct qfloat16's 1/inf == 0 test
It should have been qfloat16(1)/qfloat16(infinity) in any case.
Sadly, that behaves no better than qfloat16(1.f/qfloat16(infinity)),
which was promoting the infinity back to float.  So retain the check
for over-optimization (but make the comment more accurate).

This is a follow-up to d441f6bba7.

Change-Id: Iec4afe4b04081b0ebfbf98058da606dc3ade07f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-27 11:52:22 +02:00
Friedemann Kleint
4df554c652 Windows QPA: Fix clang warnings about narrowing conversions
Change-Id: Iba173b45fb77918694fc2c7506885fdeef9f6064
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-29 12:55:21 +02:00
Andre de la Rocha
c150c7a566 Windows QPA: Optimize code that gets window under pointer
It's not necessary to call QWindowsScreen::windowAt() for every mouse
message received, but only when the mouse is captured, like it's done
in the legacy mouse handler.

Change-Id: Ib1035921291d22a32dfa3a619815a3f4ff9b3622
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-28 18:26:51 +02:00
Friedemann Kleint
0f417efe0f Windows QPA: Fix QGuiApplication::topLevelAt() with screen recorder applications
Special applications like screen recorders can create special, invisible
windows which are detected by the ChildWindowFromPointEx() as used in
QWindowsContext::findPlatformWindowAt(). Fall back to WindowFromPoint()
which skips those in case nothing is found.

Fixes: QTBUG-40815
Change-Id: Idb5253c412fb4522c844edf5eadedc6e0fad3979
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-28 14:32:01 +02:00
Joerg Bornemann
978987981a Automatically sysrootify $$[FOO/get] properties
If automatic sysrootification is in effect (SysrootifyPrefix=true in
qt.conf) then the qmake property variants $$[FOO] and $$[FOO/get] must
be sysrootified. The latter was never sysrootified.

All other variants (src, dev, raw) are supposed to be without sysroot.

Flesh out a sysrootify function and readabilitify the code a bit while
we're at it.

Fixes: QTBUG-71673
Change-Id: Ifcbce8c035b9da447da9d6937edd5a4aa84573ba
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-28 12:33:22 +02:00
Giuseppe D'Angelo
b9f96cacc9 QRegExp: remove an out of bounds access into QString
... spotted with the brand-new checks for that in QCharRef.

The rx[i] == ~~~ check is clearly wrong, as rx is the regexp
we're building and `i` was not supposed to index into it.

The intended meaning was wc[i] == ~~~, testing if we were seeing
the closing bracket of a character set. We need to check for
that immediately for dealing with the special syntax of []...] where
the ] belongs to the character set (it can't be the closing one
as character sets cannot be empty).

Fix and add a regression test. Bonus: this code was almost
unchanged since 2009.

Change-Id: I958cd87fc25558e9d202d18b3dd4a35d0db16d8d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2019-05-27 17:33:30 +00:00
Eirik Aavitsland
c04bd30de0 Guard against numerical overflow when processing QPainterPaths
Many operations on and with QPainterPaths do calculations on the path
coordinates, e.g. computing the distance between points, which may cause
numerical overflow for extreme coordinate values. This patch
introduces a limit on the coordinate values and extends the previous
check against nan/inf coordinates to also check against out of range
coordinates.

Fixes: QTBUG-75574
Change-Id: I3a2fa88bfc6a9f19934c43d3dbbfb41855c78107
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-05-15 13:50:55 +02:00
Timur Pocheptsov
ebddd02896 QMacStyle - fix the separator's color in the Dark theme
It's too dark as it is now. Since there is no similar UI element
in AppKit, we take the same color as the toolbar's handle has (looks
OK-eysh with 'Dark' and there is no reason to have the separator with
a color different from the bar handle, both elements essentialy are
lines of dots).

Fixes: QTBUG-72759
Change-Id: I28277f80174a1c4c0af17961aba8ed6135aa3189
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-24 14:42:17 +02:00
Ryan Chu
cc4c0b43a5 QDataStream: Fix inconsistent results of iostream with QPalette objects
The value of NColorRoles got changed since 5.11. It introduced one more
role called "PlaceholderText" in the ColorRole enumeration.

When using QDataStream (5.12) to read QPalette objects from a file
written by 5.9 (<5.11), the processing results are inconsistent.

Fixes: QTBUG-74885
Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-05-20 22:33:33 +02:00
Edward Welbourne
14aa1f7d6f Use appropriate encoding rather than UTF-8 when reading from a pipe
The qmake code to read output from dependency-generation was adding
QByteArray values to a QString, thereby tacitly converting from UTF-8;
this is misguided. Hopefully, the command emits its output in the same
local 8-bit encoding that QString knows to convert from.

Simplified needlessly verbose loops (that violated Qt coding style) in
the process.

Fixes: QTBUG-75904
Change-Id: I27cf81ffcb63ebc999b8e4fc57abdb9a68c4d2b3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-05-24 16:58:04 +02:00
Kai Koehne
0c9b449aa4 Doc: Clarify state of Qt Xml
The state of the module is done, not deprecated, so we shouldn't
recommend users to move away from it in all cases. There's also
no direct replacement for the DOM API.

Fixes: QTBUG-70629
Change-Id: Ifaff9757234bd68a411a3da1403c57bbbcb94693
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2019-05-24 11:54:55 +02:00
Thorbjørn Lund Martsum
48f7f65dc3 QMenu size fix - Mark items dirty on screen change
It seems like an optimization on the itemsDirty flag
caused a bug to be re-introduced. When a popup is shown
on a new screen, the itemsDirty must however be set to
ensure that new correct sizes are calculated.

Task-number: QTBUG-59794
Change-Id: Ifb5c233b1f9d4d38bd0cd7a9a71cc32ad3212f8c
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-05-22 11:22:26 +02:00
Andrew den Exter
d661a22ae2 Write an anchor-type attribute when embedding images in an ODF document
Without this some readers will fail to display the image or position
the image at the start of a paragraph rather than inline.

Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:07 +10:00
Andrew den Exter
345f86a2d8 Avoid re-encoding embedded images when writing an ODF file
If an embedded image is already encodeded as an png or jpg write the
data as is instead of decoding to a QImage and re-encoding as a new
image.

Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 13:03:01 +10:00
Alexander Volkov
795af729d3 Avoid rounding of the size in QGraphicsPixmapItem::boundingRect()
Fixes: QTBUG-75458
Change-Id: Ib240ddc0b490ae3c0348b6bfa290ad1f51b1e071
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-09 23:51:39 +03:00
Morten Johan Sørvig
3386b875dd QHighDpi: Remove fromNativePixels()/toNativePixels() overloads
Replace QWindow / QScreen / QPlatformScreen overloads with template
functions that take a generic context argument.

The API now no longer supports implicit conversions from
QPointer<QWindow> to QWindow *, add explicit data()
call to usage in qxcbdrag.cpp.

Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-22 13:37:39 +02:00
Friedemann Kleint
ea9469f2b6 QCompleter: Fix completion on QFileSystemModel
Fix the condition introduced by that determines whether
a completion is started on signal QFileSystemModel::directoryLoaded()
(introduced by  416ec00e7c859a844a5bcb24c7a31147aed974c / Qt 4).
Observe case sensitivity and the native separator and return true for
root directories.

Task-number: QTBUG-38014
Task-number: QTBUG-14292
Change-Id: Ie425c04d2df256248e84250ba777793a8106a738
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-21 11:26:22 +02:00
Sergio Martins
837c388dd3 dockwidgets: Unbreak moving floating dock widgets with custom titlebar
f1033567aa improved resize of windows with custom titlebar by adding
more margin, but the check was too tight.

d2d6c6f781 tried to fix the regression, but not totally

The mode is only set *after* the mouse press. It will always
be NoWhere the first time, so that check will always discard
the mouse press, making moving the window always fail the first time.

Also, if the rect+range contains the press, then surely the mode
won't be nowhere once set.

There's still room for optimization, like bailing out early it was
the right button instead of the left button, but that's out of scope
for this bug fix, and also not worth for 5.12 branch.

To reproduce the bug, simply:
- Run examples/widgets/mainwindows/mainwindow
- Click the red button of the blue dock widget, to make it float
- Drag the title bar (not too slow).

Fixes: QTBUG-66454
Change-Id: I0eebfb932dab95267ebadccd757de11a8bfe419d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Nathan Collins <nathan.collins@kdab.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-05-21 22:49:33 +01:00
Edward Welbourne
2ed4fcca19 Update QMetaEnum::fromType()'s static assert's error message
QMetaEnum fromType() also works for enums declared with Q_{ENUM,FLAG}_NS.
This hadn't been added to the message when we added Q_{ENUM,FLAG}_NS.

Fixes: QTBUG-75829
Change-Id: Ib71dae83dd8d837adf46b73cd299b8e61bdb1f64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-15 11:42:22 +02:00
Friedemann Kleint
6fb2b4b271 QPA: Prevent QPlatformWindow::initialGeometry() from returning invalid geometries
When trying to find the screen, the function would always
try to determine the screen by checking parents, despite
QWindowPrivate::positionAutomatic being false.

Determine the screen from the initial geometry when
QWindowPrivate::positionAutomatic is false. Bail out when
positionAutomatic and resizeAutomatic are false.

Fixes: QTBUG-75940
Change-Id: I3cd1b16feab16c89d29856cf3e1bccf2c89280c7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-05-22 09:26:36 +02:00
Friedemann Kleint
eea6c920c9 Blacklist tst_qwindow::spuriousMouseMove() on Windows
The test is failing in 5.13 for unknown reasons.

Task-number: QTBUG-72296
Task-number: QTBUG-72344
Change-Id: I24c1ad1b6def3096de99caeeebeee6e204cc75ca
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-20 16:43:23 +02:00
Vova Mshanetskiy
8ea3300a08 QAndroidInputContext: Fix getTextBefore/AfterCursor() in mid. of preedit
getTextBeforeCursor() and getTextAfterCursor() were not properly
handling the case when the cursor is in the middle of preedit string
(just as TODO comments inside these functions were saying). This was
causing problems with Gboard when the user focuses a text editor by
tapping in the middle of a word.

Fixes: QTBUG-58063
Change-Id: I4a580a74d79965816557bfb342337975348d1c45
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-05-08 14:52:31 +03:00
Vova Mshanetskiy
d0741f4267 QAndroidInputContext: Fix most "Input method out of sync" warnings
According to Android docs start == end in a call to setComposingRegion()
means finish composing. But this case was not being handled properly:
m_composingText was being assigned an empty string, but
m_composingTextStart was being assigned the value of start, which is
never -1.

There is one other possible cause of "Input method out of sync"
warnings, but it is tightly coupled with another bug, so it will be
fixed by a separate commit.

Change-Id: Ie475df84f330453ce4fc623e8b631b435d7d0042
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-05-13 14:52:47 +03:00
Frederik Gladhorn
73ca3dbf49 Windows Accessibility: window should be focusable
Fixes: QTBUG-75001
Change-Id: Iac67b9bba70317f8d28ac2d355d584417d1ffebf
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-21 09:26:10 +00:00
Massimiliano Gubinelli
a4bd4565cc Emit QMenu::aboutToShow() before platform specific code
Send the aboutToShow() signal to QMenu before synchronising the
widgets for the menu items. This fixes a bug where if new
QWidgetActions are added to the menu from a slot triggered by the menu's
aboutToShow() signal, then such new actions do not shows up correctly on
Mac. Other platforms are not affected by the change.

Fixes: QTBUG-75826
Change-Id: Ic245d3fbc7ddde6944cca6cdb8e8951380c846ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-16 12:33:45 +00:00
Laszlo Agocs
1f04b09446 eglfs/openwfd: do not purge QSurfaceFormat fields
Change-Id: I6c1d83624838362f6a3daa6c2b309fb518a25d4b
Fixes: QTBUG-75673
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-05-08 15:51:19 +02:00
Frederik Gladhorn
516ab2a595 Windows Accessibility: Add UI Automation Window provider
This allows closing, minimizing and maximizing the window.

Fixes: QTBUG-74999
Change-Id: I8b3ad806a1767586c8cf7e5a1848fc0e525621cd
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-05-20 13:21:02 +00:00
Tor Arne Vestbø
5e743adc20 Don't try to retranslate strings for native color dialogs
If the native color dialog is in use we haven't created any of the
widgets and will crash when trying to update them.

Change-Id: I6c43cc47359110c3b9db7cacb62581446cc6f7a3
Fixes: QTBUG-75858
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-16 14:51:42 +02:00
Tor Arne Vestbø
387691498a macOS: Generate UTF-16 clipboard content without BOM
Qt on macOS has traditionally not included a BOM in the UTF-16 data,
but due to iOS requiring it it was changed in 4e196159. This had the
unfortunate side effect of breaking macOS applications that were not
prepared for the BOM, even if the public.utf16-plain-text UTI can have
an optional BOM, most notably Microsoft Excel. It also resulted in the
public.utf8-plain-text having a BOM, as that's automatically generated
by macOS based on the UTF-16 content we give it. Having a BOM in UTF-8
is technically fine, but not required, and recommended against.

The fact that iOS requires a BOM is a bit dubious, and most likely a
result of applications or system frameworks decoding the data using
NSUTF16StringEncoding, which assumes big-ending byte ordering if there
is no BOM, as opposed to public.utf16-plain-text which assumes native
byte ordering. Since we can't fix iOS our best bet is to include a BOM.

For macOS though, we revert back to the old behavior of not including
a BOM, since that seems to surprise macOS frameworks and applications
the least, even if having a BOM in public.utf16-plain-text should be
fully supported.

Longer term we should look at what kind of UTIs we generate. Most apps
on macOS do not generate public.utf16-plain-text, but instead generate
public.utf16-external-plain-text, which differs from the former in that
it assumes big-endian byte-ordering when there's no BOM. On iOS apps
seem to generate public.utf8-plain-text, and do not generate any UTF-16
UTIs. Moving Qt over to these UTIs would fix the problem as well, but
is a larger change that needs more research.

Change-Id: I4769c8b7d09daef7e3012e99cacc3237f7b0fc1a
Fixes: QTBUG-61562
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-20 13:31:34 +00:00
Friedemann Kleint
299675e665 tst_QMdiSubWindow::setSystemMenu(): Pass in High DPI/multi-screen setups
The window tends to grow to span screens in multi-screen setups; force it to
be on the primary screen by showing it maximized in that case.

Change-Id: I984ba7a4cd4abd1f862c59c8dca0e2275f44c724
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-05-20 10:51:46 +02:00
Friedemann Kleint
18b336990f Brush up tst_QMdiSubWindow
- Use nullptr
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
  slow tests
- Fix the class declarations, use override, member initializations
- Use Qt 5 connection syntax where possible
- Ensure top level widget list is empty after each test, delete left-over
  menu bars and disable menu animations

Change-Id: Ieeb943ea669cd139f1835088b816802e777a9676
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-20 10:51:46 +02:00
Morten Johan Sørvig
4c9758f1af QHighDpi: Simplify top-level window handling code
Introduce origin(QWindow *), which returns the point
around which coordinates should be scaled: the screen
origin for top-level windows, and (0, 0) for child windows.

The code paths for top-level and child windows can
then be combined.

Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-14 19:31:16 +02:00
Andre de la Rocha
8be17f1fd5 Windows QPA: Fix QWheelEvent::buttons() after click on title bar
When the left or right mouse buttons are pressed over the window title
bar a WM_NCLBUTTONDOWN/WM_NCRBUTTONDOWN message is received. But when the
button is released, no corresponding UP message is received, but only
a WM_NCMOUSEMOVE or WM_MOUSEMOVE. This makes the internal mouse button
state stored in QGuiApplication get out of sync with the actual state,
resulting in an incorrect button state being used in QWheelEvent.
This patch detects the button release condition and generates the missing
release event.

Change-Id: I6dd9f8580bd6ba772522574f9a08298e49c43e61
Fixes: QTBUG-75678
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-18 03:15:06 +00:00
Oliver Wolff
a96a33d993 qtmain_winrt: Avoid nullptrs in str*cmp which cause crashes
When bringing an application back to foreground, args may contain NULL.
These nullptrs should not cause application crashes.

Fixes: QTBUG-75843
Change-Id: I642e3c359216e7706bcb13508399999a51a4fc2d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-17 09:26:33 +00:00