81e298a51d fixed a case where the focus
chain was screwed up when the order was already correct. This worked
correctly in most cases but not when the next focus widget of the first
one had Qt::NoFocus.
The optimization check if lastFocusChildOfFirst is the same as second is
thrown away since it now does not longer screw up the focus chain and
the save would only be four pointer assignments.
Fixes: QTBUG-75388
Task-number: QTBUG-10907
Task-number: QTBUG-68393
Task-number: QTBUG-69619
Change-Id: I581ed532156c34ea970123afd063194aab016304
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This is the worst fix ever, adding one more qWait. The test has been
updated in the 5.13 branch, so there a different fix will be needed. For
now this is in line with the rest of the code.
This test is currently one of the worst offenders when it comes to flaky
tests.
Task-number: QTBUG-64639
Change-Id: Ia1e71cc948997408b9658839013c9ad098111033
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Now that it's trying to guess whether the type is markdown based on
the file extension, there needs to be a way to override it. For example
it might be arranged that directory listings will be generated in
markdown format instead of HTML; then when loading a source URL that
is a directory, the application may override the type. The type for
the single-argument setSource(url) is UnknownResource to preserve
the existing behavior, but the user can override the guessing by
setting a specific type.
Change-Id: Id111efd24de7d8fd18c47b16a2d58f5b09d77891
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
When using a texture for foreground color in text and copy-pasting
the text inside the same QTextEdit, the formatting would disappear.
Fixing this in a general way would require implementing some
other carrier format in the mime data than HTML, such as e.g ODF,
but it can quite easily be fixed for the case where the data
is pasted in the same document, or even different documents
as long as they have a reference to the image in the formats.
[ChangeLog][QtWidgets][QTextEdit] Added support for copy-pasting
foreground brushes with textures within same document.
Task-number: QTBUG-75931
Change-Id: I8b39dce289c64eea39e25cb8eb207e2534bcd2eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I2e1b42c09db88da64ec62aee7906f4c368e5bcbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
- Use nullptr
- Fix warning about inconsistent parameter naming in CsvCompleter::pathFromIndex()
- Fix C-style casts
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
slow tests
- Use initializer lists
- Fix the class declarations, use override, member initializations
- Remove goto, streamline code
- Use auto to avoid repeating the type
- Introduce std::unique_ptr
Task-number: QTBUG-38014
Change-Id: Ia8ecd799064d630648b385b606848d7474c51363
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Use the comparison helpers to do fuzzy checking of geometries.
Change-Id: I00f4403f3bca2e8a3996e938a85ba799e083058c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
- Move the fuzz check introduced by
6309062722 to a shared header for
reuse. Use it in in more places to account for rounding errors
introduced by odd window frame sizes when scaling is active.
- Use the test widget size to ensure windows do not violate the
minimum decorated window size on Windows when scaling is inactive
on large monitors.
Task-number: QTBUG-46615
Change-Id: Icf803a4bc2c275eadb8f98e60b08e39b2ebebedd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The window tends to grow to span screens in multi-screen setups; force it to
be on the primary screen by showing it maximized in that case.
Change-Id: I984ba7a4cd4abd1f862c59c8dca0e2275f44c724
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
- Use nullptr
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
slow tests
- Fix the class declarations, use override, member initializations
- Use Qt 5 connection syntax where possible
- Ensure top level widget list is empty after each test, delete left-over
menu bars and disable menu animations
Change-Id: Ieeb943ea669cd139f1835088b816802e777a9676
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use a fuzz check (cf 6309062722) and a minimum
size similar to tst_qwidget to make the test pass on large monitors with or
without active scaling.
Change-Id: I5a9e28e38e1d007057894c349c94f0e6fe12009c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
- Use nullptr
- Fix C-style casts
- Fix redundant bool expressions
- Fix else after return
- Remove unnecessary casts to int from registered enums
- Fix most signedness-related warnings
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
slow tests
- Fix the class declarations, use override, member initializations
- Use Qt 5 connection syntax
- Remove unused variables
- Streamline code in some cases
Change-Id: I1350b382b0b7d0f3198039fdc78892cfa1dd498d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- Use nullptr
- Fix C-style casts
- Use range-based for
- Use correct static invocation
- Set a title on shown windows to make it possible to identify
slow tests
- Fix the class declarations, use override, member initializations
- Use Qt 5 connection syntax; use lambdas where applicable
to remove helper slots
- Streamline code in some cases
- Replace helper function to convert touch points by the one in
QWindowSystemInterfacePrivate
- Use a logging category for the debug outpt, silencing some output
Change-Id: Ia46c7ad7c08f3afc8e5869ea99b66e406de97781
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
When re-parenting, some widgets change their children. For example
QLabel, when set to rich text, will not update, until receiving a polish
call, at which time getting a list of all children recursively and then
trying to call functions on them will crash, since the children change
in the middle of this operation.
Fixes: QTBUG-69204
Fixes: QTBUG-74667
Change-Id: I95dd83ebeed14c017e22552ddd47658ae8a09353
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
- Remove unused dummyWidget and thus empty slots initTestCase(),
cleanupTestCase().
- Add slot cleanup() checking for an empty top level widgets list
and introduce QScopedPointer to ensure it passes.
- Use QTRY_VERIFY in hideAndShowOnWindowStateChange().
Flakyness has been observed on openSUSE:
FAIL! : tst_QSizeGrip::hideAndShowOnWindowStateChange(Qt::Window) '!sizeGrip->isVisible()' returned FALSE. ()
Loc: [tst_qsizegrip.cpp(126)]
Change-Id: I340fc1892dc00bcff1985e5a8a1e535975736484
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
DragEnter events always should start with the default state, which
is accepted = false. This was a copy-and-paste error introduced by
f8944a7f07.
Fixes: QTBUG-73977
Change-Id: I34b3ea97c9b4f4fc040a9e6f1befd6124533361d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Set object names on the widgets in restoreState(), fixing:
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QDockWidget 0x7ffcb45e5e00 ';
QWARN : tst_QMainWindow::restoreState() QMainWindow::saveState(): 'objectName' not set for QToolBar 0x7ffcb45e5dd0 ''
Task-number: QTBUG-74242
Change-Id: I19f19e93de9df00d001b820a31836ce0b3cd2877
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When set to ExclusiveOptional, the new exclusionPolicy property let the
user uncheck the active checkable action in an exclusive group.
[ChangeLog][QtWidgets][QActionGroup] Added new exclusionPolicy
property. Set it to ExclusiveOptional to allow unchecking the active
checkable action in an exclusive group.
Change-Id: I61a9885cfd076d631cddf8c08313e4b488e5dc38
Fixes: QTBUG-71160
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use QTRY_COMPARE to fix recent fails like
FAIL! : tst_QGraphicsView::cursor2() Compared values are not the same
Actual (view.viewport()->cursor().shape()): IBeamCursor
Expected (Qt::SizeAllCursor) : SizeAllCursor
Task-number: QTBUG-76259
Change-Id: Ie9d4bbe45a3be6064ec88ee237360beb92a61481
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
It's really failing only on Windows 10 it seems.
Task-number: QTBUG-76259
Change-Id: Ieb541dc994a17e82478a5cc2643e0a89fd5aa97d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Fix some ui glitches for QAbstractSpinBox:
- update geometry when buttons are toggled on/off
- calc button size with subControlRect instead hardcoded 20px
- when buttons are not shown, don't add the button size in
sizeFromContents for common and macOS style
Fixes: QTBUG-39713
Fixes: QTBUG-75303
Task-number: QTBUG-67126
Change-Id: Ibf330c76deb16358a481bba6bd429fff6a5d57ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QT_DEPRECATED_X() was not added with
d6d33f0b80 for the deprecated
QComboBox functions - Add them now.
Change-Id: I8d4ea08766ae6ff052dfccac6c3f35ecf34affb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This is a regression introduced by 63967313f5 which blocked signals
on the view, but not on the model.
Change-Id: Ib2f93fe6ef842264aaba200c98ee4a19065ca220
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
If columns are removed and we get notified via layoutChanged, the code
tries to restore old section sizes, and went out of bounds, leading to
an assert in QVector. Simply add an if() to skip restoring out-of-bounds columns.
This comes from https://bugs.kde.org/show_bug.cgi?id=395181,
which translates into the unittest that is part of this commit.
Change-Id: Ide42176a758f87b21957c40508127d67f1d5a2d9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
QDoubleSpinBox did not resize when setPrefix() was called because the
cached size hint was not reset.
Fix it by resetting the cached size hints and update the geometry the
same way it's done for QSpinBox::setPrefix().
Fixes: QTBUG-74520
Change-Id: I6f42a24ab0a4ce987ecbe1505a634d929474436b
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>