24#include "vungroupcmd.h"
25#include "vselection.h"
30 :
VCommand( doc, i18n(
"Ungroup Objects" ),
"14_ungroup" )
32 m_group =
dynamic_cast<VGroup *
>( document()->selection()->objects().getFirst() );
37VUnGroupCmd::~VUnGroupCmd()
49 VObjectListIterator itr( m_group->objects() );
50 for ( ; itr.current() ; ++itr )
57 if( ( parent =
dynamic_cast<VGroup*
>( m_group->parent() ) ) )
60 parent->
take( *m_group );
63 VObjectListIterator itr = m_group->objects();
65 for ( ; itr.current() ; ++itr )
67 itr.current()->invalidateBoundingBox();
68 parent->
append( itr.current() );
84 VObjectListIterator itr( m_objects );
85 for ( ; itr.current() ; ++itr )
89 m_group->append( itr.current() );
The base class for all karbon commands.
virtual void unexecute()
Unexecutes the command.
VDocument * document() const
Returns the document the command works on.
virtual void execute()=0
Executes the command.
All non-visual, static doc info is in here.
VLayer * activeLayer() const
Returns a pointer to the active layer.
VSelection * selection() const
Returns a pointer to the selection.
void append(VObject *object)
Appends a new object to the active layer.
Base class for all sort of VObject conglomerats.
void take(const VObject &object)
Removes the reference to child object, not the object itself.
void append(VObject *object)
Appends a new child object.
const VObjectList & objects() const
Read only access to the grouped objects.
@ deleted
deleted, nearly dead
@ normal
visible, not active
void append()
Adds all objects to the selection.
void clear()
Removes the references to all objects, not the objects themselves.
void setSuccess(bool success=true)
Set the success property.