|
QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
|
A container for other classes and adds an additional enabled/disabled flag. More...
#include <qgsoptional.h>
Public Member Functions | |
| QgsOptional ()=default | |
| A QgsOptional is disabled by default if default constructed. | |
| QgsOptional (const T &data) | |
| A QgsOptional is enabled by default if constructed with payload. | |
| QgsOptional (const T &data, bool enabled) | |
| A QgsOptional constructed with enabled status and data. | |
| T | data () const |
| Access the payload data. | |
| bool | enabled () const |
| Check if this optional is enabled. | |
| operator bool () const | |
| Boolean operator. | |
| const T * | operator-> () const |
| Access the payload data. | |
| bool | operator== (const QgsOptional< T > &other) const |
| Compare this QgsOptional to another one. | |
| void | setData (const T &data) |
| Set the payload data. | |
| void | setEnabled (bool enabled) |
| Set if this optional is enabled. | |
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.
Definition at line 34 of file qgsoptional.h.
|
default |
A QgsOptional is disabled by default if default constructed.
|
inline |
A QgsOptional is enabled by default if constructed with payload.
Definition at line 45 of file qgsoptional.h.
|
inline |
A QgsOptional constructed with enabled status and data.
Definition at line 53 of file qgsoptional.h.
|
inline |
Access the payload data.
Definition at line 94 of file qgsoptional.h.
|
inline |
Check if this optional is enabled.
Definition at line 76 of file qgsoptional.h.
|
inlineexplicit |
Boolean operator.
Will return true if this optional is enabled.
Definition at line 70 of file qgsoptional.h.
|
inline |
Access the payload data.
Definition at line 88 of file qgsoptional.h.
|
inline |
Compare this QgsOptional to another one.
This will compare the enabled flag and call the == operator of the contained class.
Definition at line 65 of file qgsoptional.h.
|
inline |
Set the payload data.
Definition at line 100 of file qgsoptional.h.
|
inline |
Set if this optional is enabled.
Definition at line 82 of file qgsoptional.h.