DisplayOptionsRegistry
DisplayOptionsRegistry
Generic registry for all display option types. More…
#include <DisplayOptionsRegistry.hpp>
Inherits from QObject
Public Signals
| Name | |
|---|---|
| void | optionsChanged(QString const & key, QString const & type_name) Emitted when display options are set or modified. |
| void | optionsRemoved(QString const & key, QString const & type_name) Emitted when display options are removed. |
| void | visibilityChanged(QString const & key, QString const & type_name, bool visible) Emitted when visibility changes. |
Public Functions
| Name | |
|---|---|
| DisplayOptionsRegistry(MediaWidgetStateData * data, QObject * parent =[nullptr]) Construct a DisplayOptionsRegistry. |
|
| ~DisplayOptionsRegistry() override =default | |
| template <typename T > void |
set(QString const & key, T const & options) Set display options for a key. |
| template <typename T > T const * |
get(QString const & key) const Get display options for a key. |
| template <typename T > T * |
getMutable(QString const & key) Get mutable display options for a key. |
| template <typename T > bool |
remove(QString const & key) Remove display options for a key. |
| template <typename T > bool |
has(QString const & key) const Check if options exist for a key. |
| template <typename T > QStringList |
keys() const Get all keys that have options of a given type. |
| template <typename T > QStringList |
enabledKeys() const Get keys where options have is_visible == true. |
| template <typename T > int |
count() const Get count of options for a given type. |
| bool | setVisible(QString const & key, QString const & type_name, bool visible) Set visibility for options by key and type name. |
| bool | isVisible(QString const & key, QString const & type_name) const Get visibility for options by key and type name. |
| template <typename T > void |
notifyChanged(QString const & key) Manually emit optionsChanged signal. |
| void | set(QString const & key, LineDisplayOptions const & options) |
| void | set(QString const & key, MaskDisplayOptions const & options) |
| void | set(QString const & key, PointDisplayOptions const & options) |
| void | set(QString const & key, TensorDisplayOptions const & options) |
| void | set(QString const & key, DigitalIntervalDisplayOptions const & options) |
| void | set(QString const & key, MediaDisplayOptions const & options) |
| LineDisplayOptions const * | get(QString const & key) const |
| MaskDisplayOptions const * | get(QString const & key) const |
| PointDisplayOptions const * | get(QString const & key) const |
| TensorDisplayOptions const * | get(QString const & key) const |
| DigitalIntervalDisplayOptions const * | get(QString const & key) const |
| MediaDisplayOptions const * | get(QString const & key) const |
| LineDisplayOptions * | getMutable(QString const & key) |
| MaskDisplayOptions * | getMutable(QString const & key) |
| PointDisplayOptions * | getMutable(QString const & key) |
| TensorDisplayOptions * | getMutable(QString const & key) |
| DigitalIntervalDisplayOptions * | getMutable(QString const & key) |
| MediaDisplayOptions * | getMutable(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | set(QString const & key, LineDisplayOptions const & options) |
| void | set(QString const & key, MaskDisplayOptions const & options) |
| void | set(QString const & key, PointDisplayOptions const & options) |
| void | set(QString const & key, TensorDisplayOptions const & options) |
| void | set(QString const & key, DigitalIntervalDisplayOptions const & options) |
| void | set(QString const & key, MediaDisplayOptions const & options) |
| LineDisplayOptions const * | get(QString const & key) const |
| MaskDisplayOptions const * | get(QString const & key) const |
| PointDisplayOptions const * | get(QString const & key) const |
| TensorDisplayOptions const * | get(QString const & key) const |
| DigitalIntervalDisplayOptions const * | get(QString const & key) const |
| MediaDisplayOptions const * | get(QString const & key) const |
| LineDisplayOptions * | getMutable(QString const & key) |
| MaskDisplayOptions * | getMutable(QString const & key) |
| PointDisplayOptions * | getMutable(QString const & key) |
| TensorDisplayOptions * | getMutable(QString const & key) |
| DigitalIntervalDisplayOptions * | getMutable(QString const & key) |
| MediaDisplayOptions * | getMutable(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | remove(QString const & key) |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| bool | has(QString const & key) const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | keys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| QStringList | enabledKeys() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| int | count() const |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| void | notifyChanged(QString const & key) |
| template <typename T > QString |
typeName() Get the type name string for a display options type. |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
| QString | typeName() |
Detailed Description
class DisplayOptionsRegistry;Generic registry for all display option types.
Replaces the separate setOptions/getOptions/remove*Options methods in MediaWidgetState with a single type-safe API.
Public Signals Documentation
signal optionsChanged
void optionsChanged(
QString const & key,
QString const & type_name
)Emitted when display options are set or modified.
Parameters:
- key The data key
- type_name The type name (“line”, “mask”, etc.)
signal optionsRemoved
void optionsRemoved(
QString const & key,
QString const & type_name
)Emitted when display options are removed.
Parameters:
- key The data key
- type_name The type name
signal visibilityChanged
void visibilityChanged(
QString const & key,
QString const & type_name,
bool visible
)Emitted when visibility changes.
Parameters:
- key The data key
- type_name The type name
- visible New visibility state
Public Functions Documentation
function DisplayOptionsRegistry
explicit DisplayOptionsRegistry(
MediaWidgetStateData * data,
QObject * parent =nullptr
)Construct a DisplayOptionsRegistry.
Parameters:
- data Non-owning pointer to the underlying state data
- parent Parent QObject (typically MediaWidgetState)
function ~DisplayOptionsRegistry
~DisplayOptionsRegistry() override =defaultfunction set
template <typename T >
void set(
QString const & key,
T const & options
)Set display options for a key.
Parameters:
- key The data key (e.g., “whisker_1”)
- options The display options to store
Template Parameters:
- T Display options type (LineDisplayOptions, MaskDisplayOptions, etc.)
The type is inferred from the options argument. Emits optionsChanged signal.
function get
template <typename T >
T const * get(
QString const & key
) constGet display options for a key.
Parameters:
- key The data key
Template Parameters:
- T Display options type to retrieve
Return: Pointer to options, or nullptr if not found
function getMutable
template <typename T >
T * getMutable(
QString const & key
)Get mutable display options for a key.
Parameters:
- key The data key
Template Parameters:
- T Display options type to retrieve
Return: Pointer to options, or nullptr if not found
Use sparingly - prefer set() to ensure signals are emitted. Call notifyChanged() after modifying the returned options.
function remove
template <typename T >
bool remove(
QString const & key
)Remove display options for a key.
Parameters:
- key The data key
Template Parameters:
- T Display options type to remove
Return: true if options were found and removed
Emits optionsRemoved signal if options existed.
function has
template <typename T >
bool has(
QString const & key
) constCheck if options exist for a key.
Parameters:
- key The data key
Template Parameters:
- T Display options type to check
Return: true if options exist
function keys
template <typename T >
QStringList keys() constGet all keys that have options of a given type.
Template Parameters:
- T Display options type
Return: List of keys
function enabledKeys
template <typename T >
QStringList enabledKeys() constGet keys where options have is_visible == true.
Template Parameters:
- T Display options type
Return: List of enabled/visible keys
function count
template <typename T >
int count() constGet count of options for a given type.
Template Parameters:
- T Display options type
Return: Number of stored options
function setVisible
bool setVisible(
QString const & key,
QString const & type_name,
bool visible
)Set visibility for options by key and type name.
Parameters:
- key The data key
- type_name Type name (“line”, “mask”, “point”, “tensor”, “interval”, “media”)
- visible New visibility state
Return: true if options were found and updated
function isVisible
bool isVisible(
QString const & key,
QString const & type_name
) constGet visibility for options by key and type name.
Parameters:
- key The data key
- type_name Type name
Return: true if options exist and are visible
function notifyChanged
template <typename T >
void notifyChanged(
QString const & key
)Manually emit optionsChanged signal.
Parameters:
- key The data key
Template Parameters:
- T Display options type that was modified
Call this after using getMutable() to modify options in-place.
function set
void set(
QString const & key,
LineDisplayOptions const & options
)function set
void set(
QString const & key,
MaskDisplayOptions const & options
)function set
void set(
QString const & key,
PointDisplayOptions const & options
)function set
void set(
QString const & key,
TensorDisplayOptions const & options
)function set
void set(
QString const & key,
DigitalIntervalDisplayOptions const & options
)function set
void set(
QString const & key,
MediaDisplayOptions const & options
)function get
LineDisplayOptions const * get(
QString const & key
) constfunction get
MaskDisplayOptions const * get(
QString const & key
) constfunction get
PointDisplayOptions const * get(
QString const & key
) constfunction get
TensorDisplayOptions const * get(
QString const & key
) constfunction get
DigitalIntervalDisplayOptions const * get(
QString const & key
) constfunction get
MediaDisplayOptions const * get(
QString const & key
) constfunction getMutable
LineDisplayOptions * getMutable(
QString const & key
)function getMutable
MaskDisplayOptions * getMutable(
QString const & key
)function getMutable
PointDisplayOptions * getMutable(
QString const & key
)function getMutable
TensorDisplayOptions * getMutable(
QString const & key
)function getMutable
DigitalIntervalDisplayOptions * getMutable(
QString const & key
)function getMutable
MediaDisplayOptions * getMutable(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function set
void set(
QString const & key,
LineDisplayOptions const & options
)function set
void set(
QString const & key,
MaskDisplayOptions const & options
)function set
void set(
QString const & key,
PointDisplayOptions const & options
)function set
void set(
QString const & key,
TensorDisplayOptions const & options
)function set
void set(
QString const & key,
DigitalIntervalDisplayOptions const & options
)function set
void set(
QString const & key,
MediaDisplayOptions const & options
)function get
LineDisplayOptions const * get(
QString const & key
) constfunction get
MaskDisplayOptions const * get(
QString const & key
) constfunction get
PointDisplayOptions const * get(
QString const & key
) constfunction get
TensorDisplayOptions const * get(
QString const & key
) constfunction get
DigitalIntervalDisplayOptions const * get(
QString const & key
) constfunction get
MediaDisplayOptions const * get(
QString const & key
) constfunction getMutable
LineDisplayOptions * getMutable(
QString const & key
)function getMutable
MaskDisplayOptions * getMutable(
QString const & key
)function getMutable
PointDisplayOptions * getMutable(
QString const & key
)function getMutable
TensorDisplayOptions * getMutable(
QString const & key
)function getMutable
DigitalIntervalDisplayOptions * getMutable(
QString const & key
)function getMutable
MediaDisplayOptions * getMutable(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function remove
bool remove(
QString const & key
)function has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction has
bool has(
QString const & key
) constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction keys
QStringList keys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction enabledKeys
QStringList enabledKeys() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction count
int count() constfunction notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function notifyChanged
void notifyChanged(
QString const & key
)function typeName
template <typename T >
static QString typeName()Get the type name string for a display options type.
Template Parameters:
- T Display options type
Return: Type name (“line”, “mask”, “point”, “tensor”, “interval”, “media”)
function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()function typeName
static QString typeName()Updated on 2026-11-13 at 20:25:41 +0000