mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	Fixes #11371 (crash on ungrouping after moving the group) and more undo/redo related issues. Enable pending test for the crash (now passing) and add many more undo/redo related ones (including signals testing). Includes a new QgsGroupUngroupItemsCommand class and its SIP bindings.
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/** A composer command class for grouping / ungrouping composer items.
 | 
						|
 *
 | 
						|
 * If mState == Ungrouped, the command owns the group item
 | 
						|
 */
 | 
						|
class QgsGroupUngroupItemsCommand: QObject, QUndoCommand
 | 
						|
{
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsgroupungroupitemscommand.h"
 | 
						|
%End
 | 
						|
 | 
						|
  public:
 | 
						|
 | 
						|
    /** Command kind, and state */
 | 
						|
    enum State
 | 
						|
    {
 | 
						|
      Grouped = 0,
 | 
						|
      Ungrouped
 | 
						|
    };
 | 
						|
 | 
						|
    /** Create a group or ungroup command
 | 
						|
     *
 | 
						|
     * @param s command kind (@see State)
 | 
						|
     * @param item the group item being created or ungrouped
 | 
						|
     * @param c the composition including this group
 | 
						|
     * @param text command label
 | 
						|
     * @param parent parent command, if any
 | 
						|
     *
 | 
						|
     */
 | 
						|
    QgsGroupUngroupItemsCommand( State s, QgsComposerItemGroup* item, QgsComposition* c, const QString& text, QUndoCommand* parent = nullptr );
 | 
						|
    ~QgsGroupUngroupItemsCommand();
 | 
						|
 | 
						|
    void redo();
 | 
						|
    void undo();
 | 
						|
 | 
						|
  signals:
 | 
						|
    /** Signals addition of an item (the group) */
 | 
						|
    void itemAdded( QgsComposerItem* item );
 | 
						|
    /** Signals removal of an item (the group) */
 | 
						|
    void itemRemoved( QgsComposerItem* item );
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
 |