27 static_cast<T *
> ( this )->connect (
28 &confaccessor::ref(), SIGNAL ( object_deleted ( QString
const &,
dref const & ) ),
29 static_cast<T *
> (
this ), SLOT ( slot_remove_object ( QString
const &,
dref const & ) ) );
30 static_cast<T *
> ( this )->connect (
31 &confaccessor::ref(), SIGNAL ( object_renamed ( QString
const &,
dref const & ) ),
32 static_cast<T *
> (
this ), SLOT ( slot_rename_object ( QString
const &,
dref const & ) ) );
33 static_cast<T *
> ( this )->connect (
34 &confaccessor::ref(), SIGNAL ( object_changed ( QString
const &,
dref const & ) ),
35 static_cast<T *
> (
this ), SLOT ( slot_update_object ( QString
const &,
dref const & ) ) );
36 static_cast<T *
> ( this )->connect (
37 &confaccessor::ref(), SIGNAL ( object_created ( QString
const &,
dref const & ) ),
38 static_cast<T *
> (
this ), SLOT ( slot_create_object ( QString
const &,
dref const & ) ) );
81 std::vector<type_object_info>
const & objects )
83 BOOST_SCOPE_EXIT_TPL(this_)
85 emit
static_cast<T *
> ( this_ )->layoutChanged();
89 static_cast<T *
> ( this )->layoutAboutToBeChanged();
92 BOOST_SCOPE_EXIT_TPL(this_)
94 static_cast<T *
> ( this_ )->blockSignals(
false);
98 static_cast<T *
> ( this )->blockSignals(
true);
100 for(
const auto& obj : objects) {
101 static_cast<T *
> ( this )->update_object(obj);
154 type_indices::iterator b, type_indices::iterator e )
156 typedef std::set <
decltype ( b->row() ) > t_qrows;
157 typedef std::vector<type_object_info> t_objects;
158 t_objects to_remove_objects;
160 for ( type_indices::iterator iter = b; iter != e; ++iter )
162 if ( iter->isValid() and iter->column() == 0 )
164 dref o =
static_cast<T *
> ( this )->getobject ( *iter );
168 to_remove_objects.push_back ( o );
173 t_objects removed_objects;
175 for (
auto const & o : to_remove_objects )
179 removed_objects.push_back ( o );
183 t_qrows to_remove_rows;
185 for (
auto const & o : removed_objects )
187 QModelIndex newloc =
static_cast<T *
> ( this )->lookup ( o );
189 if ( newloc.isValid() )
191 to_remove_rows.insert ( newloc.row() );
195 t_qrows::reverse_iterator uend = to_remove_rows.rbegin();
197 if ( uend != to_remove_rows.rend() )
199 for (
int count = 0, bottom = *uend, last = bottom; uend != to_remove_rows.rend();
200 count = 0, bottom = *uend )
202 for ( ; uend != to_remove_rows.rend() and count == bottom - *uend;
203 last = *uend, ++uend, ++count )
206 static_cast<T *
> ( this )->removeRows ( last, count, b->parent() );