The test is failing on aarch64 VM, when attempt reading
QSettings::childGroups for HKEY_CLASSES_ROOT. The returned list
contain precending '*'(astersk) node, which disappears at the second
call.
Task-number: QTBUG-135470
Change-Id: Ia8bb4c90d504353bb4e699a8133d63e7bae7afb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMainWindowLayout::unusedTabBars contains unparented tab bars.
They are leaked when QMainWindow and its layout get destroyed.
They still are in QApplication::allWidgets(), which attempts to delete
them eventually. When that happens, they try to remove themselves from
an already deleted QMainWindowLayout::unusedTabBars.
Delete all unused tab bars in the d'tor of QMainWindowLayout.
Task-number: QTBUG-135468
Pick-to: 6.9 6.8 6.5
Change-Id: I5ac7748ef738955522567db585e9505e3ba435ad
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends b6b489db6968fbc3b4aab3755d0166ee09712ff0, which introduced UB
(invalid downcast):
By the time the
QMainWindowTabBars are destroyed, and they want to unregister
themselves from the QMainWindow, the ex-QMainWindow has already been
demoted to a QWidget. Says UBSan:
qmainwindow.cpp:63:47: runtime error: member call on address 0x6040000267d0 which does not point to an object of type 'QMainWindow'
0x6040000267d0: note: object is of type 'QWidget'
00 00 00 00 28 c1 e6 f3 c7 7f 00 00 80 24 00 00 60 61 00 00 d8 c2 e6 f3 c7 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QWidget'
#0 0x7fc7f06da8c5 in QMainWindowPrivate::mainWindowLayout(QMainWindow const*) qmainwindow.cpp:63
#1 0x7fc7f06da8c5 in qt_mainwindow_layout(QMainWindow const*) qmainwindow.cpp:69
#2 0x7fc7f07bb4ed in QMainWindowTabBar::~QMainWindowTabBar() qmainwindowlayout.cpp:2042
#3 0x7fc7f07bf4e5 in QMainWindowTabBar::~QMainWindowTabBar() qmainwindowlayout.cpp:2047
#4 0x7fc7c69f9c2a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#5 0x7fc7ef0b7f3d in QWidget::~QWidget() qwidget.cpp:1557
#6 0x7fc7f082c7c7 in QDockWidgetGroupWindow::~QDockWidgetGroupWindow() qmainwindowlayout_p.h:343
#7 0x7fc7f082c7c7 in QDockWidgetGroupWindow::~QDockWidgetGroupWindow() qmainwindowlayout_p.h:343
#8 0x7fc7c69f9c2a in QObjectPrivate::deleteChildren() qobject.cpp:2226
#9 0x7fc7ef0b7f3d in QWidget::~QWidget() qwidget.cpp:1557
#10 0x7fc7f06ce495 in QMainWindow::~QMainWindow() qmainwindow.cpp:338
#12 0x556a6180a84c in std::default_delete<QMainWindow>::operator()(QMainWindow*) const unique_ptr.h:85
#13 0x556a6180a84c in std::unique_ptr<QMainWindow, std::default_delete<QMainWindow> >::~unique_ptr() unique_ptr.h:361
#14 0x556a6180a84c in tst_QDockWidget::setFloatingReparenting() tst_qdockwidget.cpp:492
Use qobject_cast to verify that the mainWindow is not pointing to a
QMainWindow that is being destroyed (and has passed the ~QMainWindow
destructor). If the main window is destroyed, then removing the tab bar
from the list of unused tab bars is unnecessary.
Pick-to: 6.9 6.8 6.5
Change-Id: I25e12d79198137b75cd2576ff1440b6c94277eba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Move it into a global static, so that we can allow changing it in a
follow-up commit.
Task-number: QTBUG-81979
Change-Id: I795002054f9aa7781157739b94fc2b85bcb61705
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Don't include QKdeTheme when Qt is built w/o DBus.
Change-Id: Iefa16ace1fbac2cad1fb964bfaecbe3e4f309f25
Found-by: juha.vuolle@qt.io
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Although timeanddate.com does claim Berlin was on double summer-time,
the IANA DB doesn't believe in it and the test itself found the text's
date-time to be valid, despite a comment claiming we expect it to be
invalid (which, these days, we wouldn't - it'd be corrected).
Change-Id: I726b28725da976a28410754681ae840e03b15b53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fix [*] means this already passes on dev; and the belated pick to
6.8 should get there before this does (it landed before 6.9, so did
not need picked there).
[*] commit 5d656e5085303bd427a4e8564818c65ec1d0ac26
On 6.8, without the fix, the ISODate test passes (that's handled by a
sui generis parser) but all three of the fromStringFormat tests of
QDate, and the QDatetime exact reproducer from the bug report, provoke
assertion failures.
Task-number: QTBUG-135382
Pick-to: 6.9 6.8
Change-Id: I303df9215873e37a9f2cbf5a78aab8ffa48f67aa
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Other test loggers just output things immediately, but the junit test
logger appends messages to a vector, so this needs to be
mutex-protected.
In case of qDebug()s from long-running threads, we also need
to protect creation/destruction of systemOutputElement and
systemErrorElement -- and in case of qFatal(), currentTestCase.
Pick-to: 6.9 6.8 6.5
Change-Id: If35055fc232276a778951ebbfeaccd185b04f46b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
On my machine, the window manager opened the QComboBox always at y = 0
(top edge of the screen), where the popup, being confined to the
screen geometry, had no chance of "open[ing] up centered on top of the
current index".
Fix by centering the widget on screen.
Amends 8393922e7071221a9c6c0811eb714f20bf4ed02b.
Pick-to: 6.9 6.8 6.5
Change-Id: I7b4d066aa1e555f3d5cc1d5e0c88b1d835bf2b26
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Purely from a symmetry argument, we should be disconnecting the old
item delegate, not the new one.
I didn't find a case where this actually causes test failures, nor did
I take the time to implement a test where it does.
Amends a126d3627cc347500c1a6bd82027efa6d451ccbd. That patch landed in
Qt 6.7, but that branch is "closed" at this point in time, so not
picking there now.
Pick-to: 6.9 6.8
Change-Id: I06b704e699616d61c65ad676ffe45dfbd9f8a870
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Tidies up the test output by removing expected warnings from the log
(and alerting us if they're missing).
Amends 64f6169f61ce8c982a1b92b20f930518a5f0d477, which introduced the
warning.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Idcef99d556b11035307e6e207cf31fc2f13ed291
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The minimumContentsLength() is user-settable, and tst_QComboBox
actually sets it to INT_MAX as some point. As such, the implementation
needs to defend itself from UB, either by limiting what values it
accepts as minimumContentsLength() or by making sure it doesn't cause
signed overflow in calculations involving this user-controlled
variable.
The former doesn't really work as long as the test checks that INT_MAX
is accepted as-is, so we need to do the latter.
Do the calculation in qint64, and use the result only when it doesn't
exceeed good old QWIDGETSIZE_MAX.
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I8aac7bda593095638c9c09db3b70b4c84e698419
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QProxyStyle's ctor arguments are not QObject parents, but the proxied
style, which becomes the proxy's QObject ... get this ... _child_.
What a broken concept... It means that this test function took
ownership of QApplication::style(), and the only way it wasn't going
to wreak havoc on the rest of the test functions was to leak it after
use.
To fix, create the style on the stack, so it gets automatically freed
by the compiler on all exists from the function. As a drive-by, use {}
instead of () to call the ctor (not to prevent C++' Most Vexing Parse,
just because it's easier on the eye).
The meat of the change, however, is in making the helper proxy-style
defend against QProxyStyle's grabbing of the baseStyle() as its child,
and managing baseStyle()->d->proxyStyle so we properly dissociate from
qApp->style() after we're done. Needed to use ctor delegation to
extract original parent and proxy model from the incoming style before
QProxyStyle, our first subobject, gets first picking on the style,
destroying the very state we're trying to preserve.
This should be become some QTest::LocalProxyStyle, if we find more
users of this pattern.
Amends 5cff7d2b679d48a247b4630cb9e3d5b04fab0b55.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I2abf4a0bf54158254fd8d526de55ad486ca4e296
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Both the QCompleter and the QSortFilterProxy objects are not owned by
the QComboBox merely by setting them as completer and model. Having no
other QObject parents, and having being allocated on the heap, they
were leaked.
To fix, give them the combo-box as QObject parent.
Amends 8b6d6d4832ea8ed5f9857d5ddf06408ee9d0b4e0.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I5c3594272a5283a3fbaeb9885d315047b04f30de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
A QComboBox does not own the model set on it, because models can be in
many views at once. So the QStringListModel, allocated on the heap
without a QObject parent was leaked.
Fix by giving the model the combo-box as QObject parent.
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Idd9057c8f796937d9d3c5c4ef99b329124d2192d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QItemDelegates are owned by neither the QComboBox directly, nor the
QComboBox::view(), upon a mere setItemDelegate() (the docs of this
function is pretty clear about that). Since the objects didn't have a
QObject parent, either, they were leaked.
To fix, give it the comboBox as a parent.
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: Ic8bc2603072070b458bd79a6129af6c76811f8ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Contrary to what the code comment suggested, a QComboBox does not own
the object passed in by setItemDelegate(). After a nullptr check, the
function merely forwards to QComboBox::view()->setItemDelegate() and
QAbstractItemView::setItemDelegate() documents very clearly that the
item delegate ownership does not change. Consequently, the test
function leaked the object.
To fix, hold it in a unique_ptr and reset() at the end of the code
block.
I opted to not merely comment in the delete there, because that would
still leak in case one of the QCOMPARE()s in-between failed. While it
is not the purpose of the current work to make tests leak-free even on
failure, it likewise makes little sense to not reap this small benefit
now, albeit at the cost of a bit of git history mess-up, itself
mediated by the fact that we're picking this all the way back, since
this...
Amends the start of the public history.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I1e604b795f5a12dc8829bf5913b88bc7c7110352
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QLineEdit remembers whether a QWidget size-widget came from a
QWidgetAction or is just one of its own QLineEditIconButtons. On
removal of the action, if QWidgetAction, it will ask the action to
deal with its widget, calling QWidgetAction::releaseWidget(),
otherwise it just deletes the QLineEditIconButton itself.
This is fine if the action is being removed from the line edit, but
not immediately deleted. But if the action is being deleted while its
widget is still in a QLineEdit, then the QLineEdit is informed of this
only by ~QAction(), at which point the QWidgetAction has ceased to
exist and the cast, in QLineEditPrivate::removeAction(), to
QWidgetAction is UB.
Says UBSan:
qlineedit_p.cpp:656:10: runtime error: downcast of address 0x6020000c3950 which does not point to an object of type 'QWidgetAction'
0x6020000c3950: note: object is of type 'QAction'
00 00 00 00 70 57 49 81 3d 7f 00 00 80 bc 0c 00 50 61 00 00 03 02 00 00 10 00 00 00 a6 01 00 71
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QAction'
#0 0x7f3d93910686 in QLineEditPrivate::removeAction(QAction*) qlineedit_p.cpp:656
#1 0x7f3d938b44bc in QLineEdit::event(QEvent*) qlineedit.cpp:1469
#2 0x7f3d91c50211 in QApplicationPrivate::notify_helper(QObject*, QEvent*) qapplication.cpp:3309
#3 0x7f3d91cd160a in QApplication::notify(QObject*, QEvent*) qapplication.cpp:3259
#4 0x7f3d697f6ada in QCoreApplication::notifyInternal2(QObject*, QEvent*) qcoreapplication.cpp:1111
#5 0x7f3d697f94e3 in QCoreApplication::sendEvent(QObject*, QEvent*) qcoreapplication.cpp:1551
#6 0x7f3d92345199 in QWidget::removeAction(QAction*) qwidget.cpp:3215
#7 0x7f3d92e47202 in QtWidgetsActionPrivate::destroy() qaction_widgets.cpp:35
#8 0x7f3d7f75d5fb in QAction::~QAction() qaction.cpp:451
#9 0x7f3d92e4cc76 in QWidgetAction::~QWidgetAction() qwidgetaction.cpp:94
#10 0x7f3d92e4e965 in QWidgetAction::~QWidgetAction() qwidgetaction.cpp:94
#11 0x558c993da3b0 in tst_QLineEdit::sideWidgets() tst_qlineedit.cpp:4693
To fix, check the dynamic type of the action (using qobject_cast)
before calling QWidgetAction::releaseWidget(). If the cast fails, the
QWidgetAction will have dealt with the widget itself, in its own dtor,
so QLineEdit needn't do anything.
Unfortunately, fixing this centrally by just dragging destroy() down
from ~QAction() to ~QWidgetAction() causes use-after-free in other
test functions of tst_QLineEdit, so I deciced to fix this at the
QLineEdit level only.
Amends 9ce12cc8de940cdd450a28f4bd079acfc3621aa3.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I3c514dbd1f1a4e1510df3dd9ac67b4bab50e63e9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The test uses the old-but-invalid trick of inheriting from a class X
to gain access to its private or protected parts, but then just
casting an object of dynamic type X to the newly derived class. This
is invalid, because the object is not actually of the newly-derived
type.
Says UBSan (excerpt):
tst_qtextedit.cpp:2273:5: runtime error: downcast of address 0x60400013c190 which does not point to an object of type 'PublicTextEdit'
0x60400013c190: note: object is of type 'QTextEdit'
00 00 00 00 70 bc 57 df b1 7f 00 00 80 66 30 00 90 61 00 00 70 be 57 df b1 7f 00 00 00 00 be be
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QTextEdit'
To fix, make QTextEdit befriend tst_QTextEdit. This is how we do it
elsewhere, too. Then remove the now-unused PublicTextEdit helper.
Amends the start of the public history, and, in one function,
56f0ebfe860e440dcbba8997f44836debc901119 (which is only in Qt 6.4+, so
the cherry-pick to 5.15 will have to drop the part in pasteFromMarkdown().
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I967238d84cae0f6dd8f05d0afb7a318292d96415
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The constructor new'ed up a MyPaintEngine, but there was no destructor
to delete the object again. Neither is ownership of the engine
transferred out of the class, so the object was leaked.
Fix by holding it in a unique_ptr.
Amends 391e3aeef45efc937979b44c32147206e389a60b.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I0c4da10d5a1659eceac0deba32cac757579e46c5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Instead of aggregating a QMutableSinglePointEvent by value, which
depends on the QEvent copy assignment operator, and casting it to a
QMouseEvent that it isn't, introduce QEventStorage which is a bit like
std::optional, but, by each event subclass befriending it, can store
event copies by-value, unlike clone(), which is restricted to the
heap. We could have befriended std::optional<QMouseEvent>, too, but by
adding our own type in _p.h, we can better control which code uses
this dangerous construct.
Added a guard to avoid clobbering lastMouseEvent with a copy of itself
in storeMouseEvent(). Before, we'd self-assign to lastMouseEvent,
which didn't invalidate the reference. Now, a store() is the
equivalent of a dtor + copy constructor, so we need to be a bit more
careful.
Fixes UBSan reports when running tst_qgraphicsview:
qgraphicsview/qgraphicsview.cpp:612:27: runtime error: downcast of address 0x61a000035e90 which does not point to an object of type 'QMouseEvent'
0x61a000035e90: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 02 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c7a47 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
qgraphicsview.cpp:653:39: runtime error: member call on address 0x61a0000fe290 which does not point to an object of type 'QMouseEvent'
0x61a0000fe290: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 05 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c3609 in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) qgraphicsview.cpp:653
#1 0x7f99a27c7832 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
qgraphicsview.cpp:654:37: runtime error: member call on address 0x61a0000fe290 which does not point to an object of type 'QMouseEvent'
0x61a0000fe290: note: object is of type 'QMutableSinglePointEvent'
00 00 00 00 30 47 ef 8b 99 7f 00 00 05 00 00 00 00 00 00 e0 d0 91 00 00 20 60 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QMutableSinglePointEvent'
#0 0x7f99a27c358b in QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent*) qgraphicsview.cpp:654
#1 0x7f99a27c7832 in QGraphicsViewPrivate::replayLastMouseEvent() qgraphicsview.cpp:612
Pick-to: 6.9
Task-number: QTBUG-99563
Change-Id: Ib642d416b8aef98c7fd8b1fa164ec2449189992a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The EXECUTABLE argument must point to the full path of the created
executable, not just the file name. Otherwise,
qt_deploy_runtime_dependencies won't file the file.
Pick-to: 6.8 6.9
Change-Id: I18b6214b9f46c0ad4b99ca57468fe272efb9d718
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There are various tests for this within the accessibility system.
Without it, it is not consistent what works and what does not work.
Task-number: QTBUG-134657
Change-Id: Idfa8905f377e2ef00a4d1af26cbf001064bc75dc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QAbstractItemModel represents a table of tables where each item can
have an entire table-hierarchy as children. In practice, it is enough
to support a hierarchy of rows: that's what our views can display,
and what users are familiar with.
With this limitation, a data structure represents a tree if it's
possible to traverse that hierarchy. For each row, we need to be
able to navigate to the parent row (which might be nil if the row
is a top-level row), and get the (optional) list of children.
To enable this, we introduce a protocol type that QGIM can be
instantiated with, either explicitly or implicitly.
An explicit protocol provides implementations for parentRow and
childRows. Const overloads are mandatory, mutable overloads are
optional and allow modifying the tree structure as well. A
modifyable tree might in addition need to create a row object, as
new rows have to be hooked up with parent and child relationships.
And a tree must be able to destroy row objects as well when rows
are removed.
An implicit protocol means that the row type implements this
protocol through member functions. We detect this at compile time
and implement tree support for ranges with an appropriate row
type.
This implements a first ownership model as well: if the range was
moved into the model, then the owner of the model cannot/must not
do anything with the container anymore, so also cannot delete the
rows. We have to do so. Detect that we are operating on a moved-in
container, and delete all rows if so.
To make the code more readable, use explicitly named types for the
implementation of the model structure, with dedicated and clearly
constrained QGIM constructors.
Change-Id: Iaf19c27da6ec8604923ec7c0c2523c7d62edee50
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
To benefit from -Wswitch compiler flag, requested by Marc in code
review.
Define supportsAlgorithm() twice, with/without USING_OPENSSL, amends
9248d0cfbee0805d670f4b6b07bd3bf4003d6263.
Pick-to: 6.9
Change-Id: I236093532196689bc0828131360dfeeb24fac23f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It was added in 44cb71d6fdb0b7285d4ef74a1ef778323aa9e5ee to reduce the
size of the bootstrap lib.
Since commit c7f64d84fbd9b5b3cac41c1d81dc4d0479fc3fa1 removed
QCryptographicHash from the bootstrap lib, the macro is now
redundant (unless it's used by QtLite).
Change-Id: I5459a52507bc9e0a7b982b4382211be9a23c4ad9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMetaType::Void is not constructible, so create() will return nullptr,
and even though sizeOf() returns 0, calling memcmp() is still UB in
that case.
Fix by guarding the memcmp() from QMetaType::Void.
Amends a59e7361714d50687d82a2d9abae9e95825a23b6.
Pick-to: 6.9 6.8 6.5
Change-Id: I55896826e6c0cad5d77e9d0ab861efa9a32f780f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Map PageTabList controls (i.e. QTabBar) to the TabGroup role, and
report the list of PageTabs as the tabs. Add a predicate-argument
to the unignoredChildren() function so that we can re-use that
logic to return the list of tabs, while also ignoring otherwise
accessible children, such as the scroll buttons.
Change-Id: I57472e9213dd178e018449e542de276051097073
Fixes: QTBUG-134807
Pick-to: 6.9 6.8
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In some cases there are no explicit notification APIs for
changes to system settings, and the developer is expected
to observe changes to the registry keys directly.
For example this applies to color profile associations, as
documented in:
https://learn.microsoft.com/en-us/windows/win32/wcs/wcs-registry-keys
Change-Id: I3507058d90b1d32b8b5256f40861126277242cd6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace an if-chain with a switch statement, and remove the duplicate
test for QAccessible::Client - we already ignore all such elements,
no matter their special role name.
Compare an object's className as a QByteArrayView, no need to expand to
a UTF16 QString just to compare with a Latin1 literal.
Pick-to: 6.9 6.8
Change-Id: I79f52277e4177f2a688216b7f5ef7469cfe0534c
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
We have QT_LOGGING_RULES nowadays, and the verbosity levels for
QWindowsContext are controlled by the `verbose` platform plugin
argument.
Change-Id: I3f998afaa962220b7babb093c030d0798e450db0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Helps debugging to know which key you're working with, if
all you have is a QWinRegistryKey instance.
Change-Id: I09aa2d997871ff46c455ee0d1a566d858163d19e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After c5792dcfd631abb4f9e2b92cd6e88d7e5c373406 the last cursor position
is reflected as a QPoint(std::numeric_limits<int>::max(), ...), and
after 209a2145f94e99f99832c3a08cdf579d8f42ca55 as 1 << 23. Instead of
hard coding the sentinel value, let's use QLastCursorPosition directly.
Pick-to: 6.9 6.8 6.5
Change-Id: I24031f3cc800d2f0028eb95f4f8597019cc945c0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We don't need two independent Q_GLOBAL_STATIC variables: one for the
default category and the other for the logging registry. We can simply
save one in the other.
However, we can do better than even that. QLoggingCategory currently
doesn't hold any allocated resources: the const char *name points to a
static string and the void *d is always null. That means the constructor
and destructor only serve to register and unregister the category with
QLoggingRegistry, so we transfer that responsibility to QLoggingRegistry
itself (the un-registering is implicit in the registry's own
destruction).
The benefit of this is that the default QLoggingCategory can never be
found in a destroyed state, however late user code may be running after
::exit() was called. We have had a number of these issues of
De-Initialization Order Fiasco, especially since the changes to
QThreadData destruction timing.
Pick-to: 6.9
Change-Id: I2b6ea597ac257837669afffde2684c7b44a42e92
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Don't assume that this call to QLoggingRegistry::instance() was the
first in the test application's execution.
Change-Id: Ia2d32ed7c4d930bef30efffd0b7d38a536b95772
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We store timestamps as utc in the database but QSqlDriver::formatValue()
does not format the datetime string as utc. Fix it by converting the
datetime object to utc first.
This amends 2781c3b6248fe4410a7afffd41bad72d8567fc95
Pick-to: 6.9 6.8
Fixes: QTBUG-135135
Change-Id: Id26b251e9ed9800d6caff7f43de25fd9e9b08f43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Rename the parameter 'code' to 'nativeErrorCode' to match the getter
nativeErrorCode() with the ctor's parameters.
Pick-to: 6.9 6.8
Change-Id: Ic95b45c75a57796536d845249c719b5d0d0e7587
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The windows11 style, in contrast to the windows vista style, draws the
indicator on the side. Therefore call QWindowsStyle::sizeHint() for
CT_HeaderSection as the base style has the correct implementation.
Pick-to: 6.9 6.8
Fixes: QTBUG-135338
Change-Id: If84f72f9f26e87617ecebb1a01f448219d8656ba
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
The WatchDog thread calls printTestRunTime() which reads the two
timers, created and started in the main thread.
Pick-to: 6.9 6.8 6.5
Change-Id: I1a337648fddf87190075b7902311544d0ab21ac3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Amends c7691842f743f568a073582c8f0cacd6ee188f98, and actually fixes the
other half of QTBUG-130142.
Fix the unittest, it was wrong to begin with, iterating over an empty
string with NoDotAndDotDot, next() will always return an empty string
because `currentFileInfo` has never been initialized.
Pick-to: 6.9 6.8
Fixes: QTBUG-135287
Task-number: QTBUG-130142
Change-Id: I9966428c7a143803e6e934b5970ea6b6afc8a08f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... before using next/nextFileInfo(). That's both more logical and
safer; this is analogous to always checking `iterator != end` before
using said iterator.
Change-Id: I87583f645087d34fc3e76e77f1ac168f76b6868e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit c83304af27b403c9ebe64d4c768da25e04acafc1.
The original behavior is going to be finally restored by the next
commits in this chain.
Task-number: QTBUG-135287
Change-Id: Iae38d5d9271a77da9d9b1c938ccc73c7531d89d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit 351b7a31aa24a704dba09121d91cb34190892315 added a new feature of
wrapping the generated D-Bus proxies into custom namespaces. Use this
feature to avoid potential clashes with the proxies generated by other
modules (see QTBUG-133553 as an example).
Amends 38251c36edf11316a2467169b1d491bf13520fd3, but keeping it only
in dev because it depends on the new feature of qdbusxml2cpp.
Task-number: QTBUG-134305
Change-Id: I585cdda3f002ef7fa6dd3a76a3b4f2c9c68d2297
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
As far as I can tell, QUuid is working correctly on big endian
platforms. But it stores the integers in such a weird fashion (I wish to
fix that for Qt 7) that this test is non-obvious.
I don't have a big-endian machine to test this with. Anyone interested
is welcome to submit patches.
Fixes: QTBUG-134634
Pick-to: 6.8 6.9
Change-Id: I2415be976d1d880d1525fffdf525dcf4f21aaa70
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The user may set different global defaults for CMAKE_MACOSX_BUNDLE
and CMAKE_WIN32_EXECUTABLE, so we shouldn't unconditionally override
them on a target level.
This allows cmake ~/foo/ -DCMAKE_MACOSX_BUNDLE=ON to build a project
as a GUI app without needing to modify the CMakeLists.txt with target
specific overrides.
Change-Id: Id49adb1c0aedfe82a2b1d919d086c5112ba92b93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>