Hello. I'm trying to understand how to structure the classes \ framework in my Qt program in a way that guarantees speed \ readability \ mantainability etc.
The biggest conflict right now is deciding whether upon user interaction the Qt widgets take action on the program themselves, or if they report that interaction to some "business logic" class responsible for reacting to that user interaction.
To clarify, consider an art program.
When the user presses the mouse on a "canvas" widget, does the widget begin the drawing operation itself (by calling methods from a custom pixmap painting class), or does it report to a higher-level "core" or "application" object that takes care of handling the painting?
• In the first case: the widget can control the painting functionality (it has access to the painting functionality, it knows of the methods and of the object responsible for this).
• In the second case: the widget can only report the user input and will do so with signals (it doesn't know anything about the painting functionality), and the higher-level object(s) will react to that. The painting functionality is encapsulated in these higher-level objects.
What is usually the production level approach to this?
Bookmarks