Commit Graph

8764 Commits

Author SHA1 Message Date
Edward Welbourne
dd5e7f1a52 Use a more robust test for absolute paths in QDir
Its filePath() and absoluteFilePath() don't trust its own
isAbsolute(), due to some infelicities on MS-Win; and kludged round a
consequent problem with resource paths; but other virtual file systems
weren't catered for.  Replace the convoluted test there with a static
bool function (so that future kludges in this area shall only need to
edit one place; and can document why they're needed) and use a more
robust test that handles all virtual file systems (by asking
QFileInfo) but falls back to QFileSystemEntry to work round the known
infelicities on MS-Win.  Add regression test for asset library paths
issue on iOS.  Ammends 27f1f84c1c.

Moved a couple of local variables to after the early return, since it
doesn't need them, in the process.

Task-number: QTBUG-70237
Change-Id: Ib3954826df40ccf816beebe5c3751497e3bf6433
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-01-13 18:18:10 +00:00
Tor Arne Vestbø
68511d41d5 qWaitFor: Prevent being stuck in QCoreApplication::processEvents
When using the overload of QCoreApplication::processEvents that takes a
maxtime argument, the function will keep processing events until there
are no more events, or until it times out.

The problem is that the function doesn't distinguish between events that
were on the event queue when the function was called, and events generated
by processing events as part of its own execution. If for example a widget
calls update() in its paintEvent, the function will spin for the entire
duration of maxtime.

That doesn't work for qWaitFor, where we need to check the predicate
between each pass, so we use the overload of processEvents that doesn't
take a maxtime. That's fine, as we have our own timeout logic.

Change-Id: I9738d7d0187c36d4a5ddfcd3fd075b0bd84583c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-09 18:10:54 +00:00
Tony Sarajärvi
8b1a23ed32 Blacklist a flaky qtableview function in WinRT
Task-number: QTBUG-72853
Change-Id: Iaf2b25712b571a3ce73387cb3d2e70d427808364
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-01-08 11:58:41 +00:00
Liang Qi
0e96b5fe48 Merge remote-tracking branch 'origin/5.12' into 5.12.1
Conflicts:
	src/widgets/kernel/qtooltip.cpp

Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
2019-01-08 09:34:24 +01:00
Christian Ehrlicher
52e0d9e23c Drag'n'Drop: fix dnd when dragMoveEvent() is not implemented
The refactoring of dnd with f8944a7f07
added a regression which results in a need to reimplement
dragMoveEvent() on the drop side. Before this change it was possible to
accept the dnd in dragEnterEvent() without again accepting it in
dragMoveEvent().
Fix it in a similar way it's done in
QGuiApplicationPrivate::processDrag() by prefilling the first simulated
QDragMoveEvent with the values from the previous QDragEnterEvent before
it is sent to the drop receiver.

Fixes: QTBUG-72844
Change-Id: I1300dd02b7f1d9dcd44ecefa8335f92ad6c6cafa
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-01-07 10:50:18 +00:00
Jędrzej Nowacki
ecdccce8e4 Fix warnings about uninitialized variables
qtbase/src/corelib/kernel/qmetatype.cpp: In static member function ‘static void QMetaType::destroy(int, void*)’:
qtbase/src/corelib/kernel/qmetatype.cpp:2599:27: error: ‘info.QMetaType::m_destructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (m_typedDestructor && !m_destructor)
         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_destructor’ was declared here
     QMetaType info(type);
               ^~~~
qtbase/src/corelib/kernel/qmetatype.cpp:2600:26: error: ‘info.QMetaType::m_typedDestructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         m_typedDestructor(m_typeId, data);
         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_typedDestructor’ was declared here
     QMetaType info(type);
               ^~~~

The extended (not inlined) function may be called on a half
initialized invalid instance.

Change-Id: I26d677a8ad2bd0c5846233f06393e774d377936d
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-01-06 10:14:36 +00:00
Oswald Buddenhagen
f89ac0101a qmake: add $$read_registry() function
Change-Id: I7f9f17e0f44c273e4754d1decc92a8594cad8658
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-01-05 20:33:07 +00:00
Tony Sarajärvi
8c2ca29045 Revert "Blacklist tst_QTimer::basic_chrono on macOS"
Incorrectly blacklisted.

This reverts commit 40a7c57ba9.

Task-number: QTBUG-61013
Change-Id: I7d9dc4a4b1c8d7ff77ab75c61027b908ffb74552
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-01-04 09:45:41 +00:00
Vitaly Fanaskov
f7dc6042cb Remove dead code
Task-number: QTBUG-44131
Change-Id: Ic092f2be5855840d6467560159c12f3c5aa36344
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-01-04 09:42:14 +00:00
Vitaly Fanaskov
d8bbb5ee0e Respect roles of buttons added to QMessageBox
When a button added to QMessageBox has AcceptRole or YesRole, the signal
accepted() will be emitted upon click on the button. If the button has
RejectRole or NoRole, the signal rejected() will be emitted upon click
on the button. If a button has a different role, neither accepted() nor
rejected() will be emitted. This works for both standard and custom
buttons.
The signal finished() with result code will be sent regardless of a
clicked button role.
Also added documentation strings for some methods of private classes in
order to have better tooltips in IDE(s).

Task-number: QTBUG-44131
Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-01-03 18:38:12 +00:00
Luca Beldi
ff835a5030 Fix QStringListModel::setData to check for actual changes
QStringListModel::setData documentation states that
"The dataChanged() signal is emitted if the item is changed."
This patch actually respects the doc. setData will check that the data
actually changed before sending the dataChanged signal.

[ChangeLog][QtCore][QStringListModel] setData will now emit the
dataChanged() signal only if the string set is different from
the one already contained in the model

Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f
Reviewed-by: David Faure <david.faure@kdab.com>
2018-12-24 08:07:36 +00:00
Milla Pohjanheimo
4a0ed282cf Add binary compatibility files for 5.12 for QtBase
Binary compatibility files added.

Change-Id: I2543902fb7ac97270db7fb79ae09641898cc8ba4
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-21 19:42:57 +00:00
Eskil Abrahamsen Blomfeldt
e6880e7cd1 Fix text shifting vertically when elided
When eliding text we would check for the existence of the ellipsis
character and fall back to using the dot if it was not available.
However, when font merging was in use, we would also use ellipsis
from a fallback font if available. This could cause the metrics
of the text to increase if the fallback font had larger metrics,
and the result was that text could shift when elided.

It is better to prefer the dot from the current font than to use
the ellipsis from a fallback, so we only use the ellipsis if
it is in the main font.

[ChangeLog][QtGui][Text] Fixed a bug where eliding text could
change the height of its bounding rectangle for certain fonts.

Fixes: QTBUG-72553
Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-21 10:27:12 +00:00
Christian Ehrlicher
7863be3115 QTableView: Fix keyboard navigation with disabled rows
The keyboard navigation with MovePageUp/Down and MoveEnd did not honor
disabled cells in all cases which lead to inconsistencies in the
navigation (esp. since MoveHome does honor them correctly).
Therefore make sure that all four move operations work consistent by
refactoring the code to use common functions.

Fixes: QTBUG-72400
Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-18 05:33:52 +00:00
Samuel Gaist
a5eabac96d moc: add support for C++11 enum struct
C++11 added the new enum class key as well as enum struct. While the
former is likely the most known and used, the later can be used in the
same contexts and with the same effects.

Currently moc doesn't parse enum struct while it does for enum class.
This patch fixes this.

[ChangeLog][moc] moc now parses enum struct the same way as enum class
therefore that keyword can be used with the Q_ENUM macro as well as
Q_FLAG and Q_DECLARE_FLAGS.

Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-12-15 13:24:29 +00:00
Samuel Gaist
649ee12aba QRegularExpression: anchor wildcard pattern
The current implementation of wildcardToRegularExpression doesn't
anchor the pattern which makes it not narrow enough for globbing
patterns. This patch fixes that by applying anchoredPattern before
returning the wildcard pattern.

[ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression
method now returns a properly anchored pattern.

Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5
Fixes: QTBUG-72539
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-15 13:24:16 +00:00
Mitch Curtis
32fd79a20f QAbstractSlider: fix invertedControls having no effect for left/right keys
There was a comment in the code that said:

// It seems we need to use invertedAppearance for Left and right, otherwise, things look weird.

It's not clear what that was referring to, but in its current state,
a slider with invertedControls set to true will not behave as expected:
pressing the left arrow key will decrease its value instead of increasing it,
and vice versa for the right arrow key.

As stated in the documentation (and by its name), invertedAppearance only
controls the appearance of the slider, and not the effect of key events.

Remove the comment and use invertedControls instead.

Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf
Fixes: QTBUG-25988
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 10:46:22 +00:00
Mitch Curtis
35602d75d3 Refactor tst_QAbstractSlider::keyPressed()
Don't do several tests at once in the test function. Instead, move
the extra tests to the data function. This makes it possible to easily
add a self-contained test (i.e row) for an upcoming fix.

Task-number: QTBUG-25988
Change-Id: I65c8d7620f01107f8f59c96896b1a641d97f5fdc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-12-13 10:46:18 +00:00
Joni Poikelin
eaf4438b35 Make url normalization closer to common browser behavior
Firefox, Chrome and various http libraries normalize /./ and /../ from
urls, but retain multiple adjacent slashes as is. Qt removes
duplicated slashes which makes it impossible to access some web
resources that rely on those.

Fixes: QTBUG-71973
Change-Id: Ie18ae6ad3264acb252fcd87a754726a8c546e5ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-13 05:23:12 +00:00
Friedemann Kleint
d1cafa3eba qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps with low depths
Insufficient memory was allocated when asking GetDIBits() to convert to 32bit.
Fix allocation size and use a QScopedArrayPointer.

Fixes: QTBUG-72343
Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-12 16:08:10 +00:00
Vitaly Fanaskov
ceebad9bd2 tst_QMessageBox: Modernize and simplify code
Changed 0 to nullptr, used more C++-style casts, simplified some
code for searching a button, and changed foreach to range-based for
loop.

Task-number: QTBUG-44131
Change-Id: I211b12751b0e2591d1d14294c31b51d52bb4e3f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2018-12-12 13:58:16 +00:00
Edward Welbourne
ab448f731e Handle QCollator with locale C by delegating to QString
Previously, the C locale was treated as English because each back-end
takes the locale's bcp47Name(), which maps C to en. However, the C
locale has its own rules; which QString helpfully implements; so we
can delegate to it in this case. Extended this to sort keys, where
possible. Clean up existing implementations in the process.

Extended tst_QCollator::compare() with some cases to check this. That
required wrapping the test's calls to collator.compare() in a sign
canonicalizer, since it can return any -ve for < or +ve for >, not
just -1 and +1 for these cases (and it'd be rash to hard-code specific
negative and positive values, as they may vary between backends).

[ChangeLog][QtCore][QCollator] Added support for collation in the C
locale, albeit this is only well-defined for ASCII. Collation sort
keys remain unsupported on Darwin.

Fixes: QTBUG-58621
Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-11 19:05:07 +00:00
Allan Sandfeld Jensen
9fbce8d5cb Avoid crash in blitting or fast draw when QPointF is too big
Change-Id: I88182d5d95fda15d33836f16dee78167685b3765
Fixes: QTBUG-72392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-12-11 18:32:53 +00:00
Shawn Rutledge
c4ee125891 Set QScroller's parent to its widget, for memory management
If the widget to which the scroller was assigned is deleted, the
QScroller ought to be deleted too, to avoid filtering events and then
following a dangling pointer while trying to react.

Fixes: QTBUG-71232
Change-Id: I62680df8d84fb630df1bd8c482df099989457542
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
2018-12-08 07:18:15 +00:00
Thiago Macieira
962bded90f Fix QSettings parsing of spaces after comment lines
[ChangeLog][QtCore][QSettings] Fixed QSettings parsing of blank spaces
after comment lines in INI-style configuration files.

Fixes: QTBUG-72007
Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b219f3b5c0a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-12-07 18:53:34 +00:00
Edward Welbourne
4ee59cf96d Remove one out-of-date comment, refine another that was imprecise
The former is a follow-up to c17563eca8.

Change-Id: I3cd41e6e38f740de67605f785a804ffd879b9e67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-12-07 15:59:38 +00:00
Lars Knoll
86aabb500c Add lancelot tests to verify vertical alignment of inline images
Adds a test case for 199f9c5448.

Task-number: QTBUG-59310
Change-Id: Iee26f8bc21884da36471935f64524b62c3f79ff4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-12-03 07:52:55 +00:00
Mårten Nordheim
17ced070fd Read font selection flags and use them when querying for metrics
Certain fonts with multiple styles have the same family name. When
loading these as application fonts we were not specific enough when
querying for the text metrics. This meant that e.g. the bold version in
a font family would get the metrics of the regular one.

Fixes: QTBUG-67273
Change-Id: Ic988d62cddde0a1f77ddcaf2891cadc21c9b31e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-11-30 16:15:03 +00:00
Ville Voutilainen
c0dd445564 Fix a nullptr compile error with gcc 4.8
template argument deduction/substitution failed:
qtbase/tests/auto/corelib/kernel/qobject/tst_qobject.cpp:6756:71: note:   mismatched types ‘const typename QtPrivate::FunctionPointer<Func2>::Object*’ and ‘std::nullptr_t’

Change-Id: I8e7872457d1fc30c4b29e96c16091915264f9bce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-30 14:50:00 +00:00
Ulf Hermann
042707a633 Avoid invalid qmake code in macOS-specific pluginloader test
You cannot manipulate variables in custom target dependencies, so the
following code was invalid:

i386_d.depends = EXPORT_VALID_ARCHS=i386

In order to still build the fat binary, we split the project in four,
one for each architecture, plus one to create the final package.

Change-Id: If08cf54e2e4098a7e10df41b7ea8d2bf699f58be
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-11-30 14:47:29 +00:00
Richard Moe Gustavsen
f1812aad89 QFocusFrame: protect it from being moved around by accident
If a focus frame is set around a widget that exist inside a
QAbstractItemView, both the focus frame and the widget will
be scrolled when the table is scrolled (since the focus frame
is a child of the view). The result is that after the widget
has been scrolled (which will move the focus frame to the
correct position as well), the focus frame will be scrolled
next, and therefore away from the widget.

This patch will catch this case by always adjusting the
focus frame position when someone tries to move it. Trying
to move the focus frame away from the widget it tracks
will anyway be flaky.

Fixes: QTBUG-63877
Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-27 14:59:52 +00:00
Shawn Rutledge
a5e32f9375 Re-enable the QScroller tests on macOS
Maybe they aren't flaky anymore... let's find out.

Task-number: QTBUG-29950
Task-number: QTBUG-30133
Change-Id: I1a2a3ef7facac5b6e59588d7c6b1b28b40a788ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-27 14:57:35 +00:00
Allan Sandfeld Jensen
d1f924bbce Fix tst_QStyleSheetStyle crash on uncommon multi-screen setup
It would crash if there is no screen at 0,0.

Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-27 14:46:08 +00:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Vitaly Fanaskov
ba13c6c08f Fix calculation of text margin if line edit contains side widgets
The previous implementation leads to infinite chain of showing/hidden
line edit under circumstances described in QTBUG-54676. We basically got
the situation when size hint were calculated differently depending on
the line edit visibility state. In this case toolbar layout have to
show/hide extension button and line edit a lot of times and can never
leave this "loop" (please note, that the chain is much more complicated
in reality):
Resize toolbar -> Set layout geometry -> Size is OK to display line edit
-> Set layout geometry -> Hide extension button -> Set layout geometry
(wrong size is calculated here, so "run out of space") -> Hide line edit
-> Set layout geometry -> Show extension button -> Set layout geometry -
> Size is OK to display line edit ... And we're in the "loop"

Clear button is hidden if there is no text in a line edit.
In the previous implementation, the button was always visible, only
opacity was changing in order to "hide" the button. It resulted to
incorrect size hints (regular and minimum).
In the current implementation the button is really hidden/shown, and
size hints calculated correctly.
Also updated unit test for line edit.

Remove code duplication in functions for calculation text margin

Fixes: QTBUG-54676
Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-11-26 16:03:33 +00:00
Sami Nurmenniemi
71bd06d516 Make developer build tests pass for boot2qt
Some tests were fixed and others were skipped/blacklisted.

Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-11-26 07:06:59 +00:00
Edward Welbourne
d8b401959f Recognize E along with e as exponent character in asciiToDouble
Fixed a misguided condition in the check for bogus texts in the sscanf
branch of the decoder; it checked for 'e' but neglected 'E', which is
just as valid.

Change-Id: I9236c76faea000c92df641930e401bce445e06c8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:33 +00:00
Edward Welbourne
ce159d1a3e Fix toFloat()s between float and double ranges and document
Revised some toFloat()s to be consistent with the matching
toDouble()s; previously, they would return infinity if toDouble() did
but return 0 if toDouble() got a finite value outside float's range.
That also applied to values that underflowed float's range, succeeding
and returning 0 as long as they were within double's range but failing
if toDouble() underflowed.  Now float-underflow also fails.  Amended
their documentation to reflect this more consistent reality.
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toFloat] QString, QByteArray and QLocale returned
an infinity on double-overflow (since 5.7) but returned 0 on a finite
double outside float's range, while setting ok to false; this was at
odds with their documented behavior of returning 0 on any failure.
They also succeeded, returning zero, on underflow of float's range,
unless double underflowed, where they failed.  Changed the handling of
values outside float's range to match that of values outside double's
range: fail, returning an infinity on overflow or zero on underflow.
The documentation now reflects the revised behavior, which matches
toDouble().

Change-Id: Ia168bcacf7def0df924840d45d8edc5f850449d6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:24 +00:00
Edward Welbourne
a992367403 Change documentation of some toDouble()s to reflect reality
They actually return infinity if conversion overflows, while still
setting ok to false; they were documented to return 0 on failure, with
no mention of this special handling of overflow.  Documented reality
rather than changing the behavior.  Gave underflow as an example of
failure other than overflow (toDouble()s do indeed fail on it).
Added some tests of out-of-range values, infinities and NaNs.

[ChangeLog][QtCore][toDouble] QString, QByteArray and QLocale return
an infinity on overflow (since 5.7), while setting ok to false; this
was at odds with their documented behavior of returning 0 on failure.
The documentation now reflects the actual behavior.

Fixes: QTBUG-71256
Change-Id: I8d7e80ba1f06091cf0f1480c341553381103703b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:05:06 +00:00
Edward Welbourne
704137f8de tst_QLocale: Add tests for toFloat()
Mirror those for toDouble().

Change-Id: Ide0ef3cd99528d575f6a578ef19547f3b1119c5d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:04:56 +00:00
Edward Welbourne
108c9015b9 Implement transient locale as instantiating a class
A couple of QLocale tests were using setlocale twice to provide a
transient locale tweak in tests; however, if the test in between
fails, that can leave the program running in the "transient" locale
after.  So implement a proper class whose destructor ensures the
transient is tidied away.  Also change the locale in use by one of
these transient changes: it purported to be checking things didn't
depend on locale, but was using the same local as most of the
test-cases for its test.

Change-Id: I0d954edcc96019a8c2eb12b7a7c568e8b87a41d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-11-23 10:04:46 +00:00
Christian Ehrlicher
794140fb86 QGraphicsProxyWidget: Don't crash within setWidget() when a child proxy has no assigned widget
QGraphicsProxyWidget::setWidget() is checking if the newly assigned
widget is already assigned to a child proxy widget without checking if
the child has a widget assigned at all which lead to a nullptr reference
if it is not the case.
Therefore check if the assigned widget is a valid pointer.

Fixes: QTBUG-15442
Change-Id: I006877f99895ca01975bdcad071cfcf90bea22ad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-22 16:43:38 +00:00
Joerg Bornemann
eef9b4f0d5 Use msvc qmake scope where appropriate
Use 'msvc' instead of 'win32-msvc' or even 'win32-mscv*'.

Change-Id: I21dc7748a4019119066aea0a88a29a61827f9429
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-22 14:16:52 +00:00
Joerg Bornemann
c02d579c56 Remove usage of win32-msvc2012 qmake scope
We don't support MSVC 2012 anymore.

Change-Id: I454ba0f8e893f5910a17e473ab7cf70a1c581e81
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-11-22 10:16:08 +00:00
Liang Qi
41cba737a9 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I909c9cfa0ce80f512de4b4986e626eae66b63afa
2018-11-21 19:34:18 +01:00
Liang Qi
46076f7333 tst_QNetworkReply: Blacklist getFromHttp:success-external
Task-number: QTBUG-71953
Change-Id: I449ee3be8fa748046895386c9cbff90b30ed80c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-21 16:02:52 +00:00
Frederik Gladhorn
e00c73911a Reduce run time of tst_QRegularExpression::threadSafety
This test was taking so much time that it regularly timed out on WinRT
and when running in qemu. Reduce it from around 40 to 7 seconds on a
powerful desktop.
Now it either runs for two full seconds for each test function or until
it has done 50 iterations.

Fixes: QTBUG-71405
Change-Id: If752c1e65d3b19009b883f64edc96d020df479d1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-11-19 11:45:38 +00:00
Liang Qi
4d180586cd Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm

Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
2018-11-19 12:42:10 +01:00
Thiago Macieira
6b088b7a1d QResourceFileEngine: fix use of mapped files after close()
QFile::map() is documented to continue working after the QFile is
closed, so this should work for the resource file engine too.

Change-Id: I343f2beed55440a7ac0bfffd1563243a3966441f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-19 09:09:36 +00:00
Thiago Macieira
6a792d6f0b QResourceFileEngine: fix map() for compressed files
We were returning a pointer to the compressed data and comparing to the
compressed data size.

Change-Id: I343f2beed55440a7ac0bfffd1563232d557c9427
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-11-19 09:09:31 +00:00
Thiago Macieira
460866ee47 tst_QResourceEngine: use QTest::addRow instead of QString concatenation
Change-Id: I343f2beed55440a7ac0bfffd156322c95aebb847
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2018-11-19 09:09:26 +00:00
Thiago Macieira
6125fce799 tst_QResourceEngine: store the actual byte contents that we expect
Instead of using a QString with only the prefix, let's do a full
comparison to make sure there's no junk at the end of the file.

Take the opportunity to remove the nonsense of a space at the end of
most of these files (I didn't remove from all).

Change-Id: I343f2beed55440a7ac0bfffd15632228c1bfe78f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-19 09:09:20 +00:00
Liang Qi
7a4f41bad9 tests: Distinguish tst_qeventdispatcher and tst_qguieventdispatcher
Both use same source, but link without and with Qt Gui library.

Task-number: QTBUG-71751
Change-Id: I5643a07a8067f5fc10fc66f717f19bc3e16a33ab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-16 14:16:09 +00:00
Liang Qi
37d3bc9ad7 Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
2018-11-16 08:10:15 +01:00
Liang Qi
527406cbd9 Modernize the "settings" feature
Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-11-15 17:20:15 +00:00
Ulf Hermann
900b57ea90 Re-blacklist tst_QEventDispatcher::registerTimer() on macOS
The test has been failing over and over since it was removed from the
blacklist. Obviously it is not stable.

This is a partial revert of commit
b10ee45546.

Task-number: QTBUG-71773
Change-Id: Ie2588538ee704652c2f09ce6ad947da3011e7dad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-15 12:08:20 +00:00
Ulf Hermann
16830c827b Make sure QEventDispatcher::registerTimer() cleans up after itself
The test needs to also unregister its timers when it fails. Therefore,
wrap the registering and unregistering in an RAII class.

Task-number: QTBUG-71773
Change-Id: I6ef44e580880deecb32763b5b0cd71e1c26929be
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-15 12:08:11 +00:00
Oliver Wolff
6bdf1e337d tst_qguieventdispatcher: Sync blacklist with tst_qeventdispatcher
Windows and WinRT only have on event dispatcher class so that failing
test cases in one test will most likely also happen in the other.

Change-Id: Ib047c6870e6e02f3cf8deaaa6e438ed0ac7e2d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-11-14 18:36:05 +00:00
Allan Sandfeld Jensen
2393551665 Fix precision in parsing hex format QColors
We document being able to parse more than 8-bit per color, but were
ignoring everything after the first 8 bits.

Change-Id: Ic85ab04b0836e6979a623e294eebd5084c1a9478
Fixes: QTBUG-71373
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-11-12 22:18:43 +00:00
Tor Arne Vestbø
27fb51fa52 macOS: Remove blacklist entries for no longer supported OS versions
Change-Id: Iae6552f1fdcf1dea07a03d3788d378af9140d1a7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-12 07:16:30 +00:00
Allan Sandfeld Jensen
60f5329854 Fix test for multiscreen
QTBUG_7714_fullUpdateDiscardingOpacityUpdate2() would fail when
it moved to another screen if there is one to the left.

Change-Id: I3f8edc04c31dffc5a3bd005d9e5170dd68151df7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-11-09 21:42:57 +00:00
Liang Qi
bc07958f92 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	.qmake.conf
	qmake/Makefile.unix
	src/gui/text/qtextdocument.cpp
	src/gui/text/qtextdocument.h

Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
2018-11-09 10:34:33 +01:00
Tor Arne Vestbø
d0e66df1a5 macOS: Skip tst_QGLThreads::renderInThread
It crashes in the render thread:

thread #7, name = 'SceneRenderingThread'
   frame #0: libsystem_kernel.dylib`__wait4_nocancel + 10
   frame #1: libsystem_c.dylib`system + 452
   frame #2: QtTest`stackTrace() + 325
   frame #3: QtTest`QTest::FatalSignalHandler::signal(int) + 207
   frame #4: libsystem_platform.dylib`_sigtramp + 26
   frame #5: libsystem_platform.dylib`_platform_bzero$VARIANT$Base + 23
   frame #6: GLRendererFloat`gldSetZero + 63
   frame #7: GLRendererFloat`gldClearDrawBuffer + 3792
   frame #8: GLRendererFloat`gldClearFramebufferData + 49
   frame #9: GLEngine`glClear_Exec + 541
   frame #10: tst_qglthreads`SceneRenderingThread::run() + 227

Task-number: QTBUG-68524
Change-Id: I6bc67cb342f77dc1a590a25af535f9bb7f0d325a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-09 08:10:36 +00:00
Mårten Nordheim
dec7961709 QSyntaxHighlighter: Delay all highlights until first rehighlight
When calling setDocument (directly or through the constructor) a delayed
rehighlight is initiated. Previously, if any text was changed before
this rehighlight could run it would cancel the rehighlight, even if the
changed text only caused a new block of text to be highlighted.

Fixes: QTBUG-71307
Change-Id: Ib09b664d90906f5b4427105f0e45469806f3a779
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-08 16:38:27 +00:00
Thiago Macieira
e7998dc187 QCborStreamReader: make sure setDevice() clears the last error
The unit tests weren't running into this problem because the every
setDevice() was preceded by the object being initialized with the exact
same data, so there was never a previous error state. I've only changed
a couple of tests, left the other setDevice() unchanged so we test both
behaviors.

Fixes: QTBUG-71426
Change-Id: I1bd327aeaf73421a8ec5fffd1561a590e3933376
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-08 15:19:45 +00:00
Timur Pocheptsov
d786c55b9e Make tst_qsslsocket::protocolServerSide() less flaky
By accident, when we erroneously tried testing TlsV1_3 on macOS with
SecureTransport (which does not support TLS 1.3) we hit this quite
subtle problem: it can happen that a server-side socket is never
created but a client (after TCP connection was established) fails
in TLS initialization and ... stops the loop preventing
SslServer::incomingConnection() from creating its socket. Then we
dereference nullptr.

Task-number: QTBUG-71638
Change-Id: I8dc5a4c53022a25aafe2c80a6931087517a48441
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-11-07 12:25:12 +00:00
Timur Pocheptsov
b3ae87fe76 Add missing protocol enumerators, report TLS 1.3 if negotiated
1. Remove the conditional inclusion of DTLS versions, they made difficult
and unnecessary ugly adding new protocols (something like TlsV1_2OrLater + 4).

2. OpenSSL 1.1.1 first introduced TLS 1.3 support. OpenSSL 1.1 back-end is
compatible with OpenSSL 1.1.1, but would fail to extract/report protocol
versions and set versions like 'TLS 1.3 only' or 'TLS 1.3 or better' on a
new context.  Given 1.1.1 is deployed/adapted fast by different distros,
and 5.12 is LTS, we fix this issue by introducing QSsl::Tls1_3 and
QSsl::Tls1_3OrLater.

SecureTransport, WinRT and OpenSSL below 1.1.1 will report an error in case
the application requests this protocol (SecureTransport in future will
probably enable TLS 1.3).

Saying all that, TLS 1.3 support is experimental in QSslSocket.

Done-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Done-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: I4a97cc789b62763763cf41c44157ef0a9fd6cbec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-07 10:32:35 +00:00
Liang Qi
eedb3a06cb Merge remote-tracking branch 'origin/5.12.0' into 5.12
Change-Id: I12f26470e01a8582d0f02f51e20d5b742bd95d6f
2018-11-05 19:06:47 +01:00
Frederik Gladhorn
daf9ba91ae Stabilize tst_QAccessibilityLinux::testFocus
The tests would rely on the window manager giving it focus a bit too much.

Change-Id: I1b28def2c95a4f0a9665a7cf6e0c14db03df98d5
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-02 13:45:49 +00:00
Edward Welbourne
3fbf8fbc85 Update to CLDR v34
This only updates data on languages already present in 5.12; once it
has merged up to dev, the scripts need to be run again to pick up a
few more languages and possibly add any more new languages present in
v34.  Change some tests to match changes in en_AU's abbreviated day
and month names.

[ChangeLog][ThirdParty][CLDR] Update locale data to CLDR v34.

Task-number: QTBUG-71144
Change-Id: I68402b5e7e9d3dba669b8ba31b9a8abd86675c6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-02 12:40:46 +00:00
Christian Ehrlicher
2b682972c2 QSqlQuery: add another testcase for bindBool()
tst_QSqlQuery::bindBool() did not check if the bool is correctly bound
as part of the WHERE statement. Add a new test to query for the bool
column and check if there is exactly one row returned.

Fixes: QTBUG-38891
Change-Id: I0bd1ceb1b30e50f67f44f5b06d68683195b78b29
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-11-02 08:27:12 +00:00
Gary Wang
e3c84b6da1 QMimeType: Use default key as fallback for comment() property
When QMimeProvider parses the shared mime database xml files,
it will read the <comment> element for mime comment and treat the
`xml:lang` attribute as locale language string. When no `xml:lang`
attr is provided, QMimeProvider will read the value and treat it as
a en_US locale string as the default key.

When we call QMimeType::comment(), it will try to get the locale
comment string with the default language (QLocale().name()), once
it can't find a matched result, it should return the default key
(which QMimeProvider set it as en_US locale before) as fallback.

Task-number: QTBUG-71314
Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394
Reviewed-by: David Faure <david.faure@kdab.com>
2018-11-02 08:27:10 +00:00
Allan Sandfeld Jensen
00674a1643 Treat shorts as int in QVariant::canConvert()
Follow the pattern of char and float, and treat shorts as a more generic
type in QVariant::canConvert()

Task-number: QTBUG-60914
Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-11-01 17:31:13 +00:00
Heikki Halmet
b1ef104866 Blacklist tst_QWindow::exposeEventOnShrink_QTBUG54040
Change-Id: Ib87d2820c4dbdf93778997b6df11cc7d8e63cf04
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-11-01 10:27:07 +00:00
Kari Oikarinen
a952fd7d5b QObject: Fix isSignalConnected() when signals have been disconnected
The bitmap cache for the first 64 signals being connected was only set when the
connection is added. It was never unset when the connection was removed.

Internal use of the connectedSignals bitmap is not hurt by it occasionally
saying a signal is connected even though it is not, since the purpose of those
checks is avoiding expensive operations that are not necessary if nothing is
connected to the signal.

However, the public API using this cache meant that it also never spotted
signals being disconnected. This was not documented. Fix the behavior by only
using the cache if it is up to date. If it is not, use a slower path that gives
the correct answer.

To avoid making disconnections and QObject destructions slower, the cache is
only updated to unset disconnected signals when new signal connections are
added. No extra work is done in the common case where signals are only
removed in the end of the QObject's lifetime.

Fixes: QTBUG-32340
Change-Id: Ieb6e498060157153cec60d9c8f1c33056993fda1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-10-31 10:32:41 +00:00
Jüri Valdmann
497f43c90f tst_QCborValue: Disable support for spaceship operator
Spaceship operator was disabled for QCborValue, but not the test.

Change-Id: Icb91da689f62ef6de9f4fa926346505c5e50e9eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-31 09:46:11 +00:00
Oliver Wolff
7e7514482f winrt: Skip a test row of tst_QRegularExpression::threadSafety
PCRE2 does not support JIT on winrt. This test row takes a long time
(30 seconds here) without JIT and thus might cause test timeouts in
COIN when run on winrt.

Change-Id: I79d9f6be16dbe16594ae2bf51f353acd06b3d2fe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-10-31 09:35:29 +00:00
Ivan Komissarov
95476bfcf6 qendian: Fix float conversions
Since Qt 5.10, qTo/FromBig/LittleEndian<float/double> stopped working.
It may be confusing, but big endian floats do exist, so not to break old
code, we should support them.

Change-Id: I21cdbc7f48ec030ce3d82f1cd1aad212f0fe5dd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-28 22:26:56 +00:00
Timur Pocheptsov
b10ee45546 tst_qeventdispatcher: remove macOS from the BLACKLIST
the test is stable in Qt 5.12.

Task-number: QTBUG-60993
Change-Id: I0c366567121688d9518e90b5e8f9ec1b4006b7b9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-25 11:51:53 +00:00
Timur Pocheptsov
321f11db53 tst_QLocalSocket::processConnections: remove QSKIP
on macOS, the test seems to be stable nowadays.

Task-number: QTBUG-39986
Change-Id: I18430c3feb27a5bee5474e1eb95f7d89b25f00a9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-10-25 11:51:48 +00:00
Timur Pocheptsov
95ba049f87 Remove QSKIP and bring the test back to business
on macOS, where it was skipped but where it now seems to be stable/work.

Task-number: QTBUG-39983
Change-Id: I100a57f23b43074ebacc012be247d92acc6ae336
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-10-25 11:51:42 +00:00
Oliver Wolff
e524724f9d tst_qfilesystemmodel: Do not use nested calls of auto test functions
Calling rowCount inside another auto test function yields unexpected
results, if rowCount fails. Without a check for QTest::currentTestFailed
the failure will not stop the calling function and other functions like
rowsInserted and rowsRemoved might happily continue even though their
requirements are not met. That caused a crash on winrt under certain
circumstances.

In addition to that TRY_WAIT now does not only wait for the given
amount of time, but also gives feedback about its result. Before
this change TRY_WAIT was basically useless, as it gave no indication
about its success/failure.

Fixes: QTBUG-71121
Change-Id: Ibd3f233a0b913db799814be97c4274d510643c74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-25 11:24:08 +00:00
Frederik Gladhorn
a87f85dbf9 Linux Accessibility: Fix expandable state
The state was forgotten from the translation layer, this is important for tree views.

Fixes: QTBUG-71223
Change-Id: Ief4004fe455889f9d5a7eb018bf34d37c36a6bd9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-10-22 10:27:06 +00:00
Frederik Gladhorn
1c614d07fb tst_QAccessibilityLinux make state checking more convenient
Change-Id: I96274ab0a0f5d942746de0166df47936e2390c65
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2018-10-22 10:27:01 +00:00
Jüri Valdmann
cea2b5510c Fix building tests with -no-gui
Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-20 20:38:59 +00:00
Christian Ehrlicher
c18a91b0dc QTableWidget: fix cellChanged signal emitted by takeItem()
QTableWidget::takeItem() emitted cellChanged with row and column set to
-1. The internal functions searched for item after it was reset to
nullptr and therefore it was not found.
Since the modified cell is known because it's passed to the takeItem
function, the correct row/column can be retrieved from there.

Task-number: QTBUG-70478
Change-Id: I5ff5991c49f3200efe95fde4c7d0d28e19be7ebf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-19 12:19:20 +00:00
Allan Sandfeld Jensen
16ebc78ef3 Fix odd test in tst_qflags
This test triggered a compiler warning for good reason, it made no
sense, trying to change it to what it was probably meant to be.

Change-Id: I01a848272b42dae2aaa58a4f5bed998644d864da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-17 09:15:22 +00:00
Anton Kudryavtsev
aa633ff276 QMetaEnum: fix UB
Check ptr before usage.

Change-Id: Iac757a2e260b237d837318932cc0b5896c6e04c2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-17 08:48:13 +00:00
Liang Qi
ccf26f6a88 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/plugins/platformthemes/platformthemes.pro
	src/printsupport/kernel/qplatformprintdevice.cpp

Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
2018-10-17 10:35:28 +02:00
Ulf Hermann
402efef57b Don't drop update requests when closing and reopening windows
Before commit 4d15f393a7 update requests
were handled by a timer on QWindow. Therefore they survived the closing
and re-opening of platform windows. Now, as the timer was moved to
QPlatformWindow, it gets reset when you close the QWindow, and any
pending update requests are lost. However, we do set the
updateRequestPending variable on QWindow when requesting an update.
Therefore, we can also restore the update timer on the platform window
when creating it.

Change-Id: I23b00f24a46706beac7d1455edd8a5623db46b22
Fixes: QTBUG-70957
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-10-16 07:09:36 +00:00
Johan Klokkhammer Helsing
02a2144427 QToolTip: Don't crash if a tool tip is shown outside screen geometry
In some cases, a tool tip may be shown outside screen geometry, i.e. if:

- QToolTip::showText is invoked manually with a position outside.
- In tst_QToolTip::setPalette if there is no screen at (0, 0). This might
  happen in a multi-monitor setups where one screen is taller than the other.
- On Wayland windows are (by design) not allowed to know their position on
  the screen. This means that global positions can't be trusted.

This started crashing when QDesktopWidget::screenGeometry(pos) was replaced
with QGuiApplication::screenAt(pos)->geometry() because screenAt will return
null if no screen is found, while screenGeometry defaulted to the primary
screen.

This reverts to the old behavior of falling back to the primary screen.

This won't solve the issue completely for the Wayland case, but at least we
will stop crashing.

Change-Id: I42dd07cc21c2f9f0ea0d69f0c25bd46d8a2615a0
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-15 07:44:04 +00:00
Eirik Aavitsland
f2f040ae1c Improve support for QImages in QDataStream read transactions
QImage's operator>>(QDataStream&) did not set an error mode on the
stream on read failures. That would break QDataStream transactions.
Since the current QImage serialization cannot differentiate between
truncated and corrupted data, we set the ReadPastEnd error as expected
by the transaction system.

Also specify the expected file format on decoding QImage from stream,
to avoid all the format handlers' canRead() being invoked. This is
necessary since some of them may call ungetChar(), which fails when
the stream is in a transaction.

Also add testing of this feature to the QDataStram transaction
autotest. That required a slight rewrite of the fake sequential
QIODevice subclass. The previous implementation had incorrect
behavior of peek(), which is required by QImage decoders.

Task-number: QTBUG-70875
Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-15 07:18:57 +00:00
Alexandra Cherdantseva
1192c463db QImageWriter/QPNGHandler: Quality option should be CompressionRatio
Wrong option was used to set zlib compression level for png
setCompression with negative value uses default compression
setCompression with value between 0-100 converts to zlib compression level 0-9
setCompression with positive value overrides Quality option

Change-Id: Ic4b048a1e30d6940019c2a00a6c24d0c11e3f821
Reviewed-by: Alexandra Cherdantseva <neluhus.vagus@gmail.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-10-14 19:36:33 +00:00
Miguel Costa
0a7aebadfb Update ANGLE to chromium/3280
Change-Id: I0802c0d7486f772d361f87a544d6c5af937f4ca1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-13 21:36:35 +00:00
Christian Ehrlicher
bbe08d6b68 QCss: properly parse functions which contains additional spaces
When there were additional spaces between the function definition and
the first parameter, the parser failed to parse it when it contained
another function (e.g. 'qlineargradient(... rgb() ...)').
The reason for this was that ::until() needs the function at index-1 so
it can correctly count the opening parenthesis.

Fixes: QTBUG-61795
Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-10-12 22:01:14 +00:00
Liang Qi
c593492d16 Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-12 14:26:15 +00:00
Allan Sandfeld Jensen
25830cf912 Fix builds without DTLS
Change-Id: Ic7215c7aa0bf6f7b37ae34649d809f2e1e1ee95b
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-10-09 13:14:42 +00:00
Edward Welbourne
bc099f33dd Support QCborMap::operator[] taking a string literal
Use a template on the size of the char[], as suggested by Ville
Voutilainen.  This resolves ambiguity about whether such look-ups
should be done via QString or QCborValue (not that it would have made
any difference).

When we come to add mutating indexing of QCborValue, chained
dereferences like map[i][j][k] need to stay in operator[] const
throughout, to avoid detaching intermediates to create references into
them due to using the mutating operator[] on the earlier dereference's
return.  So const-qualify the QCborValue operator[] const variants at
the same time, to match those of QCborValue itself.

Change-Id: Ib1652ae9440fe3767a653afa2856b74040210e07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-08 14:11:23 +00:00
Qt Forward Merge Bot
b4da5c6b93 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/corelib/tools/qtimezoneprivate.cpp

Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
2018-10-08 10:00:49 +02:00
Jarek Kobus
9f710b15f0 uic: Write the float and double properties in 'f' format
Make the code consistent with the DomProperty::write() method.

Task-number: QTBUG-70613
Change-Id: I622b4a019a4473823584de97304f8324f2cf0c6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-10-05 20:06:03 +00:00
Morten Johan Sørvig
d7e274a446 StyleSheetStyle: Load @Nx images
Perform a @Nx image file lookup when loading pixmaps.

Make drawBackgroundImage() handle high-dpi pixmaps,
here the layout calculations needs to be in device-
independent pixels

Fixes: QTBUG-36825
Change-Id: I61e6f53c59f61f3bd88c34a036349e51e8c8ad92
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2018-10-04 07:01:05 +00:00
Ulf Hermann
21355b3630 QGraphicsScene: Make focusing on touchBegin optional
Usually we focus in when we receive a click or equivalent.
QGraphicsScene by default also transfers the focus when you start a
touch on a trackpad or similar. Most of the time this also generates a
synthetic mouse click, so people don't necessary notice. However, at
least on macOS you can configure this behavior. With focusOnTouch
switched off, QGraphicsScene behaves as one would expect on macOS.

Fixes: QTBUG-59442
Change-Id: Ib87112640eef6b77892ad2490d80eedd055e6dce
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-10-04 07:00:21 +00:00
Tor Arne Vestbø
a154ea89e8 Extend tst_QGL::graphicsViewClipping blacklisting
Change-Id: Ife72db5a0d7cb8abe55c60c519087e2b60f26990
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-10-03 13:04:13 +00:00
David Faure
ddeec1b07e QSFPM: don't let setFilterRegExp(QString) overwrite CaseSensitivity
This is a regression from commit 346c15102b, which creates a new QRegExp
in setFilterRegExp, losing previously set case sensitivity property
(i.e. when the code does proxy->setFilterCaseSensitivity(Qt::CaseInsensitive)
before setFilterRegExp).
Interestingly that commit ensured that setFilterFixedString would still
preserve CaseSensitivity, but not setFilterRegExp(QString).

Change-Id: I3d37d001ce6e86dd90e7e07431440a42607172f9
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
2018-10-03 11:45:50 +00:00
Edward Welbourne
ced34cb3d5 QDateTimeParser: avoid using an invalid hour by default
When a time-zone does a spring-forward, skipping an hour (either to
start DST or to move its standard time), there's an hour that doesn't
exist on the day in question.  That hour can be the first hour of the
day, in which case using 0:0 as the default time is broken.  So catch
this case and use the first time that day that makes sense.

Fixes: QTBUG-70823
Change-Id: I23dae9320a3cdd2c988841a7db1b111edb945730
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-10-02 13:49:45 +00:00
Qt Forward Merge Bot
07e9261105 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Iaa438d14357be1bf75bb645cb8d3245947c055b8
2018-09-30 01:00:19 +02:00
Thiago Macieira
caa598c843 Fix QUrl::matches for when removing authority parts (other than host)
QUrl::RemoveAuthority is RemoveUserInfo | RemovePort | 0x10, so the
condition

    if (options & QUrl::RemoveAuthority)

would match if any of the other bits for the username, password or port
were set, which meant we would skip the host comparison. Ditto for
username and RemovePassword.

[ChangeLog][QtCore][QUrl] Fixed a bug that caused QUrl::matches to
incorrectly compare two URLs with different hostnames or different
usernames as equal, if certain QUrl::RemoveXxx options were passed.

Change-Id: I015970a03b874898bba7fffd155856ab9d6cb1be
Fixes: QTBUG-70774
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-09-29 00:33:39 +00:00
Alexander Akulich
94884246d4 QCommandLineParser: Ensure that an option text ends with a newline
Before this change we inserted newline only if an option has a
description and ended up with an arbitrary long line with all options.

[ChangeLog][QtCore][QCommandLineParser] Fixed a bug that caused the help
output to show two options or more in the same line if the options didn't
have a description.

Task-number: QTBUG-70174
Change-Id: Id54b9ae13ee596869e4dc14e09301aea19eed2f8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-28 22:01:05 +00:00
hjk
f286027e6b Fix QXmlStreamWriter xmlns attribute placement
Done-by: Eugenio Rustico
Change-Id: Ibd6aa6cc8be9090a4fad4f96628086d8a498b8e0
Fixes: QTBUG-63434
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-28 13:19:48 +00:00
Friedemann Kleint
1d09b0d1b2 QGraphicsScene::update(): Keep the list of updatedRects() unique
Otherwise, the rects will pile up when the item is not part of a view.

Task-number: QTBUG-54275
Change-Id: I29c989e25ce0ca1ac0b87d0388a476ef1acd9cfd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-09-28 13:17:22 +00:00
Friedemann Kleint
3c5ad626d4 Export modules' enabled/disabled features to cmake
Add properties enabled_features and disabled_features the respective
library targets.

This makes it possible to query the enabled classes in dependent libraries
(for example, Qt for Python).

Add a test verifying whether the Open GL configuration is reflected
correctly in the feature properties to the existing test_opengl_lib
autotest.

Change-Id: I645c947073dbb36da3be81de6bc62ee0ba1e73d6
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-28 13:10:28 +00:00
Liang Qi
555a6b5d5d Modernize the "filesystemwatcher" feature
Change-Id: If030b56ad97e047d89d442629262b4839df306d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-27 08:18:55 +00:00
Eskil Abrahamsen Blomfeldt
720e243d88 Fix crash when detaching dangling QTextCursor
When a QTextCursor survives its QTextDocument, the internal
QTextDocumentPrivate pointer is set to null. There are checks for
this in all the QTextCursor functions to skip out early if such
a QTextCursor is used.

However, when executing the "if (d->priv)" condition in setters,
this will access the non-const operator->() of QSharedDataPointer
and detach the QTextCursorPrivate, and in the copy constructor of
this class, there was an unprotected call into priv->addCursor().

In theory, we could cast all the checks for d->priv to avoid
detaching, but in practice this doesn't matter, since the setters
will typically detach anyway later on.

[ChangeLog][QtGui][Text] Fixed a crash that can happen when calling
a setter on a QTextCursor after its QTextDocument has been deleted.

Task-number: QTBUG-70293
Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-27 06:51:37 +00:00
Allan Sandfeld Jensen
e61a40bff1 Re-enable thread autotests
Replacing the qmake test with the one corelib/thread/thread.pri uses
for those classes.

Change-Id: Ie803190b821736c89b056ae51b7dfe92046189eb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-09-25 22:35:40 +00:00
Thiago Macieira
7e1a0c0739 Add tests for decoding too-short UTF-8 sequences
We were handling this properly, but not testing them. I guess we weren't
testing because the condition is a valid intermediate state, so
hasFailure() is correct it returning false.

Testing inspired by the bug reported in
https://github.com/intel/tinycbor/issues/137

Change-Id: Ib47c56818178458a88b4fffd1554ecfdd0af637e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-25 22:14:07 +00:00
Edward Welbourne
56c5829384 tst_QCborValue: eliminate unused lambda
Change-Id: Icb8bd9bd170c8c22978c7d730a8c8b671705adfc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-25 14:35:17 +00:00
Tony Sarajärvi
2d587a03eb Remove insignificant flag from qtouchevent.pro
Task-number: QTBUG-46266
Change-Id: I38eb3a1da2688157e40f915b86d9a8e4c0e58f64
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-25 12:50:17 +00:00
Eirik Aavitsland
b233ce66d3 QPainter cosmetic stroker: Fix painting error for FlatCap lines
Initialize the lastDir properly, to avoid the stroking algorithm doing
direction-change handling for a single line. That could cause a cap to
be painted for a single FlatCap line.

Also fixes a bug in tst_qpainter, revealed by the above fix. The
result drawPolyline was erroneously compared to the result of drawing
the lines individually, for a case where the former correctly paints
the pixel of the join point in the corner, while the latter by
coincidence used to paint the same pixel as a cap because of the bug
above.

Task-number: QTBUG-70101
Change-Id: Ie20eda33214cfe9e7627f17ef4c7a5b3835c9c24
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-25 12:32:24 +00:00
Tony Sarajärvi
8a76350788 Blacklist flaky qgraphicsscene autotests
Task-number: QTBUG-70640
Change-Id: I2a958652ed9fee9cbf2cd367e99aa672c744e74b
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:13:39 +00:00
Tony Sarajärvi
1ccc2348b3 Extend blacklisting of tst_qparallelanimationgroup tests to macOS 10.13
Task-number: QTBUG-61500
Change-Id: I46b10b6ecd7f1653bebd0ffd6f250f5c65cb8189
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:13:30 +00:00
Tony Sarajärvi
a1eaa71e61 Blacklist flaky tst_QGraphicsEffect autotest on openSUSE
Task-number: QTBUG-70612
Change-Id: I7254ca7a0dd1bce92bd6d8841e53af5acdd78807
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:13:20 +00:00
Tony Sarajärvi
17187265cb Blacklist qguiapplication::focusObject on Ubuntu and openSUSE
Task-number: QTBUG-70593
Change-Id: Ibad362cbc6660835a05412a612f34cfdaee5932c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:13:12 +00:00
Tony Sarajärvi
619e37c83b Extend blacklisting of qtimeline::frameRate to macOS 10.13
This is already blacklisted for macOS 10.12 and reproducing in 10.13.

Task-number: QTBUG-61037
Change-Id: I464e42d0ae5ab24104250edc69a90454ba605eaa
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:13:00 +00:00
Tony Sarajärvi
e0ba6e09c0 Blacklist flaky tst_qheaderview test
Task-number: QTBUG-70590
Change-Id: I39ca2a7207db58d1a33bb918e065196a60471930
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-24 21:12:52 +00:00
Tony Sarajärvi
c2800e7555 Remove insignificant flag from qcolordialog.pro
As the test was unstable, we qskip the failing parts
instead of mark the whole test insignificant.

Task-number: QTBUG-50842
Change-Id: Ib8f5b7ead07d65cc624fa72b190ecee0338c8183
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2018-09-24 21:12:38 +00:00
Christian Ehrlicher
6bb0cbc686 tst_QMdiSubWindow: fix flaky setOpaqueResizeAndMove test
tst_QMdiSubWindow::setOpaqueResizeAndMove checks if a resize of the mdi
subwindow works as expected by simulating mouse events. Those events are
sent to fast and therefore the operationMap of QMdiSubWindowPrivate is
not yet updated which let the test fail. There was already a call to
qWait(250) to wait for the 200ms timer but sometimes (esp. in virtual
environments) the timer was not triggered after this period.
Fix it by checking if resizeTimerId is set back to -1 which means that
updateDirtyRegions() was called.

Change-Id: I961ba80589d2f725a6858ba70b84fb35750a6964
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-09-15 15:39:21 +00:00
Tony Sarajärvi
f4dd670fe9 Blacklist an extremely flaky tst_QDoubleSpinBox::editingFinished test
Task-number: QTBUG-70088
Change-Id: I9239f379121f6167dd665ae3137a449d0ac5b6c7
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-15 15:39:00 +00:00
Tony Sarajärvi
004b3742a2 Blacklist a tst_QFileDialog2 test due to extreme flakiness in macOS
Task-number: QTBUG-70087
Change-Id: Icc2467177209fef8aad59c5424e936ef96aa6289
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-15 15:38:46 +00:00
Qt Forward Merge Bot
42f84de26a Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
2018-09-14 01:00:08 +02:00
Florian Bruhin
49efea26a5 sqlite: Fix QSqlError handling when opening/closing database
Both sqlite3_open_v2 and sqlite3_close are documented to return an error code:
https://www.sqlite.org/c3ref/open.html https://sqlite.org/c3ref/close.html

However, those were ignored (other than checking whether the operation
succeeded), causing QSqlError::nativeErrorCode() to always be "-1" when there
was an error while opening/closing the database.

Additionally, the error string needs to be read (via sqlite3_errmsg16) in
qMakeError *before* d->access is set to 0, or the databaseText() will always be
"out of memory" no matter what error actually happened.

Task-number: QTBUG-70506
Change-Id: I75cbf178c9711442e640afd26c4502214d20c598
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-09-13 18:18:47 +00:00
Tor Arne Vestbø
14bae62bd2 Blacklist flaky tst_QGL::graphicsViewClipping on RHEL 7.4
Change-Id: Ic771b263c988525d4b887cb2a1de9f9c7343e49b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-09-13 15:53:20 +00:00
Christian Ehrlicher
0d1481b4d2 SQL PostgreSQL/SQlite: Properly decode default varchar parameter
The default values for varchar columns were not decoded properly.

Task-number: QTBUG-46968
Change-Id: Ie13d48c316cd694240f7e287010b97afc8c6c341
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-09-12 09:11:04 +00:00
Eirik Aavitsland
9d1c881f49 Texture file support: add mipmap reading to ktx handler
Change-Id: Ic2c10b3e64d63d2272a8a3922d2b3f99dfd45bdb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-12 08:41:38 +00:00
Edward Welbourne
017ac02ec4 Clean up time-zone matching logic in tst_QLocale::macDefaultLocale()
The test was computing GMT with a suffix added to it for the offset;
but when the offset is zero there's no need for it.  Cleaned up the
logic so that it only checks for a "padded to two digits with zero" if
the number is single-digit (and use string arithmetic in preference to
wantonly complex .arg()ing; and use simpler names).  Since we don't
try to check anything unless GMT does appear in the string (because
the actual zone ID was used, instead of GMT with an offset), the case
of zero offset has nothing more to check than that GMT was present,
the precondition for checking anything.

Task-number: QTBUG-70322
Change-Id: I0b8abe7e63d9d72fa9cf32f188b47a78a849044b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-11 14:40:22 +00:00
Tony Sarajärvi
fd6370d89f Extend opensuse blacklistings to opensuse-leap
In openSUSE 15.0 /etc/os-release the ID of the OS was
changed from "opensuse" to "opensuse-leap". So every blacklisting
we did for opensuse, didn't cover opensuse-leap. This one adds
opensuse-leap as a blacklisted platform whenever opensuse
was blacklisted.

Task-number: QTBUG-70463
Task-number: QTBUG-51399
Change-Id: I5879eb34926757163973d8b9442eae58f47d2f11
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-09-11 12:11:45 +00:00
Liang Qi
683e144efb Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	mkspecs/common/macx.conf

Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
2018-09-10 12:12:46 +02:00
Thiago Macieira
b66357e3eb moc: Fix compilation of text strings containing non-ASCII
On platforms where char is signed, like x86, the following is an error
(narrowing conversion):

 unsigned char x[] = { '\xc3' };

Change-Id: I495bc19409f348069f5bfffd15518f9ef4e43faf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-10 04:17:03 +00:00
Christian Ehrlicher
85917c4b72 Autotests/QItemView: re-enable tst_QItemView::indexAt()
tst_QItemView::indexAt() was disabled since Qt 5.0 (and maybe earlier)
maybe due to it's long runtime (15s on my machine).
Speed it up by checking only some special positions inside the visual
rect (borders, center) as it will likely not fail on other positions but
succeed for the ones which get tested.

Task-number: QTBUG-22470
Change-Id: I5c7135757049176f9daca4afc1b7f40c75b9ecd9
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:04:15 +00:00
Christian Ehrlicher
ef40cad3a9 QTableView: Fix PageUp not getting to top when first row is hidden
When the first row(s) of a QTableView is hidden, PageUp could not reach
the first visible row because logicalRow(0) is taken without checking
if the row is visible.

Task-number: QTBUG-70215
Change-Id: Ic7820352b8988accb685ea7d16908d3fa8bf2847
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-09 12:03:55 +00:00
Tor Arne Vestbø
5ed48895b6 tst_qglthreads::swapInThread(): Acquire context before resizing widget
Otherwise the QGLWidget's context may be owned by and used by the swap
thread when the resize happens on the main thread.

Change-Id: Id415747572e6b988924618b1df0efdee5fcb1805
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-09-06 12:42:06 +00:00
Friedemann Kleint
550d2a0a15 uic: Fix pixmap functions for QIcon
Task-number: QTBUG-8563
Change-Id: I69b16ac2327fee6dd6f26845bdda60ad4dde56fa
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2018-09-06 11:58:40 +00:00
Luca Beldi
dc73a691bf Fix QSIM::itemData returning role 255
Before this fix, QStandardItemModel::itemData returns
a map containing role 255 which is used internally to store the flags.
This role is an undocumented implementation detail so it should
not be returned to the user.

[ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255

Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 11:51:28 +00:00
Olga Radko
c88305b68d QSortFilterProxyModel: add test for inserting via a QComboBox
This new test double-checks the bugfix for QSortFilterProxyModel::insertRows
in commit 70ba75519d. Previously, when using QComboBox on top of
QSortFilterProxyModel and calling QComboBox::addItem with row==rowCount(),
an empty item was inserted in one place, and then another item was modified
(instead of the inserted empty one). This test checks that the above bugfix
indeed fixes the behavior of QComboBox::addItem when used in this manner.

Task-number: QTBUG-69158
Change-Id: Id01345e0525694a57250c656222d626e2267aa8e
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-06 05:56:18 +00:00
Albert Astals Cid
8b6100d512 QStringList: add contains(QStringView) overload
Change-Id: I953e4ef3167011d0348ea482890e29478bd6f761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:52 +00:00
Albert Astals Cid
64fe66e7be Add QString::compare(QStringView, CaseSensitivity)
There was a QStringView::compare(QString, CaseSensitivity) but it's
good that the symmetric also exists

Change-Id: Ic789f11d41eb8cfa393cb51c19bd1f89bb87d912
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-09-03 08:55:45 +00:00
Sergio Martins
179c88a1a9 Rename QTimer::connectTo() to QTimer::callOnTimeout()
Some people suggested the later, so let's have a second look at it
before it's too late.

Although I was in favor of the former I'm now having second thoughts.
connectTo() is meant to only be used in classes which have a clear dominant signal,
but there are rare classes that have two (example: QAbstractButton::toggled, QAbstractButton::clicked).
QAbstractButton::connectTo() would be ambiguous if we ever wanted to add these shorthand connects
to QtWidgets

Change-Id: I198ad3326d31dcf89b9c47a299124572ee7b11b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-09-03 08:43:39 +00:00
Allan Sandfeld Jensen
5d0ee89132 Fix reading 16bpc grayscale PNGs
They were incorrectly attempted to be read as Indexed8, instead use
the RGBA64 formats to read them with full accuracy.

Task-number: QTBUG-45858
Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-09-03 08:24:10 +00:00
Thiago Macieira
7bd79b3cff Plugins: Save some architectural requirement flags
...not just the debug flag. The information is saved outside of the CBOR
map for two reasons:

 1) removing the hack that depended on how QCborStreamWriter and
 TinyCBOR internally work, allowing for the extra parameter to be
 written directly. We wouldn't be able to use that hack anyway and would
 have needed a further, uglier hack to encode a byte whose value we
 don't know.

 2) outside the map, this information can be parsed more quickly and
 then we can discard any plugins we shouldn't actually load.

Since we're doing this for a flag, I decided to move the Qt version
there too for reason #2.

Change-Id: I61ecce6b1324410bbab4fffd153d4e5fc696d19e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-09-01 15:19:46 +00:00
Thiago Macieira
d9766ddc3d Plugins: store the metadata in CBOR instead of binary JSON
In preparation for Qt 6 deprecating the binary JSON format. Also reduces
the size of the metadata a little: for the xcb platform plugin, it went
down from 264 bytes to 138; for the jpeg image plugin, it went from 320
to 135.

I've had to change the signature so older versions of Qt won't try to
parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument
could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to
allocate memory and that causes crashes with Qt < 5.11.2.

Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-09-01 15:19:39 +00:00
Tor Arne Vestbø
917c2de203 Disable tst_macnativeevents
It's almost completely blacklisted anyways, and the parts that are
not are flakey.

Change-Id: I4601d751a2963c94c62ec439dd78b874034069a0
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-31 12:35:45 +00:00
Tor Arne Vestbø
b02fe1bfe7 Remove codepaths and checks for unsupported Apple platforms
We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3.

Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-08-31 12:35:45 +00:00
Friedemann Kleint
f9431f5632 Fix tst_QSizePolicy::constExpr() to compile with MSVC 15.8.1
For ControlType != QSizePolicy::DefaultType, qCountTrailingZeroBits()
is used which, MSVC 15.8.1 does not consider constexpr due to built-ins.
Exclude the check by #ifdef.

Task-number: QTBUG-69983
Change-Id: Ifc3dc3d94a804246bee1705fc8f3ac9b04ee4d32
Reviewed-by: Alexander Shevchenko <sav_ix@ukr.net>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 06:23:51 +00:00
BogDan Vatra
19b12ac9c2 Update QMetaObjectBuilder::MetaObjectFlag enum
Synced QMetaObjectBuilder::MetaObjectFlag with the MetaObjectFlags enum
from qmetaobject_p.h. Also added a few comments for Qt 6.

Change-Id: Ieccd5cf8d512a6bf7256b2f4db88d45662774536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-30 05:12:01 +00:00
BogDan Vatra
c2165f891c Allow registering constructor for a set of dynamic types
This feature is needed to register complex types (e.g. Q_GADGETS) at
runtime, using a single constructor method and added type parameter.
Without having the type id available to the Constructor it is impossible
to specialize behavior, thus requiring separate constructors for each
type. Generating these separate constructors at compile time is easy,
but not at runtime.

[ChangeLog][QMetaType] QMetaType can now register constructor for a set
of dynamic types.

Change-Id: I6071271d0e157864594dd07b4bc3a0abbeb15a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-30 05:11:38 +00:00
Christian Ehrlicher
81e298a51d QWidget: fix setTabOrder for compound widgets
When adjusting the tab order for compound widgets, it can happen that
the order is already correct. The check for this case forgot one case
which lead to a garbled focus chain.

Task-number: QTBUG-68393
Task-number: QTBUG-69619
Task-number: QTBUG-10907
Change-Id: Ic3242746bdcf3a4db6ea8daa1498381500ca116d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-30 04:25:22 +00:00
Ryan Chu
09f59271e6 Postpone testing docker images and files until running 'make check'
To avoid bothering the user who just wants to build all the test cases
in qtbase. It is better to move the docker related testing to the check
target. Then, it won't break the build procedure and force users to
finish test server provisioning in advance.

Change-Id: I2c4212297342c3eec7bcbebff9f991b7346d9503
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e798e8a03b)
2018-08-30 04:06:51 +00:00
Tor Arne Vestbø
825e1a0506 Add missing dependencies for tst_macnativeevents
Change-Id: I5578b78a90588117339562b65884b7bc46770647
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-29 02:47:47 +00:00
Tor Arne Vestbø
ed92be5007 Add missing dependencies for tst_qmacautoreleasepool
Change-Id: Idf94d419526f02e89608b1d105a0858bceabbba1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-29 02:47:45 +00:00
Oswald Buddenhagen
a25ee4c1ce darwin: fix tst_qsettings deps
the test uses CoreFoundation api directly, so it must link it
explicitly.

amends 6c8f32388b.

Change-Id: I76b7d8ab41d6a66138eb45bd0f067cfee8e96cb8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-29 02:47:41 +00:00
Oswald Buddenhagen
fa6bab9c58 darwin: fix tst_qimage deps
the test uses CoreGraphics api directly, so it must link it explicitly.

amends b0abe20d4.

Change-Id: I734bfbedff56df731c1e528670f686565b63f3b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-08-29 02:47:39 +00:00
Joni Jäntti
546eb7b947 Blacklist tst_Gestures on Ubuntu 18.04
These autotests are not currently working with the Ubuntu 18.04
platform being introduced to the CI.

Task-number: QTBUG-70227
Task-number: QTBUG-70226
Task-number: QTBUG-70224
Task-number: QTBUG-70223
Task-number: QTBUG-70209
Change-Id: Ibe7cafd37763d7d305d8c3d9ec17bc6339db744a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-28 16:30:28 +00:00
Andy Shaw
28702cb239 Initialize the QSqlQuery to be invalid when creating a sql model
When QSqlQueryModel or QSqlTableModel is created it will create a
QSqlQuery which defaults to using the default QSqlDatabase connection.

If this connection belongs to another thread then it will throw a
warning as this is not safe to use. Since the QSqlQuery is always
recreated when a query is set, the instance which is a member of
the class can effectively be invalid until a new one is set.

Task-number: QTBUG-69213
Change-Id: I68a5dd59fe62788f531d59a0680da11b118ee383
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-28 16:10:30 +00:00
Frederik Gladhorn
900ce73b6f Merge 5.11 into 5.11.2
Change-Id: I672bc167de3801c944315d92120c5e03da69e9c7
2018-08-27 15:49:03 +02:00
Shawn Rutledge
112c0632d9 tst_QLocale::formattedDataSize: add Russian
The table and macros weren't extensible enough for non-Latin-based
languages.

Change-Id: I950f06de57aaf6bd0b24e0056e4acee2fb655f3d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-26 18:51:48 +00:00
Liang Qi
563c9eb4ee Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-25 04:11:12 +00:00
Qt Forward Merge Bot
1d077120f4 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I5f1567c792992fc00f0256f39b76cfbe017e6a3a
2018-08-24 23:59:46 +02:00
Joni Jantti
4d38f22522 Blacklist tst_Gestures::autoCancelGestures2
This autotest fails on the Ubuntu 18.04 platform.

Task-number: QTBUG-70153
Change-Id: I2a2b0075a046664cdf5733d8629f634b4e33dc6f
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-24 17:31:09 +00:00
Edward Welbourne
bd42e2f0ce Blacklist two tests on macOS that a planned CI change shall break
We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign
"GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this
turns out to not be a deficiency of macOS so much as of how we
configure Coin's VMs.  While we fix that, we need to ignore failures
in these tests, so that we can pull the #if-ery out and clear the
blacklist once the VMs are set up properly.

Task-number: QTBUG-70149
Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-24 17:30:01 +00:00
Friedemann Kleint
96c202e981 Refactor tst_QFiledialog::clearLineEdit()
The test had some shortcomings:
- Flakyness due to not waiting for the file dialog list
  to be populated.
- It assumed that the hardcoded directory name
  ____aaaa... always would show first in the list. This may
  not be true on Windows, where names like .designer show above.
- On failure, the test directory would leak.

This manifested in failures like:

FAIL!  : tst_QFiledialog::clearLineEdit() '(fd.directory().absolutePath() != QDir::home().absolutePath())' returned FALSE. ()

To fix this, use QTemporaryDir and introduce predicates that
can be used to check whether the dialog has been populated
and the right file/directory is selected by pressing cursor down.
Use the temporary directory as not to pollute the home directory.

Change-Id: Ic504b91325993dcd6099c99e125e7ed8ff1d7672
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-24 12:00:31 +00:00
Edward Welbourne
8a270dee2b Revert "Fix time-zone tests on macOS >= 10.13, which now knows what CET is"
This reverts commit fd38c97a6c.
Apparently our actual VMs for 10.13 don't get this right, although the
ones used in testing did (prompting the fix this reverts).  We
probably have mis-configured VMs, but this is the quick-fix to get
development moving again.

Task-number: QTBUG-70149
Change-Id: Ib96755d8e21d9b226e22fc985f13f34fa04117b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2018-08-24 11:05:38 +00:00
Eskil Abrahamsen Blomfeldt
f71048a531 Fix crash when combining QOpenGLWidget, QStaticText and Qt Quick
Under certain circumstances, if you had a widget with a QOpenGLPaintEngine,
and drew QStaticText into this, and then later had Qt Quick access the same
cache and try to resize it, we would get a crash because the resize function
would have a pointer to the paint engine and try to access its shader manager
(which would now be null, since this is outside the begin()/end() phase of the
paint engine.

The solution is to reset the paint engine pointer to null on the cache once it
has been populated and it is no longer needed.

[ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText,
QOpenGLWidget and Qt Quick in the same application.

Task-number: QTBUG-70096
Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-08-24 08:30:28 +00:00
Edward Welbourne
dc7e775c9c Test for fractional part of Costa Rican currency
CLDR up to somewhere between v29 (used by 5.9) and v31.0.1 (used by
5.10 and later) claimed Costa Ricans don't include fractions in their
currency; now it claims they expec two digits.  Apparently one of them
does expect those digits, so this is the regression test I'll be
cherry-picking back to LTS, to accompany the CLDR updates they need.

Task-number: QTBUG-70093
Change-Id: I138772cc6013fa74de4f7c54b836cac83421eab2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-23 12:54:53 +00:00
Tony Sarajärvi
c9c770d775 Extend blacklisting of tst_QWidget::maskedUpdate to cover all openSUSEs
Fails on previous 42.3 and also 15.0. Just covering "opensuse" saves
us from new commits every time we upgrade our openSUSE. We have a bug
open of it after all.

Task-number: QTBUG-51399
Change-Id: I5c0869daea41b1886faba3d0caaa0804a3705d54
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-08-22 14:32:55 +00:00
Liang Qi
ee51a2c4dc tests: blacklist tst_QDialog::showFullScreen() on macOS 10.13 in CI
Task-number: QTBUG-70109
Change-Id: I70b998c1853462f8ea2037cff59e9598923743e5
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2018-08-22 14:32:38 +00:00
Liang Qi
9be1256e0c Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12 2018-08-22 10:31:09 +00:00
Allan Sandfeld Jensen
dc82a0f4f3 Smooth image scaling for 64bit images
Adds support for smooth scaling 64bit images.

Task-number: QTBUG-45858
Change-Id: If46030fb8e7d684159f852a3b8266a74e5e6700c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-08-22 10:03:15 +00:00
Luca Beldi
02b3d43fd4 _q_interpolate<T> is unsafe with unsigned template arguments
_q_interpolate<T> subtracts 2 arguments of type T,
for unsigned types this can cause wrapping around

Task-number: QTBUG-57925
Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2018-08-22 08:38:44 +00:00
Liang Qi
7533156b68 Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts:
	src/gui/text/qtextengine.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
	tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h

Change-Id: Ib9f968edbb0f3387c89bc25e914321d0738bfadc
2018-08-22 10:35:12 +02:00
Friedemann Kleint
cf0ea18ac4 QWidgetWindow: Ensure Qt::WA_Mapped is set on obscured parent widgets
Frameless obscured windows do not receive WM_PAINT/expose events on
Windows. Qt::WA_Mapped needs to be set on them to ensure updating works.

Task-number: QTBUG-39220
Task-number: QTBUG-52039
Task-number: QTBUG-58575
Task-number: QTBUG-63927
Change-Id: Ic6c11f2be96378b6a6b61296f1f3e13cd49b50a6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-08-21 13:18:07 +00:00
Friedemann Kleint
65b95b61d6 MinGW: Exclude failing value of tst_QEasingCurve::setCustomType()
After updating MinGW toolchain from 5.3.0 to 7.30 test starts to fail.

Task-number: QTBUG-69947
Change-Id: I850d854b27e1cb4e1dd2cb600e8e79bd18bff4a0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2018-08-21 07:12:19 +00:00
Heikki Halmet
d3dc3e7743 Extend blacklisting of qeventdispatcher to cover WinRT
They have been blacklisted on windows and macOS previously. Now failing
on WinRT as well.

Task-number: QTBUG-69962
Change-Id: I30ca23005b082e820ee896fa36a8984a1536ad6b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-21 05:39:39 +00:00
Oswald Buddenhagen
5a03b75c50 Merge dev into 5.12
Change-Id: I63f632b595f66d2fc93e9aa713500e3799e3df2a
2018-08-21 02:32:50 +02:00
Johan Klokkhammer Helsing
b9923b30f0 tst_QWidget: Explain why some tests fail on Wayland
Task-number: QTBUG-66849
Change-Id: Ie6295bd402f6bc960c16f1e4b3b5a786017453e1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-08-20 10:04:22 +00:00
Eike Ziller
67984b265a QMimeDatabase: Fix MIME detection issues with magics in MIME hierarchies
Assume two MIME types A and B are registered, both with the same glob
pattern, A being parent of B, A with some magic rule, and B with another
magic rule. Given a file that matches the glob pattern and the magic rule
of A, the resulting MIME type depended on the order of registration of A
and B, because it would just check if some glob matching MIME type was
also a subclass of the magic matching MIME type.

The patch prefers the the MIME type that matches by magic if that
matches by glob pattern as well (i.e. A in our example).

The "recommended checking order" of the spec does handle that case.

Task-number: QTBUG-44846
Change-Id: I2af43f6199faf9a42cd9c35d3a045441afbd6217
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-20 07:32:58 +00:00
Samuel Gaist
346c15102b Add support for QRegularExpression to QSortFilterProxyModel
This patch implements the support for QRegularExpression in
QSortFilterProxyModel.

[ChangeLog][QtCore][QSFPM] QSortFilterProxyModel now supports
QRegularExpression.

Task-number: QTBUG-46810
Change-Id: If932d55f98f9b8bcf3a72c03ffd51da52cb50ad1
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-19 11:38:42 +00:00
Samuel Gaist
a2c85bffbe Migrate QDir to use QRegularExpression
The match method still uses QRegExp. This patch updates the code to use
QRegularExpression and translates the wildcard patterns to a suitable
form for QRegularExpression.

[ChangeLog][Core][QDir] QDir now uses QRegularExpression internally for
wildcard matching. Note that QRegularExpression might not give the
exact same result as QRegExp as its implementation follows strictly the
glob patterns definition for wildcard expressions. Nevertheless, the
tests for QDir return the same results as before.

Change-Id: I095959443ac7362f7534e35454eff038061fca82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-08-19 04:03:29 +00:00
Samuel Gaist
3746eb8412 QRegularExpression: refactor wildcard translation
This patch refactors the wildcardToRegularExpression method to generate
a simpler regular expression. It also fixes some shortcomings of the
previous implementation.

Tests have been updated to ensure all cases are properly supported.

Change-Id: I454e3fe8fe0bb663b2f319d6fa2fa8aec626c50d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-08-18 21:59:38 +00:00
Erik Verbruggen
ba9585bd02 [macOS] Skip test that triggers a buffer overflow in CoreFoundation
Deep down in CoreFoundation, ICU is used, and this test triggers a
heap-buffer-overflow with AddressSanitizer. Disable this test for macOS
until Apple fixes it.

Task-number: QTBUG-69875
Change-Id: I43e4a69708be8cde3bde87c57db21f5b717f96b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-08-17 15:04:16 +00:00
Liang Qi
ae5476eadc Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-17 12:22:55 +00:00
Andre de la Rocha
981b16d9ba Windows QPA: Fix mapping of static text accessibility role
QAccessible::StaticText should be mapped to UIA_TextControlTypeId instead
of UIA_EditControlTypeId.

Task-number: QTBUG-69894
Change-Id: If2f8f55d2be492c02a3af5b1813ca12cf774a33a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-17 08:53:20 +00:00
Luca Beldi
70ba75519d QSortFilterProxyModel inserting at bottom of source model
Before this change, if you try to insert a row at the bottom of QSortFilterProxyModel
the row will be inserted in the source model at position proxy->rowCount rather
than at the bottom. This causes insert at apparently random positions in the source.

[ChangeLog][QtCore][QSortFilterProxyModel]
QSortFilterProxyModel::insertRows(row,count,parent) with
row == QSortFilterProxyModel::rowCount will insert at the bottom of the source model
rather than at the row QSortFilterProxyModel::rowCount of the source model

Task-number: QTBUG-58499
Task-number: QTBUG-69158
Change-Id: Ie78416c8fbc429303b8c9c98375630e3e4d85f6d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 08:10:11 +00:00
Luca Beldi
d0069ff8c9 Add a method to clear the data to QStandardItemModel
After the behavior of setItemData has been changed following QTBUG-45114,
QStandardItemModel was lacking an interface to clear all the data from a single index.

Task-number: QTBUG-69616
Change-Id: Ide0b5bb6358439fc42c474df8b044fbace6def8d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-17 07:17:12 +00:00
Qt Forward Merge Bot
8842d9d1e6 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
2018-08-17 09:08:06 +02:00
Ulf Hermann
0a06e1baf9 Modernize the "thread" feature
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.

Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-08-17 00:34:36 +00:00
Thiago Macieira
b0479aab29 QUrl: Make sure we do reject URLs for which IDNA nameprep failed
qt_nameprep() already reset the string to its original length to
indicate failure, but we didn't handle that in qt_ACE_do(). So make it
have a return value whcih makes it easier to handle that case and do
handle it.

[ChangeLog][QtCore][QUrl] Fixed a bug that caused URLs whose hostnames
contained unassigned or prohibited Unicode codepoints to report
isValid() = true, despite clearing the hostname.

Change-Id: I41e7b3bced5944239f41fffd1545b7274c4b419d
Reviewed-by: David Faure <david.faure@kdab.com>
2018-08-16 19:34:52 +00:00
Liang Qi
d98106d1d5 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-08-16 18:59:13 +00:00
Liang Qi
8559bf934d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/corelib/global/qconfig-bootstrapped.h
	src/plugins/platforms/xcb/qxcbbackingstore.cpp

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Change-Id: I4af138ffb2f5306373244523768209e8873b2798
2018-08-16 18:48:59 +02:00
Samuel Gaist
30b0701c9b Refactor wildcard support in QRegularExpression
The API originally proposed was flawed in the sense that the setter
function would use a modified version of the parameter given which would
have make it a black box for the user. This patch fixes that by removing
that setter and providing a static method that will return the pattern
suitably modified to be used by QRegularExpression the same way the
escape method does.

[ChangeLog][Core][QRegularExpression] Implemented support for wildcard
patterns through a static method.

Change-Id: I0054bcaffd7525dac569f54fa81f73b7e4544b2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-16 16:30:14 +00:00
Mitch Curtis
37bb907a92 Add debugging output to help diagnose cause of tst_qspinbox failure
I've tried to reproduce the failures in the CI a couple of times now,
but it keeps passing. Let's leave some debug output in the test so
that if/when it does fail, we might know a bit more about why it does
so.

Task-number: QTBUG-69492
Change-Id: I5b39ac692e9026ce4b25cd13d342b11e061b777b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Nathan Collins <nathan.collins@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-08-16 10:17:04 +00:00
Edward Welbourne
bcf0be9b8f Avoid signed/unsigned warning in template
tst_QtEndian's transformRegion_template() was getting a
signed/unsigned comparison warning when T was unsigned in a
QCOMPARE(T-value, 0); so use T(0) instead.

Change-Id: I78cb2ab96f79393def65ed2c020aa3039017ab92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-08-16 10:10:22 +00:00