The code that updates a section size must also update length,
otherwise saveState can end up saving inconsistent state, and
restoreState() goes to an early-return, not doing anything.
The actual bug was fixed meanwhile because _q_sectionsChanged is called
again, which recalculates length. I still see this only as a safety
measure, every other code path that changes section sizes updates length
right away.
Change-Id: I6cc16261692d93b3640afafef600a5bdff8dca0c
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Before running tests that depend on QWindow::requestActivate
Gets rid of several Wayland platform checks in tst_QWindow.
Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
And make it easier to fix if platformName == wayland-egl etc.
Change-Id: Ia2d62ba003796e08f3e8a5bbfd0c3fd9d185e4e0
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
By using qWaitForWindowExposed instead of qWaitForWindowActivated.
Task-number: QTBUG-66824
Change-Id: Idf604157070731d9c92ccf64d8349c8571960b7c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The test actually passes, so there's no need to skip it.
Task-number: QTBUG-66824
Change-Id: Id091776ff7ca7637fdcf0e0ced833982b5788d92
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Has been flaky in CI.
Task-number: QTBUG-66815
Task-number: QTBUG-66216
Change-Id: I2c3eb42507eae618486aa402474b4b3f85ff310e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This follows on from a232251992 which
covered a similar instance of this. As with that change, we should not
abort the compilation, just ignore it.
Task-number: QTBUG-63772
Change-Id: Ide958080a90f43ed19edd8a320e7d45de1c96821
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When first starting an Android app we have invocation order issue, to
load the platform plugin we create the default QLocale (needed by the
resource locator code to see if :/qt/etc/qt.conf exists) so when the
android platform plugin loads and creates its own QSystemLocale, the
QLocale defaultLocalePrivate is already created and pointing to
globalLocaleData which means that systemData won't be called and thus
the code that triggers the call to QLocalePrivate::updateSystemPrivate
won't be called when calling QLocale().
I thought of two ways of fixing this, one was calling
QLocalePrivate::updateSystemPrivatea() from the QAndroidSystemLocale
constructor, but giving the responsibility to not break things to the
plugin seems a little fragile, so making the check on QLocale()
seems better.
Without this patch an Android app doing
QApplication app(argc, argv);
qDebug() << QLocale().name();
qDebug() << QLocale().name();
qDebug() << QLocale::system().name();
qDebug() << QLocale().name();
would print
""
""
"ca_ES"
"ca_ES"
now it correctly prints "ca_ES" the four times.
Task-number: QTBUG-41385
Change-Id: I2cf419f59aa008fa3aca11295fe7d42c40bcc32e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Silence debug output by setting QT_LOGGING_RULES
to turn off all debug output.
Task-number: QTQAINFRA-1631
Change-Id: I5c2366b4fe4bac341dcfd92f68b6da8071c5b089
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Evaluating testlib's XML output in COIN would fail with:
"XML syntax error on line 7520: invalid UTF-8"
for the toLatin1() tests due to some Latin1/UTF8 mixup.
Add a helper function to convert the data to plain ASCII.
Task-number: QTQAINFRA-1797
Change-Id: I1c64878d4c2a67b8c2689905b5ffe6707b5963c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The test has been crashing flakily recently.
1) It is creating a QGLWidget
2) It is stealing the QGLContext of that widget and moves it into a separate
thread.
3) In that secondary thread it makes the context current.
4) Meanwhile the QGLWidget itself may receive for example a resizeEvent or
other events and - since it assumes that it owns the context - attempts to
make it current.
5) Attempting to call makeCurrent() on a QGLContext that is in a different
thread than the current thread (via QObject thread affinity) will result
in a call to qFatal() and consequently the test aborts.
The conclusion from Simon Hausmann is that this test is testing a pattern from
Qt4 times that may or may not have worked back then. Nowadays with the Qt5
QOpenGL* API we do support this properly and there appears little sense testing
this.
Therefore remove the test altogether.
Task-number: QTBUG-66411
Task-number: QTBUG-66216
Change-Id: Ie2d66705bc7c3914ace6abcba9557c7c67ad4db3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This test executable was not flaky in the normal sense that when run, it
sometimes passes and sometimes fails. Instead, in some builds it would fail
consistently and in some builds it would pass consistently.
The first test to fail was version(ok00, default to last version) which gives
"mylib" as the library name and -1 as the library version. The description
implies that QLibrary selects the biggest or last used version when given -1.
However, versions less than 0 are not used at all. Instead the loading uses only
the name to select the library. Change the description to match.
So why did the test sometimes pass, sometimes fail? The test uses two library
projects lib and lib2 which install two different major versions of libmylib.
That includes the symbolic links:
libmylib.so -> libmylib.so.1.0.0*
libmylib.so.1 -> libmylib.so.1.0.0*
libmylib.so.1.0 -> libmylib.so.1.0.0*
libmylib.so.1.0.0*
libmylib.so -> libmylib.so.2.0.0*
libmylib.so.2 -> libmylib.so.2.0.0*
libmylib.so.2.0 -> libmylib.so.2.0.0*
libmylib.so.2.0.0*
The key thing being that both set the libmylib.so symbolic link. In a
multithreaded installation it's undefined which happens to set the link last.
The test code expected libmylib.so to point to libmylib.so.2.0.0. Ensure that by
building and installing lib2 after lib.
Task-number: QTBUG-66722
Task-number: QTBUG-66216
Change-Id: Ic513c772902273049c28e43fc1d83d550aafcd23
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtCore][QJsonValue] fromVariant() conversion now converts
from QUrl and QUuid using special encoding forms to ensure best JSON
compatibility.
Change-Id: I56b444f9d6274221a3b7fffd150cdc5ca1f87ff1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
For compatibility with other parsers that may expect it to be so.
Change-Id: I56b444f9d6274221a3b7fffd150cd66390f98fd5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
After a37785ec76 went in, it become
apparent that multi mouse button state handling in qtestlib is
non-existent, for details see QTBUG-64030 and QTBUG-63786. What
happened behind the scenes often was not what one would expect based
on the provided QTest::mouse* input sequence - events went missing,
incorrect events were generated, each subsequent test function
started with a state set from the function that run earlier. It is
easy to see how a minor change in one test could easily affect outcome
of other tests.
With a37785ec76, Qt platform plugins
are now responsible for sending explicit mouse button type and state
information; qtestlib should take full responsibility now as well.
But using the new API from a37785ec7 alone in qtestlib is not sufficient.
We need to reset mouse state between each new test function run (we do
this at function scope as that fits with the current qtestlib API user
expectations). This patch implements the necessary reseting logic.
Updated tst_qwindow.cpp::generatedMouseMove() to use QTest::mouse* APIs.
That test requires pressing multiple buttons, it was not possible with
QTest::mouse* APIs before this patch.
Added an auto test for multiple mouse button pressing/release in
tests/auto/testlib/selftests/mouse/. And few other tests which are
currently QSKIP-ed, but should be considered when re-designing qtestlib
APIs.
Task-number: QTBUG-64030
Change-Id: I39fdcbc73a467a7463ce2aed622bf22484095635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Factor out a function to calculate the size and update the size when a
style sheet parent is set.
Task-number: QTBUG-64550
Change-Id: I3afe997085eae3cd48b7fe0a4c98582a8f572260
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Return value of qWaitForWindowActive should be checked as it is marked
Q_REQUIRED_RESULT.
One of the calls was failing, so remove it and wait for the next condition
instead.
Amends d0dffdfc01.
Change-Id: I0c0b2bf11504730477158a5e1fb3018f359a6fb9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The stdout of the processes used in the test was dumped if there was an error,
but the processes write their error messages to stderr.
Use MergedChannels process channel mode to dump both output streams.
Change-Id: I1645fd31c394da0871ee6ae36d37ca9a04d86052
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Before there was a risk looking up e.g index -1 if there
were no visible sections in layoutAboutToChange.
Change-Id: Ic911e4292e8e8c4892fef1c0f34cf7dccaad2bac
Task-number: QTBUG-65478
Reviewed-by: David Faure <david.faure@kdab.com>
The refactoring to support multiple providers broke alias resolving
(e.g. "text/directory" would be an invalid mimetype, instead of being
resolved to "text/vcard"). The unittest didn't catch it because most of
it was running with a single mime directory (and therefore a single provider,
in the new model). Fixed by re-running a number of test methods once we
have a second mime directory.
Change-Id: Ib5da89ba79c11ed41813b2aff4bc71c30afcde7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The UBA in Qt was out of date, implementing the spec from pre
Unicode 6.3 days. It missed handling of directional isolates and
paired brackets.
This adds a completely new implementation of the UBA, that is
compliant with Unicode 10.
Added the test data from Unicode 10 to the qcomplextext auto
test and ensure that we pass the test suite.
Task-number: QTBUG-57743
Change-Id: Ie2d957bc9775d82f0a51d1c78dc6bd154f22847c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Has been flaky in CI.
Task-number: QTBUG-66708
Task-number: QTBUG-66216
Change-Id: I69878574a98139681100c1424d5bbf46cc4a87b8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The test's client processes are prepared for the server not being ready when
they try to connect and handle QLocalSocket::ServerNotFoundError by waiting and
trying again.
However, on Ubuntu 16.04 and 17.10 and possibly other systems, sometimes the
error returned by qt_safe_connect inside QLocalSocket is ECONNREFUSED instead of
ENOENT. This has caused flaky failures in CI, so wait and try again in the case
of QLocalSocket::ConnectionRefusedError also.
Task-number: QTBUG-66679
Task-number: QTBUG-66216
Change-Id: I61e3d5b052d84c5ba9d1746f2c71db37cedbf925
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Has been failing a lot lately
Task-number: QTBUG-66247
Change-Id: Id940a573eb299379cacceb836890cbe0b3c896b7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
If _Thread_local is used on a block-scope declaration, it must be
combined with either static or extern to decide linkage.
Change-Id: I228b3520767197c6cdf5134ff5a666ab2aca33ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the table for a selected column can't be determined (e.g. because
there is no table for it), PQftable returns InvalidOid. This was not
covered and a query to determine the table name was executed every
time which slowed down calls to QSqlQuery::value(QString).
Task-number: QTBUG-65226
Change-Id: Idd8fbaaef7b01ca4151439f46cad2cce6f1c93e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Without any content it was hard to see the window. Put some lipstick on it.
Change-Id: I0fefffb0a4deba7ac91e67a6153a9a27308fe493
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The latter would allow one final resize that would immediately
jump to 300x300.
Change-Id: I566e5e9dc1fb07f748f528f002166a8438344173
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
They can be, if compiled with -Wl,-pie. Example:
$ file /usr/bin/ping
/usr/bin/ping: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0
And you can't detect via the interpreter, since libraries can have
them too:
$ file /lib64/libc-2.26.so libQt5Core.so.5.11.0
/lib64/libc-2.26.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2
libQt5Core.so.5.11.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.17.0
Change-Id: I940917d6763842499b18fffd15143bb80ce0e531
Reviewed-by: David Faure <david.faure@kdab.com>
Do not clear the settings of QHeaderView during layoutChange when the
model is empty and the section count did not change. This will not work
when a section is moved or a section is replaced with a new one during
layoutChange. But since layoutChanged is also called on sorting, this
patch ensures that the settings are not cleared in this case.
This restores the behavior to the same as before 5.9.4.
Task-number: QTBUG-66444
Task-number: QTBUG-65478
Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
During (re)storing the sections within layoutChanged handling, the
hidden section size was not properly stored which lead to a section
size of 0 when the section was unhided afterwards.
Task-number: QTBUG-66413
Task-number: QTBUG-65478
Change-Id: I0b714c7e0530a1eae82b3bb0e0dc80ed576522d0
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Currently there is a bug in Qt regarding the PostgreSQL driver as it
does not correctly escape the table names when constructing queries
internally. Therefore, these tests are marked as expected failures until
the bug itself is fixed in Qt.
Change-Id: I74dadc187f8a08509128dfea27be99787e57ea51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This also accounts for some quirks on the PostgreSQL side:
- Null values for a related table are placed in a different
order when sorted.
- Functions (sum, count) return a different type than other databases
- Using quotes to account for case sensitivity with tables
Task-number: QTBUG-63861
Change-Id: Ib1894fa8d0c77d7045941f7c57be0d0acd8d117e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
TouchEvent::TouchPoint::pos was not updated in
QGraphicsScenePrivate::updateTouchPointsForItem().
To prevent the transformation being calculated repeatedly for each touch
point member, extract a function genericMapFromSceneTransform()
from genericMapFromScene() returning the transformation and use
that whereever multiple points are transformed.
Add a test, extracting helper functionality from
tst_QGraphicsItem::touchEventPropagation().
In addition, fold tst_QGraphicsScene::checkTouchPointsEllipseDiameters() from
c48f4bde00 into this test, so that
it is testing all transformations.
Task-number: QTBUG-66192
Change-Id: If71886d2c14c4e216f7781ea2f22f1adc444e6cf
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Since the PlatformInputContext is shared between test cases, the set commit
string from inputMethod() was otherwise saved and could pollute other tests.
For example on Windows PlatformInputContext::commit() was called when the
QLineEdit was first clicked onto in tst_QLineEdit::testQuickSelectionWithMouse()
and inserted "text" in the middle of the text, rather than starting selection as
intended.
This led to tst_QLineEdit::testQuickSelectionWithMouse() failing on Windows at
first in CI, but then always passing the repeats when it was tested alone.
Task-number: QTBUG-66499
Task-number: QTBUG-66216
Change-Id: Id6bdd263d57fd6d08fb48f013542b55b132907ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Fix 'Too many segments for object format' errors for (Debug) builds
using Windows ICC.
Change-Id: Ie48f43199948477c426d0a4e557f039eda129b22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix 'unresolved external symbol __imp_Reg*' errors for builds
using Windows ICC.
Change-Id: I99cb6d53c45cadb31b5675182753f168a7bf4ea3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Switch to QTRY_COMPARE since thread-local references might be held shortly
after finished is signalled.
Change-Id: Ia32f1f45f6cc461352558e0f2acf9612f8a4639e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>