| 248 | |
| 249 | |
| 250 | bool Controller::hasModel( const Model * m ) |
| 251 | { |
| 252 | QObjectList chldren = children(); |
| 253 | for( int i = 0; i < chldren.size(); ++i ) |
| 254 | { |
| 255 | QObject * c = chldren.at(i); |
| 256 | AutomatableModel * am = qobject_cast<AutomatableModel*>(c); |
| 257 | if( am != NULL ) |
| 258 | { |
| 259 | if( am == m ) |
| 260 | { |
| 261 | return true; |
| 262 | } |
| 263 | |
| 264 | ControllerConnection * cc = am->controllerConnection(); |
| 265 | if( cc != NULL ) |
| 266 | { |
| 267 | if( cc->getController()->hasModel( m ) ) |
| 268 | { |
| 269 | return true; |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | return false; |
| 276 | } |
| 277 | |
| 278 | |
| 279 |
no test coverage detected