Both sqlite3_open_v2 and sqlite3_close are documented to return an error code:
https://www.sqlite.org/c3ref/open.htmlhttps://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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
...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>
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>
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>
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>
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>
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>
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>
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>
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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
_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>