Skip to content

[Suggestion]: Change QListWidgetItem data from dict to a class/dataclass #617

Closed

Description

@Patryk-Malinowski

Origin of idea

Because of increasing complexity of the data being stored, we could benefit from converting QListWidgetItem data to be a class rather than a dict.

Suggestion/proposed solution?

Convert QListWidgetItem data to be a class rather than a dict.

Alternatives considered

No response

Additional context

This may require you to also create a wrapper for QListWidgetItem and replace all instances of QListWidgetItem in the code to use this wrapper.

The reason for this (for me anyway) was that when .setData() was called with a dict it would trigger a signal. (If i remember correctly it would be QListWidget's itemChanged signal)

But when trying to call setData() with a class it would not trigger this signal. You might want to handle this in your wrapper, or come up with an alternative solution.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Duplicate Issue Check

  • I've checked for duplicate issues

Wiki/FAQ Check

  • I've checked the Wiki for a solution

Activity

  1. added
    feature/improvement 🆕
    Code refactoring 🧹
    on Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Code refactoring 🧹feature/improvement 🆕

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions