| 49 | |
| 50 | |
| 51 | void ModelView::setModel( Model* model, bool isOldModelValid ) |
| 52 | { |
| 53 | if( isOldModelValid && m_model != NULL ) |
| 54 | { |
| 55 | if( m_model->isDefaultConstructed() ) |
| 56 | { |
| 57 | delete m_model; |
| 58 | } |
| 59 | else |
| 60 | { |
| 61 | m_model->disconnect( widget() ); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | m_model = model; |
| 66 | |
| 67 | doConnections(); |
| 68 | |
| 69 | widget()->update(); |
| 70 | |
| 71 | modelChanged(); |
| 72 | } |
| 73 | |
| 74 | |
| 75 |