mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-10-30 00:07:09 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			98 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			98 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/core/qgsoptional.h                                               *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | |
|  ************************************************************************/
 | |
| 
 | |
| 
 | |
| 
 | |
| template<T>
 | |
| class QgsOptional
 | |
| {
 | |
| %Docstring
 | |
| 
 | |
|  QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
 | |
| 
 | |
|  Often it is used for configuration options which can be enabled or disabled but also have
 | |
|  more internal configuration information that should not be lost when disabling and re-enabling.
 | |
| 
 | |
| .. note::
 | |
| 
 | |
|    For Python you need to use implementations for specific template classes
 | |
| .. note::
 | |
| 
 | |
|    Not available in Python bindings (although SIP file is present for specific implementations).
 | |
| 
 | |
| .. versionadded:: 3.0
 | |
| %End
 | |
| 
 | |
| %TypeHeaderCode
 | |
| #include "qgsoptional.h"
 | |
| %End
 | |
|   public:
 | |
| 
 | |
|     QgsOptional();
 | |
| %Docstring
 | |
|  A QgsOptional is disabled by default if default constructed.
 | |
| %End
 | |
| 
 | |
|     QgsOptional( const T &data );
 | |
| %Docstring
 | |
|  A QgsOptional is enabled by default if constructed with payload.
 | |
| %End
 | |
| 
 | |
|     QgsOptional( const T &data, bool enabled );
 | |
| %Docstring
 | |
|  A QgsOptional constructed with enabled status and data
 | |
| %End
 | |
| 
 | |
|     bool operator== ( const QgsOptional<T> &other ) const;
 | |
| 
 | |
|     operator bool() const;
 | |
| %Docstring
 | |
|  Boolean operator. Will return true if this optional is enabled.
 | |
| %End
 | |
| 
 | |
|     bool enabled() const;
 | |
| %Docstring
 | |
|  Check if this optional is enabled
 | |
| 
 | |
| .. versionadded:: 3.0
 | |
|  :rtype: bool
 | |
| %End
 | |
| 
 | |
|     void setEnabled( bool enabled );
 | |
| %Docstring
 | |
|  Set if this optional is enabled
 | |
| 
 | |
| .. versionadded:: 3.0
 | |
| %End
 | |
| 
 | |
| 
 | |
|     T data() const;
 | |
| %Docstring
 | |
|  Access the payload data
 | |
| 
 | |
| .. versionadded:: 3.0
 | |
|  :rtype: T
 | |
| %End
 | |
| 
 | |
|     void setData( const T &data );
 | |
| %Docstring
 | |
|  Set the payload data
 | |
| 
 | |
| .. versionadded:: 3.0
 | |
| %End
 | |
| 
 | |
| };
 | |
| 
 | |
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/core/qgsoptional.h                                               *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | |
|  ************************************************************************/
 |