Skip to content
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

Qt-ifying #24

Open
psomers3 opened this issue Jul 11, 2022 · 4 comments
Open

Qt-ifying #24

psomers3 opened this issue Jul 11, 2022 · 4 comments

Comments

@psomers3
Copy link
Collaborator

@jakobhampel
Another example spot to make things more QT-like is to not use a function like this and instead replace it with a set of signal-slots such as "label changed" or "item added", etc coming from the database.

@jakobhampel
Copy link
Contributor

@psomers3 I don't quite get it. So instead of using this function, I send a signal coming from the database every time a user changes something? And this signal I would use to... set a boolean hasChanged in the image_display to True (for example)?

@psomers3
Copy link
Collaborator Author

@jakobhampel Yes to the first question, but it can also have different signals depending on what is changed. Yes to the second question, but I also haven't seen how often/where exactly you use this function so it may not be super critical, but once you're passing lists of data around, I would think first if you have to do it that way.

@jakobhampel
Copy link
Contributor

@psomers3 could I also do it this way:
Evertime a user does anything significant in the image, automatically assume something has changed (and ask for saving when user wants to quit/change file)

Pro: No calls to the database needed, very simple (f.e. a class variable in the image_display to keep track of it)
Cons: When user effectively does not change anything (f.e. adding a shape, then removing it again) it will assume something has changed nevertheless. I think this is ok, I often see this behavior in other softwares (Word, etc.).

@psomers3
Copy link
Collaborator Author

psomers3 commented Jul 25, 2022

@jakobhampel I am fine with that idea. We will need something that does more isolated change tracking and this could make it easier to do in the long run. So I would create something that describes what the change was and is emitted with the signal. i.e. a dataclass or something with different info like file changed, type of change (label move, label creation, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants