Skip to content

doc: Add QT MVC structure to style guide #950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Computerdores
Copy link
Collaborator

@Computerdores Computerdores commented Jun 7, 2025

Summary

Splits the style guide into a separate file, and documents the intended future structure of the qt part of the code base.

Tasks Completed

Not applicable

@Computerdores
Copy link
Collaborator Author

class structure guide inspired by: https://www.pythonguis.com/tutorials/pyside6-modelview-architecture/

@Computerdores Computerdores marked this pull request as draft June 7, 2025 12:42
@Computerdores Computerdores changed the title doc: first draft doc: Add QT MVC structure to style guide Jun 7, 2025
@Computerdores Computerdores requested a review from CyanVoxel June 7, 2025 13:23
@Computerdores Computerdores marked this pull request as ready for review June 7, 2025 13:23
@Computerdores Computerdores marked this pull request as draft June 7, 2025 19:44
@CyanVoxel CyanVoxel added Type: Documentation Additions/changes to documentation Priority: High An important issue requiring attention labels Jun 7, 2025
@CyanVoxel CyanVoxel moved this to 👀 In review in TagStudio Development Jun 7, 2025
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

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

Overall looking very good so far, just a couple of early nits and comments

STYLE.md Outdated
- The Controller is just called `MyCoolWidget` instead of `MyCoolWidgetController` as it will be directly used by other code
- the ui elements are in private variables
- this enforces that the controller shouldn't directly access UI elements
- instead the view should provide a protected API (e.g. `_get_color()`) for things like setting/getting the value of a dropdown, etc.
Copy link
Member

Choose a reason for hiding this comment

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

Might be also worth giving properties a shoutout here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

STYLE.md Outdated
Comment on lines 71 to 76
- the ui elements are in private variables
- this enforces that the controller shouldn't directly access UI elements
- instead the view should provide a protected API (e.g. `_get_color()`) for things like setting/getting the value of a dropdown, etc.
- the callback methods are already defined as protected methods with NotImplementedErrors
- defines the interface the callbacks
- enforces that UI events be handled
Copy link
Member

Choose a reason for hiding this comment

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

Small general nit for capitalization

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should be better now

@Computerdores Computerdores marked this pull request as ready for review June 7, 2025 22:03
@Computerdores
Copy link
Collaborator Author

I have now added everything I wanted to and thus this is ready for final review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High An important issue requiring attention Type: Documentation Additions/changes to documentation
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants