Skip to content

Move QListWidgetItem data from dict to a class - #735

Merged
Patryk-Malinowski merged 17 commits into
mainfrom
move_qlistwidgetitem_data_to_class
Jan 4, 2025
Merged

Patryk-Malinowski merged 17 commits into
mainfrom
move_qlistwidgetitem_data_to_class

Conversation

@Patryk-Malinowski

@Patryk-Malinowski Patryk-Malinowski commented Jan 3, 2025 •

Copy link
Copy Markdown
Collaborator

Closes #617

Rather than storing metadata in a dict, we will handle it in a separate class.

With this implementation the intitialization is handled in the class, so no need to look for and update code somewhere else... Unless you want to do so explicitly.

In general this should make life easier going forward when we want to add metadata to mod items.

I tested it out and everything seems to work as usual, but would be appreciated if anybody else wants to test it out and make sure it didn't break anything I missed.

Fixed by preventing the handle_rows_inserted method being called when manually replacing QListWidgetItem with CustomListWidgetItem.
This should mean if you add more metadata you dont have to manually make sure this new field is initialized etc. when mod item is created.
@Patryk-Malinowski Patryk-Malinowski added the Code refactoring 🧹 improving the structure and organization of the code; restructuring, cleaning up label Jan 3, 2025
@Patryk-Malinowski Patryk-Malinowski changed the title Move qlistwidgetitem data from dict to a class Move QListWidgetItem data from dict to a class Jan 3, 2025
@Patryk-Malinowski Patryk-Malinowski added the Code style ✨ Minor changes like fixing typos, style, indentation label Jan 3, 2025
@Patryk-Malinowski
Patryk-Malinowski marked this pull request as ready for review January 3, 2025 23:06
@LionelColaso

Copy link
Copy Markdown
Member

Have you had a chance to see #403

@LionelColaso LionelColaso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go

@Patryk-Malinowski
Patryk-Malinowski merged commit 41c5cd3 into main Jan 4, 2025
@Patryk-Malinowski
Patryk-Malinowski deleted the move_qlistwidgetitem_data_to_class branch January 4, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code refactoring 🧹 improving the structure and organization of the code; restructuring, cleaning up Code style ✨ Minor changes like fixing typos, style, indentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants