Commit Graph

40090 Commits

Author SHA1 Message Date
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
Samuel Gaist
1dc1a032a8 doc: Improve the Coordinate System rectangle coordinate examples
QRect and QLine share a constructor with the same signature but
with different meanings. This patch improves the coordinate
examples to show the possibilities and make things clearer.

Change-Id: I76a95ca226c12968ae5b15d4eb12fc2965cb57d2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2019-05-23 08:39:47 +02:00
Liang Qi
da23302e4d Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-06-07 13:19:27 +02:00
Liang Qi
9967a011ea Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/makefile.cpp
	src/plugins/platforms/cocoa/qcocoaintegration.h
	src/plugins/platforms/cocoa/qcocoaintegration.mm

Done-With: Jörg Bornemann <joerg.bornemann@qt.io>
Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
2019-06-07 13:19:27 +02:00
Timur Pocheptsov
91ab70d17f tst_qnetworkreply - QSKIP/disable tests that deadlock on Windows
We use global object to store errors found by q_X509Callback.
Thus, we also use a lock/mutex. It would appear all tests
involving in-process server and QNAM are prone to intermittent
failures on our Windows VMs - it's always about timeouts due
to the client socket (QNAM) locking and the server socket blocking
main thread while trying to acquire the same lock.

The real fix is to get rid of global variable/locking, we'll
have it later (quite a change and requires a lot of accuracy).

Task-number: QTBUG-76247
Change-Id: Iffc90d9e16783f17f62e836e01c35f22681bdd39
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-07 06:39:16 +02:00
Andy Shaw
825b474363 Windows: Use the first entry in the requested families if available
If the font request has the families list set then it should use the
first entry in that if the face name is empty as this will be more
accurate than just the whole family setting which may contain a
comma separated list of family names.

Fixes: QTBUG-75333
Change-Id: Iccc9cde741544af5263cb318da56178adf34299b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-05 11:46:00 +02:00
Friedemann Kleint
87ca7c9688 tst_QGraphicsView::cursor2(): Prospective fix for flakyness on Windows
Use QTRY_COMPARE to fix recent fails like

FAIL!  : tst_QGraphicsView::cursor2() Compared values are not the same
   Actual   (view.viewport()->cursor().shape()): IBeamCursor
   Expected (Qt::SizeAllCursor)                : SizeAllCursor

Task-number: QTBUG-76259
Change-Id: Ie9d4bbe45a3be6064ec88ee237360beb92a61481
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-06-07 11:07:39 +02:00
Shawn Rutledge
a978c48284 Blacklist tst_QGraphicsView::cursor2 on Windows
It's really failing only on Windows 10 it seems.

Task-number: QTBUG-76259
Change-Id: Ieb541dc994a17e82478a5cc2643e0a89fd5aa97d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
 
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-06-07 08:28:12 +02:00
Friedemann Kleint
65cfac73bd Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-05-27 09:17:14 +02:00
Friedemann Kleint
761b71bd20 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Iaf6bd52972b562b9c91d9e93a988d26b0eb9d3b4
2019-05-27 09:17:14 +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
Allan Sandfeld Jensen
48b707224e Fix invalid vptr during destruction of animations
Fixes UBSAN warnings about objects used after partial destruction.

Change-Id: Iceea083a77d47335ef595c0ff97b87f35f42e56f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-05-23 16:15:00 +02:00
Allan Sandfeld Jensen
cf7d990a48 Fix reference to a dead temporary
NoDefaultConstructorRef1 was taking a reference of the input, which
meant in the first test it would get a reference to the temporary
created by the 1 literal. A temporary that would be out of scope by
the time we check its value.

Instead add a test with unique_ptr to test we can pass movable
temporaries.

Change-Id: I6b02377dfe30c82b6e71bfb3353a81ad81558ed3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-22 11:22:40 +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
Lorn Potter
800941df89 wasm: fix empty body on POST
this also optimizes network post method handling

Task-number: QTBUG-75660
Change-Id: Ibb0d01f2cc2b2bc7802598c4f6f04b04882c12ca
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-22 16:58:34 +10:00
Lorn Potter
9fc17c14fa wasm: fix QSGContext warning message
When runing the scenegraph example sgengine, gets rid if this error:
 QSGContext::initialize: stencil buffer support missing, expect
 rendering errors

Change-Id: I7f3a82409bc2cf81cf8217876e527f9c45be3bf4
Fixes: QTBUG-74694
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-21 06:21:21 +10:00
Antti Kokko
ca0f85da82 Add changes file for Qt 5.13.0
Edited-By: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I9d681de1716965342fb1635c8d018dde22fe2c98
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-20 10:02:20 -07:00
Joerg Bornemann
015d7f16cb Fix QMAKE_PRL_INSTALL_REPLACE for macOS
The regular expression with the alternative is not portable.
Use a separate QMAKE_PRL_INSTALL_REPLACE item.

This amends commit f00de33.

Fixes: QTBUG-75950
Change-Id: I78e172053f8b05be7d595a1c9e1695ea658b0547
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-22 10:40:36 +02:00
Joerg Bornemann
f00de3322e Replace absolute Qt lib dir in .prl files
In the case of building a Qt module repository against an installed
qtbase the .prl files contain absolute paths to Qt dependencies e.g.
'/install-prefix/lib/libQt5Core.so'.

Those must be replaced with $$[QT_INSTALL_PREFIX]. The .prl
replacement code however only takes $$MODULE_BASE_OUTDIR/lib into
account.

Fixes: QTBUG-75804
Change-Id: I5ea5623ca7396b672fded3f1b9434b9ad5ed12ec
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-20 13:06:57 +00: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
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
Christian Ehrlicher
aa8d3f90a4 QAbstractSpinBox: fix some ui glitches
Fix some ui glitches for QAbstractSpinBox:
 - update geometry when buttons are toggled on/off
 - calc button size with subControlRect instead hardcoded 20px
 - when buttons are not shown, don't add the button size in
   sizeFromContents for common and macOS style

Fixes: QTBUG-39713
Fixes: QTBUG-75303
Task-number: QTBUG-67126
Change-Id: Ibf330c76deb16358a481bba6bd429fff6a5d57ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-10 19:52:11 +02:00
Allan Sandfeld Jensen
12ebdf0281 Fix new[] delete mismatch in test
QScopedPointer uses normal delete, but we need delete[].

Change-Id: Id62a2c55f75ef4aa60580f5e04c4bf306a6dd3c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-15 11:17:57 +02:00
Dongmei Wang
ad1d616033 wasm: add Qt Virtual Keyboard support
Change-Id: I454ab677cad25b50ba7b03ef2c4b6046e1227ce8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2019-05-16 13:30:52 -07:00
Fredrik Orderud
2a2f04205c WASM: Make wasm_shell.html compatible with CMake configure_file
The CMake configure_file command is commonly used copy & modify template files
during the build process. One limitation, thought, is that configure_file
expect the variables to be replaced to be encoded using either a @APPNAME@ or
${APPNAME} convention.

This commit therefore changes "APPNAME" to "@APPNAME@" in wasm_shell.html to
make the HTML template file compatible with CMake configure_file.

With this commit, it becomes possible to write the following CMake function
that mimics what QMake is already doing:
function(copy_html_js_launch_files target)
  set(APPNAME ${target})
  configure_file("${_qt5Core_install_prefix}/plugins/platforms/wasm_shell.html"
                 "${target}.html")
  configure_file("${_qt5Core_install_prefix}/plugins/platforms/qtloader.js"
                 qtloader.js COPYONLY)
endfunction()

Change-Id: Ic38abdc498ba03b8d21f1b9b70aa1d480ae7f362
Reference: https://cmake.org/cmake/help/latest/command/configure_file.html
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-21 09:12:07 +02:00
Volker Hilsheimer
bd55a9d912 Fix canonicalFilePath() for files with trailing slashes
Such files do not exist (as per QFileInfo::exists), but on some
platforms that rely on realpath(), QFileInfo::canonicalFilePath did
not return the empty string.

Use the same logic on macOS as we already did on Android, and include
a test case. Remove the unnecessary dynamic memory allocation and
use a stack-allocated array instead, unless we use modern POSIX in
which case realpath() will alloc the memory for the result for us.

Change-Id: Ide987c68ebf00cbb7b1a66c2e9245a12c7807128
Fixes: QTBUG-44242
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-21 13:59:34 +02:00
Cristian Adam
bba44746f9 Disable debug plugin check for MinGW
MinGW doesn't have a debug and a release version of the CRT like
Visual C++ does. Disabling the check would allow distribution
only of a Release build of Qt.

Change-Id: Iecfa753217af96ca74091cd1d47400632629abdb
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-05-20 13:00:41 +00:00
Tor Arne Vestbø
e6036cfc5a macOS: Better document plain-text code-path in QMacPasteboard::retrieveData
Due to PasteboardCopyItemFlavorData converting newlines to '\r' for some
UTIs we have traditionally had to shortcut these UTIs via NSStringPboardType
instead of the mime converters such as QMacPasteboardMimeUnicodeText.

Let's explain this a bit better for future generations.

Note that public.utf8-plain-text doesn't seem to have this problem
anymore, but it's left in for now to not cause any regressions due
to behavior change.

Change-Id: I7dce80828865c6323ed308780b8ca07b7a3e7c17
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-15 16:30:16 +02:00
Tor Arne Vestbø
4504d9ca31 macOS: Remove broken UTF-16 handling in QMacPasteboard::retrieveData
The logic seems to be to prefer public.utf16-plain-text over the UTI
reported by the mime converter's flavorFor, but this doesn't make sense
for two reasons:

 1. If the converter reports a UTI from flavorFor, we should respect
    that as the preferred UTI. QMacPasteboardMimeUnicodeText already
    reports public.utf16-plain-text as expected.
 2. We don't know if the converter supports the public.utf16-plain-text
    UTI, which is the case for QMacPasteboardMimeTraditionalMacPlainText
    for example. The result is that we fail to retrieve any data. The
    reason we haven't been seeing this issue is that the code path above
    using qt_mac_get_pasteboardString will in most cases succeed and
    return early.

Change-Id: I0b7e0d09a97389a229e7a945f17fef74ad5c2fc0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-15 16:16:14 +02:00
Kavindra Palaraja
704b6bac13 doc: Explain how qmake finds for files included in your source code
Task-number: QTBUG-26651
Change-Id: Icc09e3272fcec8af0c33d79655159d13183c66ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-16 13:06:52 +00:00
Samuel Gaist
895db969a5 doc: improve QStandardItemModel code snippet
The snippet currently uses hard coded values for looping which
is not good practice. This patch fixes this using rowCount and
columnCount.

Change-Id: Ie532649353f757843426a18e9a50b86a2278f7a5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-05-16 06:48:37 +00:00