c++ - List the drawback (performance/maintenance etc.,) in having all setter functions as SLOTS in Qt? -


is there drawback (performance/maintenance etc.,) in having setter functions slots in qt?

some of disadvantages see are,

1) unnecessary call of moc , unnecessary moc files created during compile time 2) break in exception handling chain, since exceptions not passed in signal-slot connection 3) unnecessary complexity in debugging, since harder debug signal-slot thatn direct method call.

can list other disadvantages (if any)?

if call setters directly, can avoid of drawbacks mention. behave other normal call. drawback in case longer compiler time , bigger bin size.

if call setters emitting signals, then:

1) more complex code; since have remember connect signals slots every set.

2) small performance hit. negligible gui app; there.

3) less deterministic code. i.e. depending on way signals connected, call might passed directly callee, or sent through event system. further complicates debugging, besides you've mentioned already.

4) ide issues. if not using qtcreator or kdevelop, ide might not understand special keywords (slot, signal, emit).

except (1), these issues minor. main reason not doing this, say, doesn't make sense. why if don't have need?

software engineering should managing complexity, not creating it.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -