The completer popup has focus, making QShortcut direct to it's window
rather than to the window the completer belongs to. As QShortcut handles
the case for Tool windows that have a parent, but doens't do the same
for popups. And they shouldn't be treated the same way, as a context
menu popup for a e.g. text edit should in fact block the text edit's
shortcuts while open.
However, the completer popup is special, in that it explicitly makes the
widget completes for its focusProxy, which is what we can use to fix
this issue.
Change-Id: Ie7177d39668b3af14a1d9e0ee5d93eca9c67c8af
Fixes: QTBUG-4485
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
QListView::setSelection() algorithm is designed for items to
occupy their cells completely, which is not the case when
itemAlignment is used. The middle part of the selection rect
goes beyond the column borders and extra items are selected.
Use the introduced cellRectForIndex() instead of rectForIndex()
to calculate the middle part correctly.
Fixes: QTBUG-73684
Change-Id: I4a1e42a056d56e85a16d8ae0ffe18b78d1d6deb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
With a QTreeView it is possible that collapsing an item can cause the
item under the mouse to be a new one and over the checkbox area for the
new item. As a result, a release can cause it to change the check state
even though it did not get the press for that item. This ensures that
it only allows the edit if it got the press as well.
Fixes: QTBUG-61476
Change-Id: I9a0821466afc84c97c9819755ccbacd729f7fbd7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Due to removal of insignificant flag in
tst_qfilesystemmode.pro a bunch of tests will
either fail or crash in different operating systems.
Task-number: QTBUG-70572
Task-number: QTBUG-70573
Task-number: QTBUG-29403
Change-Id: I44925187acd72e600d2fec4f2604b67c66ecdd6b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
As winrt does not have native windows, exposure check was just done by
checking, whether the window is the active window. If a window is shown
fullscreen though, winrtscreen will be resized. This resize triggers a
resize of every maximized or fullscreen window that is shown.
If we enter or leave full screen mode, we have to wait until the screen
resize and the subsequent window resizes are done and only then we can
consider the windows properly exposed.
This patch reverts 54bcb9d42f and thus
unblacklists tst_QGraphicsItem::cursor on WinRT.
Fixes: QTBUG-73545
Change-Id: If469fce319ed6b3a5d56b7bf3cbc11929b72bb11
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Some QSpinBox tests start failing after reverting to using legacy mouse
messages to handle mouse input in the Windows QPA. It seems to be caused
by a test that runs before it and moves the mouse cursor. Then when the
QSpinBox tests run, they create widgets that appear below the mouse
cursor, causing some mouse events to be generating and messing with the
events synthesized by the test itself. With the pointer messages being
used for mouse input, the legacy mouse messages that are generated under
this condition were being ignored. But by reverting to the old
implementation, the legacy messages are handled again, causing the test
to fail. This change moves the mouse pointer to a safe position during
the test initialization, so it does not depend on the state left by
previous tests. This change needs to be integrated together or before
the change in the windows QPA.
Change-Id: I91f7e9376dc495ee61250e0a7d908c1c2b685bc8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
- QFileDialog::setConfirmOverwrite()/confirmOverwrite()
- QFileDialog::setReadOnly()/isReadOnly()
Change-Id: I3cc1df76c8e40e95b8e9893ae06ef488fad26fb6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Now that MSVC (presumably) supports templates, we can merge the QRect
and QRegion versions of the functions into one.
The function has been renamed to invalidateBackingStore to better
reflect what it's doing.
Change-Id: I0e94a0cabd286cf97f2ba718a42ee0425f59d3ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Test fails on minimal and offscreen platforms.
Task-number: QTBUG-73522
Task-number: QTQAINFRA-2630
Change-Id: I6260454be35a8bbac1ab683d89fb7b262d3b69ab
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
- QDialog::setOrientation()/orientation()
- QDialog::setExtension()/extension()/showExtension()
- QFileDialog::setNameFilterDetailsVisible()/isNameFilterDetailsVisible()
- QFileDialog::setResolveSymlinks()/resolveSymlinks()
Change-Id: Ibbd5b4192ea8ab483d6b2a8dbf9879f29f9ee86d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Search the previous item or the next item in a model instead
of searching them on visual layout. This way the cursor will
not stop at the beginning or at the end of a row or a column.
Fixes: QTBUG-14444
Change-Id: I0ef203a4dcd876e4c50559fb87e61585f07434d1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It is the flaky test causing most failures in qtbase at the moment.
Task-number: QTBUG-73545
Change-Id: Id9c5db27ebd08a4cf3c119d2fada12fdf1a5d2a0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
tst_QHeaderView::defaultSectionSizeTest() fails on High-DPI screens
because the default minimum section size is greater than the values used
for testing the header sizes. Therefore the test will fail.
Fix it by explicitly setting the minimum header size to something
smaller than the test values.
Also add a debug line to output the default minimum section sizes so
other failures due to this problem can be debugged better.
Fixes: QTBUG-73309
Change-Id: I257f341cef9381f140aa4d4f68376c5edadc39cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This is required to support the new emoji font on Android 9.
[ChangeLog][Freetype] Upgraded bundled Freetype version to 2.9.1.
This also adds support for the latest emoji font in use on
Android 9.
Fixes: QTBUG-70657
Change-Id: I99be72f0d23c20aca122b8fdadd4ded87b2edce1
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
tst_QItemDelegate::comboBox() is flaky because sometimes the used
QTableWidget does not yet have the focus which prevents a correct
editing. Fix it by explictily setting the focus on the widget after it
is shown.
A similar fix was added for dateTimeEditor() in
9822d57d85.
With this patch the test no longer fails for my on opensuse, therefore
remove the blacklisting.
Task-number: QTBUG-67282
Change-Id: I907db662ca347f8e8d31e5be215a100377b159ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Set the inherited properties as resolved on the font, so non-default
values are passed on in contexts that does resolve logic like QPainter.
One test is updated as it actually tests what it is supposed to on
more configurations.
Fixes: QTBUG-39560
Change-Id: Ief668e992ccdc091337a259a4c1306a00e67c73f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add qWaitForWindowExposed() for the toplevel and use QTRY_VERIFY()
for finding the delegates consistently.
Change-Id: I430088a91b5cc1a8f856d0a58aba066b1baf179b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
The cursor test sometimes fails due to the fact that the topLevel widget
has not yet reached it's fullscreen geometry. This means the
QGraphicsView is to small and the test will fail.
Avoid it by simply removing the topLevel widget since it's not used at
all.
Change-Id: Ia7b34f283a917a35b6665e6333a01378575a5a04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
As the mnemonic has no meaning when it is in a dockwidget title, we
should just treat it as a literal ampersand instead and display it
as such.
Fixes: QTBUG-54485
Change-Id: I96c856ce2771a68d226f48f8f47affc24f1c53cd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
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>
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.
Conflicts:
qmake/generators/makefile.cpp
src/corelib/itemmodels/qstringlistmodel.cpp
src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
tests/auto/gui/text/qglyphrun/BLACKLIST
tests/auto/gui/text/qrawfont/BLACKLIST
Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
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>
The keyboard search in QAbstractItemView did not handled Key_Space
because this is also an edit trigger. It was also consumed if no edit
was started.
This patch changes this behavior and triggers the keybaord search when
the editing was not started.
Fixes: QTBUG-48505
Change-Id: I58e0d283f863c9b12ac5d2f6171f15522bd7c30a
Reviewed-by: David Faure <david.faure@kdab.com>
The keyboard navigation did not consider the disabled state when trying
to find the new index under all circumstances. This lead to a
non-working PageUp/Down/Home/End navigation when the first or last item
was disabled or hidden.
Fix it by explicitly checking if the calculated item is hidden/enabled
and skip it in this case.
Fixes: QTBUG-44746
Fixes: QTBUG-34832
Change-Id: Ifa3b64a405e67b792db5db9d186d426fcfe183fb
Reviewed-by: David Faure <david.faure@kdab.com>
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>
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>
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>
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>
Deprecate the QTreeWidget functions is/setFirstItemColumnSpanned() to
stay in sync with the other deprecated functions
(selected/expanded/hidden) so they can get removed in Qt6.
Also add a small unit test for them.
Change-Id: Ie1cb5d7163c2d56d653c21e841ccaf7d38569787
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>
Currently, a tile rearrange will move the active subwindow (if any)
to position zero (top-left). This ignores any tiling order set via
setActivationOrder(). This change removes this move so that the set
tiling order is respected when a tile operation is performed.
Fixes: QTBUG-43356
Change-Id: I2c481f0ffe45e42e811c6b6d476eb4cb65aa5d1f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QListWidget::(is|set)Item(Selected|Hidden)() are deprecated for a long
time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.
Change-Id: I4567e740f1ebb5841b2e5b50c601fb83a782950c
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QMdiAreaPrivate::resizeToMinimumTileSize() does not take into account
scroll bars when calculating the minimum size for the QMdiArea widget.
As a result, if scroll bars are enabled or showing during a tiling
operation, the top-level widget incorrectly expands in size (instead of
utilizing the scroll bars). Therefore, we should only resize the
top-level widget if scroll bars are disabled.
Fixes: QTBUG-40821
Change-Id: I3a8b7582d23fdf12d2b09f3740eea6b60bb395c3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
That's an undocumented Qt 4/3/2 remnant, start remove usages.
Fix incorrect include header in qclass_lib_map.h as a drive-by.
Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
So we add the QTextDocument::ResourceType::MarkdownResource enum value to indicate
the type. QMimeDatabase is generally unable to detect markdown by "magic", so we
need to use the common file extensions to detect it (the same extensions as declared
in the mime database XML).
Change-Id: Ib71f03abd535c17e5a8c99bd92d0a6062e972837
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's necessary to make the test pass on certain platforms.
Change-Id: I717d492df437c0ffb75b21d9ef23ce602160fad1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>
It would crash if there is no screen at 0,0.
Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
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>
Some tests were fixed and others were skipped/blacklisted.
Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
This will be the only options for Qt 6, so make sure the code compiles now.
Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
keyboardInputInterval() is 400ms by default which slows down the
testcase without a good reason.
Set it to 100ms which speeds up the testcase from 20s to 10s on my
system.
Change-Id: Ib883c5d3f09f8e896ae56a8fc8df2233be63de01
Reviewed-by: David Faure <david.faure@kdab.com>
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>
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>
QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated
for a long time but not marked as such. Therefore explicitly mark them
as deprecated so they can get removed with Qt6.
Change-Id: Ie4971350de61326811e0788df0d359ed3c442869
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QHeaderView::initializeSections() was calling updateHiddenSections()
with wrong parameters which lead to an inconsistency in the hidden
section handling.
updateHiddenSections() needs the first and last index which got removed.
Therefore we must pass the new section count for logicalFirst.
Fixes: QTBUG-55461
Change-Id: Ica06125cf19bdd500f55fd9cd59ace1795f3703f
Reviewed-by: David Faure <david.faure@kdab.com>
Replace BackgroundColorRole/TextColorRole with
BackgroundRole/ForegroundRole and explicit deprecate them for 5.13
Change-Id: I6b0d99844a32d2f5fdfd1878317a7b7422b800d3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Replace all occurrences of QApplication::set/resetOverrideCursor with
the QGuiApplication::set/resetOverrideCursor since it's a static
function of QGuiApplication.
Change-Id: Ic898ab50a7ad4ed2bc9c6acb26cf4a979c2f82af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>
QTableWidget::isItemSelected/setItemSelected() are deprecated for a
long time but not marked as such. Therefore explicitly mark them as
deprecated so they can get removed with Qt6.
Change-Id: I77fffe2786751306115c3f5da0ef98ff84e35b1a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QTreeView/TableView::sortByColumn(int) was deprecated a long time ago
but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13)
so we can remove it with Qt6.
Also sync the handling of the sort order changes in QTableView with the
one from QTreeView.
Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QTreeView only had functions to either expand all items or until a given
depth. What was missing is to expand all subitems for an index
programmatically which is added with this patch.
[ChangeLog][QtWidgets][QTreeView] Added expandRecursively() to expand
all items below a given index
Fixes: QTBUG-10482
Change-Id: I8fc4d50b0b7e90245840c99a0188f13c0670253a
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>
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>
This test works for me with KWin and is blacklisted on most linux platforms.
Let's try to remove the blacklisting next.
Using qWait right in front of the QTRY_VERIFY does not add any value.
Task-number: QTBUG-26424
Change-Id: I2dcd5fb3f3cbb64e190c777231b791d1ad9dd704
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The Qt stylesheets color property did not support hsl or hsla although
CSS 2.1 does support it. Since QColor natively supports this color model
only the color parsing needed to be adjusted.
This also adds some stricter checks for a valid css color definition and
prints a warning about the issue.
[ChangeLog][QtGui][CSS] Added support for hsl/hsla colors
Fixes: QTBUG-58804
Change-Id: Ief65a36a7e0ed0d705dc1fe5a8658e8d07fe9a13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Only QGuiApplication would emit the signal. Untangling the duplicate
code is rather non-trivial, so left alone for now.
Fixes: QTBUG-71186
Change-Id: I4021e3b9ff39718562f4fa3a03c092436b559e9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QPlainTextEdit.
[ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find()
method overload.
Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QTextEdit.
[ChangeLog][QtWidgets][QTextEdit] Added QRegularExpression find() method
overload.
Change-Id: Ic7be224dcc59fc8d832daddd1999a713b7f04253
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
52f1692b84 introduced a possible fix for
this flaky test. Therefore unblacklist them to see if the change really
fixed the issue.
Task-number: QTBUG-64639
Change-Id: I759d66aac7641505487e88254d16750e87c97350
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QTable/QTreeView did not follow the documentation and returned
their needed size with scrollbars within viewportSizeHint().
Then sizeHint() also took the size of the scrollbars into account
when the policy was set to ScrollBarAlwaysOn.
This lead to different results when the widget was shown/hidden and/or
the scrollbar was visible or not.
Fix it by only adding the additional size when the scrollbars are
really visible. Also use header->isHidden() instead of isVisible() in
QTreeView the same way it is done in QTableView.
[ChangeLog][QtWidgets][QAbstractScrollArea] QTableView/QTreeView are
now reporting their viewportSizeHint() correctly taking into account
its scroll bars visibility and visibilityPolicy.
Task-number: QTBUG-69120
Change-Id: If50959a9f7429275e3e33122644c978fb64972ba
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>
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>
The matatype should not keep manually maintained list of stream
operators. The patch adds automatic detection for all builtin types
so load and save functions pick the right delegate automatically.
This change exposed some existing anomalies:
- char is enforced to be signed while it seems that just calling
the operator directly does not have that feature.
- [unsigned] long type is always upgraded to [unsigned] long long
- QCborSimpleType doesn't have the data stream operators while
metatype is able to stream it through casting
Change-Id: I51178d6acd97d0585a6089e30ddd6acb2a29af54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>