UI / logical separation - can anyone recommend a good source of knowledge

I am new to user interfaces. I am currently working on a user interface design for part of the code that I have in C ++. I decided to use QT to create a user interface.

Now I am most concerned about what is the proper way to branch the user interface from logic. I have some level of data that should be accessible from different parts of my interface (different widgets, different windows). Some user interface components can represent or even modify data at the same time.

Do I have to represent the data layer as a single singlet and use this singleton in the user interface? An alternative is probably to pass a pointer to the data to each and every component of the user interface, which, IMHO, smells bad.

In an application, where is the best place to translate between UI-related data structures such as QList, QVector, QString and the data structures that I use in my data layer (STL + Boost). Maybe some kind of proxy layer is required in the middle?

Can someone recommend me a good book, article, or any other source of knowledge related to my question? Any ideas or advice you can give me are also very welcome.

Thank.

+3
3

Qt Model-View.

Qt: /.

, , .

+1

, UI- , QList, QVector, QString , (STL + Boost). - ?

Two options come to mind. You could provide functions in your data layer to return Qt data structures, or you could wrap the Qt UI Widget classes around your own classes, which take STL + Boost data structures, convert them and pass them to Qt Widgets.

The first option is probably easier and faster to implement, but the second option preserves the separation between how your data and the user interface are stored.

+1
source

Source: https://habr.com/ru/post/1729378/


All Articles