[Qt-interest] How to separate functionality
Gordon Schumacher
gordon at rebit.com
Mon Dec 7 19:12:56 CET 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kari Laine wrote:
> Hi,
>
> I am doing this scope project and now I have studied the
> QGraphicsScene and QGraphicsView and know enough to be dangerous .....
>
> Anyway on this list I was suggested that the slots should be separated
> on it's own class. I can't figure out how to do this.
> It was told that the designer does this kind of code. Designer won't
> run on my OpenSUSE 11.1 system and I haven't yet installed it on my
> Windows machine.
> Could someone shortly describe the basic principle and maybe give code
sceleton?
This is IMHO a little more general than "separate the slots" - it
really is another version of model-view-controller, in that the goal
is to separate the view (your UI) from the controller (the code that
actually does the grunt work).
Basically, whether you use Designer or not, you want your UI class to
have only code relating to making the UI work. It's okay to have
signals and slots here, as long as they relate to changes or
notifications to/from the UI. Then, the code that does whatever
calculations or data generation you need should use those signals and
slots to drive the UI.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAksdRacACgkQ2yRp4mXKHF1wsgCcDq8J/pK1ti2edIRMJyvvAwL8
F6MAn0z9jpruEM71OUJWhcUVmsz29CRV
=h7jI
-----END PGP SIGNATURE-----
More information about the Qt-interest-old
mailing list