These tests have started segfaulting randomly since upgrade from
24.10 to 25.04. It's a Ubuntu 25.04 specific issue, as the tests
have been run on the Fedora CI (and older Ubuntu) for years without
issue.
At this stage the cause is unknown, but the failures are just
noise and risk hiding real issues. Given that the Fedora CI is
still running these tests then we don't have any drop in
test coverage by blocking them from running on the Ubuntu builds.
... this is a temporary "fix" only, as there's no actual tests
from that file which are run under qt 6. They are all skipped
because webkit isn't available.
To be resurrected when we've ported the HTML item fully to
web engine.
Root cause of issue is that the test was calling QAction::trigger
on a disabled action. On Qt 5 this wasn't an issue, and the
slot connected to the action's triggered signal was still
called. On Qt 6 this slot is NOT called for disabled actions.
So we need to ensure that the action's triggered in the test
ARE correctly enabled, and the way to do this is to call
QgsAdvancedDigitizingDockWidget::updateCapacity. This slot is
connected to QgsProject::snappingConfigChanged.
Ensure that we set the snapping config on the project as well
as the canvas in tests to make sure that this happens.
(outside of tests, the canvas snapping utils settings are
set whenever the project snapping config is changed.. so now
the tests better mimic what's actually happening in app too)
Match the rendering of raster layers with clipping paths to the
same appearance as Qt 5, where the clip path forces the raster
to be rendered with antialiasing in order to get nice appearance
along the clip path boundaries
Differences in null/invalid qvariant handling on qt6 meant that
we weren't setting the combobox index to the existing entry
with a null (but not invalid) qvariant user data
The test was only passing on qt5 builds because QMessageBox::exec
was immediately returning false WITHOUT showing the dialog. On
Qt 6 builds the dialog WAS correctly showing, and since its a
blocking dialog it hangs the test.
Workaround by disabling the confirmation dialog when running
as unit tests.
Stabilise the labels shown in the test -- the test is actually
trying to label EVERY country, so the collision avoidance was
limiting to a semi-random set depending on the qt internal hash logic.
With this new method code, it is now possible to use
`QgsProject::removeMapLayers` with a list of layers or a list of
layers IDs in qt5 and qt6.
Co-authored-by: bdm-oslandia <benoit.de.mezzo@oslandia.com>
`QgsCodeEditor::getMonospaceFont` is supposed to return a monospace
font. The test checks that the returned font is monospace by calling
QFont::styleHint` method and comparing it to
`QFont.StyleHint.Monospace`. However `QFont::StyleHint` matches the
font family. A font does not need to belong to the "Monospace" family
in order to be monospace.
This issue is fixed by using `QFontDatabase::isFixedPitch` to check if
the font is monospace. This also make the test work on Qt6.