https://bugs.kde.org/show_bug.cgi?id=476950

            Bug ID: 476950
           Summary: KSortFilterProxyModel::filterRole & filterRoleName
                    properties are buggy
    Classification: Frameworks and Libraries
           Product: frameworks-kitemmodels
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: m...@ratijas.tk
  Target Milestone: ---

Created attachment 163125
  --> https://bugs.kde.org/attachment.cgi?id=163125&action=edit
ksortfilter-bug.qml

SUMMARY

KSortFilterProxyModel exhibits "race condition" bug: depending on order of
property initialization (which isn't quite defined in QML, except that more
"complex" expressions are known to evaluate later than the simple literals and
enums), it may end up with filterRole reset to 0 (thus the whole filtering not
working, as currently in Flatpak KCM -> application list), or a model emits
inappropriate rowsAdded signal which causes a view (e.g. ListView) to create a
phantom and empty delegate which won't even ever be deleted.

STEPS TO REPRODUCE
1. Run the attached file with qml or kqml tool. It uses plasma-pa/SinkModel as
an example, so make sure you have some functional speakers/headphones or
replace it with some other model.
2. Type in anything in the search field.
3. Toggle ON the "Set model" check box.
4. Click the "Set filter role" button.
5. Clear the search field.

OBSERVED RESULT
After step 4, an empty delegate appears in the ListView.
After step 5, an empty delegate remains alive at the bottom of the list of your
audio devices.

EXPECTED RESULT
No empty glitched delegates. No races between filterRole and model properties.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.81.0
KDE Frameworks Version: 5.245.0
Qt Version: 6.6.0
Kernel Version: 6.6.1-arch1-1 (64-bit)
Graphics Platform: X11

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to