Commit Graph

39724 Commits

Author SHA1 Message Date
Tor Arne Vestbø
09504d484c macOS: Guard against display on non-main threads
AppKit will in some cases ask our view to display on secondary threads if
we call APIs that are only supposed to be called on the main thread, such
as -[NSOpenGLContext setView:] or -[NSOpenGLContext update].

Forwarding this display-request is bad, as QtGui expects all window system
events to come on the main thread, and we can easily deadlock client code
such as the Qt Quick threaded renderer.

Change-Id: I1daeabf1dca6ca8ba908d3998b444a2089681e3a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-13 15:19:35 +00:00
Friedemann Kleint
7eed1e40d4 Windows QPA: Fix resize loops when moving fixed size windows between screens
Postpone the screen change until the DPI changed event in case a move
between screens with different DPI is detected.

Task-number: QTBUG-65580
Change-Id: I356f144b243d7d1ce7feabf0434c3f534b903965
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:57 +00:00
Friedemann Kleint
d2fd9b1b98 Windows QPA: Fix window frame calculation in multi-monitor setups
When introducing EnableNonClientDpiScaling() for QTBUG-53255, the window
frame calculation was not adapted. That is, window frames were calculated
from the style for the primary screen only, causing

- minimum size constraints not being calculated correctly for applications
  on secondary screens when populating the MINMAXINFO structure.
- warnings about not being able to apply a geometry when moving fixed
  size windows across screens.

The calculation of the frames for propagating size hints is also no longer
required after 3035400f36, which retrieves
them from the WM_NCCALCSIZE message; QWindowsWindow::fullFrameMargins() can
be used instead.

For newly created windows, use the newly added AdjustWindowRectExForDpi()
function to calculate the initial frame size.

Change QWindowsGeometryHint from a class to a collection of static functions
and add overloads to calculate the frame.

In checkForScreenChanged(), update the margins until WM_NCCALCSIZE is
received.

Task-number: QTBUG-67777
Task-number: QTBUG-65580
Task-number: QTBUG-53255
Change-Id: Iff2d382b2b316adec6c1a0622ae8015dba6de371
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:48 +00:00
Morten Johan Sørvig
3af7b27917 Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windows
Make these functions handle the case where a window spans multiple
screens, and high-DPI scaling is enabled, and the local position (in the
window) is not on the window primary screen (as returned by
QWindow::screen()).

This is done by detecting the case, and then calculating
the correct position using the native coordinate system.

[ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle
windows spanning screens correctly.

Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Task-number: QTBUG-73231
Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-13 13:52:32 +00:00
Morten Johan Sørvig
56acf089c7 wasm: support setting the font DPI from JS
We have not really been able to determine what the
default DPI should be, so make it configurable with
API on qtloader.js:

  qtLoader.setFontDpi(72);

Also lowers the default DPI to the standard value of
96 (down from Qt default 100).

Task-number: QTBUG-75510
Change-Id: Ica1164c8d80bb06519233adebf2c9e400c0991ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-13 12:29:21 +00:00
Liang Qi
ffdcad9e40 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-05-13 16:37:15 +00:00
Martin Smith
98cb9275d0 doc: clang reported two fake declarations to be the same
These declarations are provided for qdoc, but clang says they are the same:
template <typename Functor>
QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename PointerToMemberFunction>
QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);

clang accepts this one, but is it ok for the documentation?
template <typename MemberFunction>
QMetaObject::Connection callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection);

Change-Id: I9d63b1bccfa8d73dbc17ab70c4415eb7891fbbe2
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-05-13 11:11:42 +00:00
Tor Arne Vestbø
3976df2805 macOS: Track screens via Quartz Display Services instead of NSScreen
Using NSScreen as the basis for tracking screens is not recommended, as
the list of screens can be added, removed, or dynamically reconfigured at
any time, and the NSScreen instance, or index in the NSScreen.screens array
may not be stable.

Quartz Display Services on the other hand tracks displays via a unique
display ID, which typically remains constant until the machine is restarted.
The lower level API also gives us earlier callbacks about screen changes
than the corresponding NSApplicationDidChangeScreenParametersNotification
does. By reacting to screen changes _before_ AppKit does, we can remove
workarounds for receiving window move and screen change notifications
before the screen was actually visibly reconfigured.

The new approach also handles changes to the primary screen, which
can happen if the user moves the menu bar in the macOS display
arrangement pane.

The device pixel ratio of the screen has been made into a cached
property, like all the other properties of QCocoaScreen. This is
more consistent, and allows us to qDebug the screen even when it
has been removed and we no longer have access to resolve the
properties from the associated Quarts display.

Change-Id: I2d86c7629ed3bf5fb8c77f174712633752ae4079
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-13 10:46:53 +00:00
Frederik Gladhorn
3da9d8a4fe Make sure QAccessibleTableCell is valid before reference
There are some cases (model resets in weird positions) where we would
crash due to accessing invalid model indices.

Fixes: QTBUG-61416
Fixes: QTBUG-71608
Change-Id: Ibfedcbd921a3145f3e1596ac424a77f2319a5c46
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-13 10:07:30 +00:00
Liang Qi
388fe97f2a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
2019-05-13 08:04:58 +02:00
Qt Forward Merge Bot
f8212b87d9 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
2019-05-12 01:00:08 +02:00
Giuseppe D'Angelo
a0c4b6f345 QSharedPointer/QWeakPointer: fix swap()
Do not specialize std::swap, just add swap in Qt's namespace.
Also add swap() for QWeakPointer, and sprinkle noexcept.

Change-Id: Ifb06c214f1865d42f3f2cddf5f980aede6bde185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-11 20:23:10 +00:00
Laszlo Agocs
45aa3c73f7 hellogles3: Request core profile context
...instead of compatibility, in order to play nice with systems
that have no compatibility profile support (macOS). Instancing
needs OpenGL 3.x so sticking with 2.x contexts is not an option.

The example looks fully compatible with core profile so its
functionality should not change.

Change-Id: If0d554a6208973aa8a4fb86757e246d170cd0e71
Fixes: QTBUG-75680
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-11 12:01:53 +00:00
Tor Arne Vestbø
a9246c7132 Reset QWidget's winId when backing window surface is destroyed
We already reset it though e.g. QWidget::destroy, but if the backing
window is destroyed spontaneously or via another API we need to catch
that and send a WinIdChange event so clients who pulled out the original
winId will not think the pointer is still valid

Change-Id: I8556940ee871e81a51f73daeb2064f95bf41371c
Fixes: QTBUG-69289
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-11 12:01:40 +00:00
Giuseppe D'Angelo
41aa78856e QSharedPointer: fix threadsafety docs
Try and explain better the situation around QSharedPointer:
it's reentrant, not thread safe.

Change-Id: Ief9d28be8ea3fbaa6014cb6b999626db1bab52ca
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-11 10:16:40 +00:00
Ulf Hermann
1a0df46b98 Add qurlquery.cpp to the bootstrap library
This amends change 587bdd144b. As we have
added QUrl we should also add QUrlQuery because the former uses the
latter.

Change-Id: Iab3b0cb91ef65e673c6c2db4c30fad5660ff30fd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-11 08:23:44 +00:00
Vova Mshanetskiy
341c910688 Android: Fix wrong height of text editor context menu in some locales
Combined width of all four buttons (cut, copy, paste, select all) is
greater than width of the screen in some locales and/or on some devices.
This was causing width of the last button to be set to zero and height
of the whole popup to grow too much due to word wrapping in the last
button. The context menu used to look something like this then:

  Cut    Copy    Paste    S
                          e
                          l
                          e
                          c
                          t

                          a
                          l
                          l

This commit disables word wrapping and enables text ellipsizing for
button labels. This fixes height of the popup. In the long term though
Qt will probably have to implement an overflow button like in Android's
built context menu.

The linked bug report contains before and after screenshots.

Fixes: QTBUG-72933
Change-Id: I8e270dbf8ca66f99748cdc531a77e11a5ab11c2b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-05-10 20:24:07 +00:00
Vova Mshanetskiy
c905ff4392 QAndroidInputContext: Fix start value of Cursor attribute in longPress()
The value of start for a QInputMethodEvent::Cursor attribute must be
specified relative to the start of preedit string, but longPress() was
specifying it relative to start of surrounding text. This was causing
QQuickTextInput to return wrong values of cursor and anchor rectangles.
And this was causing invalid positioning of cursor selection handles
after a long press.

Change-Id: Ief67e86dd90b09ebf2ba191a2b0311ff803afdd9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-05-10 20:23:55 +00:00
Allan Sandfeld Jensen
4d2ee7f358 Add unvectorized fallback in case FP exceptions are not masked
If an application enables FP exceptions our FP-based unpremul will
raise the INVALID exception. Since disabling them locally might be slow
just take a slow path when detected.

Fixes: QTBUG-75592
Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 19:35:10 +00:00
Ville Voutilainen
2a1651cc16 Make moc grok binary literals with digit separators
Task-number: QTBUG-75656
Change-Id: I6011ef2fb07497cc2a055d6828a1b6356927c281
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-10 18:34:02 +00:00
Tor Arne Vestbø
c99678fb19 macOS: Deliver geometry changes when content view changes frame
This was disabled in 9f22ac0aa0 under the
assumption that the windowDidResize callback was sufficient, but in the
situation when macOS native tabs are enabled, AppKit will report the
wrong geometry for the first windowDidResize callback when a new tab
is created.

We could potentially remove the geometry change in windowDidResize,
as the viewDidChangeFrame callback should be enough for content
views, but this is something that needs more investigation.

Change-Id: I85045507da1a01b4a906e6f88301f3321c660943
Fixes: QTBUG-75482
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-10 17:15:29 +00:00
Tor Arne Vestbø
123053bba8 macOS: Don't clip menu item drawing to bounding rect when using CoreText
The bounding rect was computed based on the font metrics HarfBuzz gave
us, but those may not be 1:1 with what CoreText ends up using. When that
happens, drawInRect: will line-break the last word, which makes it fall
completely outside of the single line bounding rect. This is not a good
failure mode, so we prefer to draw the text at a point instead, allowing
the resulting text to draw slightly outside of the bounding rect. This
is preferable to adding a random padding to the width and hoping it will
be enough to solve the problem.

Change-Id: Ifa58a33bd9fad689ed4ee947327b7079f3c1b61d
Fixes: QTBUG-74565
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-10 17:15:27 +00:00
Keith Kyzivat
b7edc811ec Work around VS2015/17 bitset + qfloat16.h compiler bug
[ChangeLog][QtCore][Global] Added the QT_NO_FLOAT16_OPERATORS macro in
order to work around a Microsoft <= VS2017 compiler bug that is
exposed when using std::bitset along with any Qt header that includes
<qfloat16.h>.

This is fixed in MSVC 2019[1], but the workaround is needed for
earlier versions.

In this case, cl.exe fails with
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): error C2666: 'operator /': 10 overloads have similar conversions
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(364): note: could be 'const QSizeF operator /(const QSizeF &,qreal)'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qsize.h(194): note: or       'const QSize operator /(const QSize &,qreal)'
    c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(427): note: or       'QMarginsF operator /(const QMarginsF &,qreal)'
    c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(213): note: or       'QMargins operator /(const QMargins &,qreal)'
    c:\qt\5.12.0\msvc2017_64\include\qtcore\qmargins.h(207): note: or       'QMargins operator /(const QMargins &,int)'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(int,qfloat16) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(205): note: or       'double operator /(qfloat16,int) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(float,qfloat16) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(195): note: or       'float operator /(qfloat16,float) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(double,qfloat16) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(194): note: or       'double operator /(qfloat16,double) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(long double,qfloat16) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(193): note: or       'long double operator /(qfloat16,long double) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qfloat16.h(176): note: or       'qfloat16 operator /(qfloat16,qfloat16) noexcept'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(402): note: or       'const QPointF operator /(const QPointF &,qreal)'
    C:\Qt\5.12.0\msvc2017_64\include\QtCore/qpoint.h(206): note: or       'const QPoint operator /(const QPoint &,qreal)'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: or       'built-in C++ operator/(::size_t, )'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(270): note: while trying to match the argument list '(::size_t, )'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(266): note: while compiling class template member function 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)'
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\include\bitset(39): note: see reference to function template instantiation 'std::bitset<8> &std::bitset<8>::set(::size_t,bool)' being compiled
    ..\Qt5.12.0-C2666\main.cpp(7): note: see reference to class template instantiation 'std::bitset<8>' being compiled

Invoke this workaround by defining the macro QT_NO_FLOAT16_OPERATORS
in user code prior to the inclusion of Qt includes in a translation
unit.

Arithmetic operators from qfloat16 will then not be present in that
compilation unit.

[1] https://developercommunity.visualstudio.com/content/problem/406329/compiler-error-c2666-when-using-stdbitset-and-cust.html

Task-number: QTBUG-72073
Change-Id: I58f8400bf933ad781d4213731695e20e0c482166
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-05-10 16:29:50 +00:00
Lars Knoll
9dc1edb314 Deprecate QQueue::swap(i, j)
QList::swapItemsAt() is the replacement.

Change-Id: Id0f194f9b63fd34c612f15e7952c33564f90120c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-10 15:27:48 +00:00
Edward Welbourne
0fb30652b5 Add support for /etc/TZ as default value for $TZ
This is used by uClibc, at least.

[ChangeLog][QtCore][QTimeZone] The TZDB back-end now recognizes the
contents of /etc/TZ as a fall-back for $TZ (as used by uClibc).

Fixes: QTBUG-75565
Change-Id: I3067e2d023cf30a85633575b5d7dc0ee3ec36927
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 14:17:22 +00:00
Edward Welbourne
ab2655c559 Support POSIX rules as $TZ values
The TZ environment variable can validly contain a POSIX rule, rather
than an IANA ID, as described here:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03

However, if TZ were set to such a value, leading to it being used as
systemTimeZoneId(), it would be passed to QTzTimeZonePrivate::init(),
which is a no-op unless it manages to open a zoneinfo/ file with the
given ianaId as name.  When the environment variable doesn't name a
zoneinfo/ file, we would thus get an invalid time-zone.  We can,
instead, check whether the ianaId looks like a valid POSIX rule and,
if it does, use it as m_posixRule, enabling us to correctly handle
this case.

Tweak parsing of POSIX rules so that a zone using name "UTC" or "GMT"
with an offset other than 0 will be rejected as invalid.  This avoids
parsing a zone name such as "GMT+17" or "UTC+00:01" as a POSIX rule,
where it should be understood as an offset from UTC (and only certain
well-established offsets are supported).

Added two test-cases to tst_QTimeZone::tzTest() for validity of a
POSIX zone value - a simple one constructed during discussion of the
bug, the other taken from an example in:
http://leaf.sourceforge.net/doc/buci-tz3.html

Task-number: QTBUG-75565
Change-Id: Ia5cb1cc56b13b0f6b56258e48be98d04d909e32a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 14:17:01 +00:00
Mårten Nordheim
b29cc512f8 Granularize blacklist of qsslsocket for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: I79917ca9c40e1df2dab46bb54cc0a2bd4a1a4621
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:19 +00:00
Mårten Nordheim
fa6859c119 Granularize blacklist of qhttpsocketengine for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: I3676d9cb5f9167039c3d1963521fa85785210f7c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:18 +00:00
Mårten Nordheim
1503265eb1 Granularize blacklist of platformsocketengine for Windows
Using the information from grafana we can unblacklist all the things
which are consistently passing.

Change-Id: If04963cd5f9a53ee2293d596f9111ebcb1add532
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-05-10 13:09:17 +00:00
Timur Pocheptsov
8ac77123e2 QNetworkStatusMonitor - make it always enabled on Darwin
Also undo changes in setNetworkAccessible and setConfiguration
since they introduced a change in behavior, which results
in auto-test failing.

Change-Id: I5d74c47338bff8f964ba2e27256902c79303e00f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-10 10:45:43 +00:00
Tor Arne Vestbø
3159845c9c macOS: Implement QCALayerBackingStore::toImage()
It's not part of the QBackingStore API, but clients such as the Qt Quick
software renderer access it through the platform backingstore, to grab
the window.

Change-Id: I203484ce13a5f8fb6815d27ab07f874fa9d16b8c
Fixes: QTBUG-75467
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-10 09:41:41 +00:00
Anton Kudryavtsev
681bd76e67 QStringView, QLatin1String: add indexOf methods
[ChangeLog][QtCore][QLatin1String] Added indexOf().

[ChangeLog][QtCore][QStringView] Added indexOf().

Change-Id: I9f56e5b40030e39b29e50914a46beb58013b537b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 07:16:42 +00:00
Yulong Bai
daaa557259 QTypeModuleInfo: fix clang '-wconstant-logical-operand' warnings
Clang generates a 'constant-logical-operand' warning when it finds
a non-boolean constant in a logical operation. Just make
the enum's base type as bool here to suppress the warning.

Change-Id: Ie53f53fa54f57535f89598bdabc4d893f6a1cc32
Fixes: QTBUG-75737
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-09 17:56:22 +00:00
Liang Qi
591116490c Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-05-09 13:06:22 +00:00
Qt Forward Merge Bot
e56d3b03ed Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale_data_p.h
        (Regenerated by running the scripts in util/local_database/)
	src/gui/opengl/qopengltextureuploader.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
2019-05-09 13:06:11 +00:00
Laszlo Agocs
64a2dc3962 Add missing backslash to kmsconvenience.pro
Change-Id: I3519447af657bdbb7304aca272de416104dca0f9
Fixes: QTBUG-75730
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-05-09 12:55:06 +00:00
Jan Arve Saether
2b7edd0534 Fix bug with QLayout::replaceWidget(a, a)
It should effectively leave the layout untouched

Fixes: QTBUG-69706
Change-Id: I4d8232895bf1d1ae0d1b73156ef6ec6001d8968a
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2019-05-09 12:01:38 +00:00
Joerg Bornemann
a12b6e7bf6 Fix CMake file generation for debug libs on macOS
CMAKE_QT_STEM already contains the _debug suffix.
Do not add it again.

This amends commit bb8a3dfc.

Fixes: QTBUG-75520
Change-Id: I6c311f0913ea83fcf299a21a0ee1f28c3861371f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-09 07:50:32 +00:00
Edward Welbourne
17c44479aa Update CLDR version in attribution
This is a follow-up to 43abe86e.

Change-Id: I2442304c9c79bcb1932fb173b8d993a242d79f4b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2019-05-09 07:40:06 +00:00
Eirik Aavitsland
3d8ed3ba96 Fix: style sheet styling of background of triangular QTabWidget tabs
The triangular tab shape is not reproducible with setting style border
options, so it should be painted with the usual code path, also when a
custom background has been set.

Fixes: QTBUG-72096
Change-Id: I7bc1c0579386b8ea7266ce6456534c2519d9addf
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-05-09 06:47:30 +00:00
Friedemann Kleint
fa890c4686 Windows QPA: Improve debug messages
Include screen and MINMAXINFO values in the message about not being able to
set the geometry.

Suppress output of some window finding functions unless verbose.

Change-Id: Iaaae59ecb302438b3444735067d018c77d2af162
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-09 06:13:27 +00:00
Martin Storsjö
827b7afba7 ANGLE: Backport fix for compilation on mingw/64bit with clang
This backports the following upstream fix from angle:
63cc351fba

Change-Id: Id80dba62c69f3505eb836f758367b4bf054b1fd5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-05-08 21:21:41 +00:00
Shawn Rutledge
7dd71e8125 Markdown: blockquotes, code blocks, and generalized nesting
Can now detect nested quotes and code blocks inside quotes, and can
rewrite the markdown too.

QTextHtmlParser sets hard-coded left and right margins, so we need to do
the same to be able to read HTML and write markdown, or vice-versa,
and to ensure that all views (QTextEdit, QTextBrowser, QML Text etc.)
will render it with margins.  But now we add a semantic memory too:
BlockQuoteLevel is similar to HeadingLevel, which was added in
310daae539 to preserve H1..H6 heading
levels, because detecting it via font size didn't make sense in
QTextMarkdownWriter.  Likewise detecting quote level by its margins
didn't make sense; markdown supports nesting quotes; and indenting
nested quotes via 40 pixels may be a bit too much, so we should consider
it subject to change (and perhaps be able to change it via CSS later on).
Since we're adding BlockQuoteLevel and depending on it in QTextMarkdownWriter,
it's necessary to set it in QTextHtmlParser to enable HTML->markdown
conversion.  (But so far, nested blockquotes in HTML are not supported.)

Quotes (and nested quotes) can contain indented code blocks, but it seems
the reverse is not true (according to https://spec.commonmark.org/0.29/#example-201 )

Quotes can contain fenced code blocks.

Quotes can contain lists.  Nested lists can be interrupted with
nested code blocks and nested quotes.

So far the writer assumes all code blocks are the indented type.
It will be necessary to add another attribute to remember whether the
code block is indented or fenced (assuming that's necessary).
Fenced code blocks would work better for writing inside block quotes
and list items because the fence is less ambiguous than the indent.

Postponing cursor->insertBlock() as long as possible helps with nesting.
cursor->insertBlock() needs to be done "just in time" before inserting
text that will go in the block.  The block and char formats aren't
necessarily known until that time.  When a nested block (such as a
nested quote) ends, the context reverts to the previous block format,
which then needs to be re-determined and set before we insert text
into the outer block; but if no text will be inserted, no new block
is necessary.  But we can't use QTextBlockFormat itself as storage,
because for some reason bullets become very "sticky" and it becomes
impossible to have plain continuation paragraphs inside list items:
they all get bullets.  Somehow QTextBlockFormat remembers, if we copy it.
But we can create a new one each time and it's OK.

Change-Id: Icd0529eb90d2b6a3cb57f0104bf78a7be81ede52
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:53 +00:00
Shawn Rutledge
82b26444a4 Change QTextMarkdownWriter to pass by const pointer and QAIM
- QObjects are always passed by pointer not by reference, by convention
- writeTable() takes QAIM rather than QATM to make testing via
  QStandardItemModel possible in the future

Change-Id: I5bc6b8cd9709da4fb5d57d98fa22e0cb34360944
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:44 +00:00
Shawn Rutledge
76716c4a9a Markdown: deal with horizontal rules (thematic breaks)
Change-Id: I14d4bcfe1a6c3bd87d1328f0abb81b2138545e4e
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:37 +00:00
Shawn Rutledge
040dd7fe26 Markdown: fix several issues with lists and continuations
Importer fixes:
- the first list item after a heading doesn't keep the heading font
- the first text fragment after a bullet is the bullet text, not a
  separate paragraph
- detect continuation lines and append to the list item text
- detect continuation paragraphs and indent them properly
- indent nested list items properly
- add a test for QTextMarkdownImporter
Writer fixes:
- after bullet items, continuation lines and paragraphs are indented
- indentation of continuations isn't affected by checkboxes
- add extra newlines between list items in "loose" lists
- avoid writing triple newlines
- enhance the test for QTextMarkdownWriter

Change-Id: Ib1dda514832f6dc0cdad177aa9a423a7038ac8c6
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:28 +00:00
Shawn Rutledge
6a58a68ae3 Remove 3rdparty include from QTextMarkdownImporter header file
It's a private header; but to be able to use it in a test, it has to
be as clean as a public header.

Change-Id: I868372406e62acc24051a6523fee89bb911a61f9
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-05-08 20:28:20 +00:00
Friedemann Kleint
c1721cc859 uic/Python: Generate empty strings as "" instead of QString()
Task-number: PYSIDE-797
Change-Id: I4ce12ba01318e5ed7e88178dfd2450d9fe78c708
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2019-05-08 19:29:50 +00:00
Sergio Martins
9444416a46 Define Q_OS_WINDOWS, make it an alias to Q_OS_WIN
As seen in several occasions, both in user code and in Qt proper,
people make these mistakes. What makes it harder to spot is that it doesn't
look like a typo, and feels natural (natural as Q_OS_LINUX instead of Q_OS_LIN feels).

There's been a P1 in qtdeclarative/ and currently there's a Q_OS_WINDOWS usage
in qtwebengine.

This is a recurring problem, no matter how much people test and review
these errors will happen, so the alias is justified.

Change-Id: If6943b52e17f0c8b238c36bb1f7834802123f12a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-08 17:22:01 +00:00
Konstantin Shegunov
c6bee8e4b2 Fix integer overflows in QDeadlineTimer
If the deadline is far in the future, the conversions to nanoseconds
or internal arithmetic may overflow and give an invalid object, thus
the deadline may end up in the past. Added a test to the testlib
selftest for sleep.

[ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows
leading to immediate timeouts.

Task-number: QTBUG-69750
Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-08 17:19:44 +00:00