Marc Mutz e215b930e2 tst_QTreeView: fix memleak in fetchUntilScreenFull()
The TreeModel class was lacking the destructor, so the m_root TreeItem
was never deleted (it was held in a non-owning pointer and had no
parent).

Instead of adding ~TreeModel(), port to holding m_root in unique_ptr
instead. This creates a bit more churn, but communicates intent
better, and makes sure the item is never without an owner.

Amends e74af68654c0eb127277c73e20bda409b83d157b.

As a drive-by, fix the indent of the else clause of a ternary.

Pick-to: 6.8 6.5 5.15
Change-Id: I2f5c8852b8bee89c63933c118a4599d6a17de8e2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7cf8b2d0303ea81a8e22fcaee7db7bb7303d0376)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-28 16:32:17 +00:00
..
2024-11-05 14:36:16 +01:00

This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.