Re: Design: Signals => Pass by Reference
From what you have said, a factory would help. The keyboard would be a keyboard only, none of these signal + slots needed just for initialisation data. All that rigmarole can be abstracted away in a factory. Depending on your differing instrument or keyboard usage, merely create the keyboard directly for the trivial case, or use a different concrete factory.
As for heap vs stack, if you don't know why one is very frowned upon in such examples, I suggest you do some further reading
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks