2 summary:: Instead of subclassing a (Q/SC)View, this is a proxy/adapter object that holds the View
7 When writing gui widgets it is sometimes not desireable to subclass a view class. Its preferable to write a class that acts like a View and is used where Views normally are used but isn't a direct subclass of a View class.
9 In the SCView hierarchy it is not possible to subclass an SCView class because under the hood there is always a strict relationship between the SCView subclass and its paired C++ class. The C++ class makes the actual view, the SC class is an interface to that C++ object.
11 In Qt there is a bit more flexibility.
13 But there are other reasons to not inherit from a specific view: your widget may not be a single view, in which case you would want to place a CompositeView and then place subviews inside of that. Altogether these views are what your widget manages. SCViewHolder can be used in this situation and it would set the top level CompositeView as its primary view.
15 Although it is still called "SC"ViewHolder it is in fact cross platform since it doesn't draw the view(s), it simply holds them.
17 Another possible name might be ViewAdapter or PseudoView. It was originally called SCViewAdapter.
19 Most of the standard view methods here simply defer to the proxied view. This makes the ViewHolder act and quack like a View.
21 Messages that are not understood by the view holder are forwarded to the proxied view.
23 Historical note: this class was originally in the cruciallib. ObjectGui is a subclass of this.
27 METHOD:: consumeKeyDowns
28 global preference variable: if true then subclasses that do not set a keyDownAction do NOT bubble up keyDown events by default.
30 returns:: The result of calling the method on the proxied view
37 get or set the view for which this object is a proxy/adapter.
40 the view: SCView or QView
42 returns:: The result of calling the method on the proxied view
45 METHOD:: doesNotUnderstand
46 Messages that are not understood by the view holder are forwarded to the proxied view. So when the interpreter is told to send a message to a view holder object and that message is not understood, it calls doesNotUnderstand
49 The message that was not understood
52 The arguments that were supplied
54 returns:: the result of calling the method on the proxied view
58 Unsets the view variable. After the view is closed (removed from the window) then all calls to the view holder will fail, and should fail as there is no view anymore. You can check viewHolder.isClosed if you are unsure
63 Removes the view from the window if it has not already been removed.
68 This method is forwarded to the view
73 returns:: The result of calling the method on the proxied view
76 This method is forwarded to the view
78 returns:: The result of calling the method on the proxied view
80 METHOD:: keyDownAction
81 This method is forwarded to the view
86 returns:: The result of calling the method on the proxied view
88 METHOD:: keyDownResponder
89 This method is forwarded to the view. Note: this is a cruciallib convention and will be deprecated here.
91 returns:: The result of calling the method on the proxied view
93 METHOD:: enableKeyDowns
94 This method is forwarded to the view. Note: this is a cruciallib convention and will be deprecated here.
96 returns:: The result of calling the method on the proxied view
104 This method is forwarded to the view
109 returns:: The result of calling the method on the proxied view
112 This method is forwarded to the view
117 returns:: The result of calling the method on the proxied view
120 This method is forwarded to the view
125 returns:: The result of calling the method on the proxied view
128 This method is forwarded to the view
130 returns:: The result of calling the method on the proxied view
133 This method is forwarded to the view
138 returns:: The result of calling the method on the proxied view
141 This method is forwarded to the view
146 returns:: The result of calling the method on the proxied view
149 This method is forwarded to the view
154 returns:: The result of calling the method on the proxied view
157 This method is forwarded to the view
159 returns:: The result of calling the method on the proxied view
162 This method is forwarded to the view
167 returns:: The result of calling the method on the proxied view