QGIS/python/gui/editorwidgets/qgsmultiedittoolbutton.sip
Nyall Dawson 66b51d4a81 [FEATURE] Edit attributes of multiple features simultaneously
This change allows the attributes of multiple features to be edited
simultaneously. It is enabled when the attribute table dialog is in
"form mode", via a new "multi edit" button on the toolbar.

In this mode, attribute value changes will apply to all selected
features. New widgets appear next to each editor widget allowing for
display of the current multi-edit state and for rolling back changes
on a field-by-field basis.

Changes are made as a single edit command, so pressing undo will
rollback the attribute changes for all selected features at once.

Multiedit mode is only available for auto generated and drag and
drop forms - it is not supported by custom ui forms.

Sponsored by Kanton Basel Stadt
2016-04-18 15:15:11 +10:00

76 lines
2.2 KiB
Plaintext

/** \ingroup gui
* \class QgsMultiEditToolButton
* A tool button widget which is displayed next to editor widgets in attribute forms, and
* allows for controlling how the widget behaves and interacts with the form while in multi
* edit mode.
* \note Added in version 2.16
*/
class QgsMultiEditToolButton : QToolButton
{
%TypeHeaderCode
#include <qgsmultiedittoolbutton.h>
%End
public:
//! Button states
enum State
{
Default, /*!< Default state, all features have same value for widget */
MixedValues, /*!< Mixed state, some features have different values for the widget */
Changed, /*!< Value for widget has changed but changes have not yet been committed */
};
/** Constructor for QgsMultiEditToolButton.
* @param parent parent object
*/
explicit QgsMultiEditToolButton( QWidget *parent /TransferThis/ = nullptr );
/** Returns the current displayed state of the button.
*/
State state() const;
/** Sets the field associated with this button. This is used to customise the widget menu
* and tooltips to match the field properties.
* @param field associated field
*/
void setField( const QgsField& field );
public slots:
/** Sets whether the associated field contains mixed values.
* @param mixed whether field values are mixed
* @see isMixed()
* @see setIsChanged()
* @see resetChanges()
*/
void setIsMixed( bool mixed );
/** Sets whether the associated field has changed.
* @param changed whether field has changed
* @see isChanged()
* @see setIsMixed()
* @see resetChanges()
*/
void setIsChanged( bool changed );
/** Resets the changed state for the field.
* @see setIsMixed()
* @see setIsChanged()
* @see changesCommitted()
*/
void resetChanges();
/** Called when field values have been changed and field now contains all the same values.
* @see resetChanges()
*/
void changesCommitted();
signals:
//! Emitted when the "set field value for all features" option is selected.
void setFieldValueTriggered();
//! Emitted when the "reset to original values" option is selected.
void resetFieldValueTriggered();
};