Loading...
Searching...
No Matches
Explorer::AddressValueWidget Class Referenceabstract
Inheritance diagram for Explorer::AddressValueWidget:

Detailed Description

An editor for one parameter value, shared by the tree, the address panel and the add / edit address dialog.

Public Member Functions

ossia::value get () const
 
void set (ossia::value t)
 Show a value without counting as an edit of it.
 
bool edited () const noexcept
 Whether the user did anything; an untouched editor writes nothing back.
 
virtual bool commitsImmediately () const noexcept
 
void setDefaultValue (ossia::value v)
 The parameter's declared default, for the "Reset to default" action.
 
const ossia::value & defaultValue () const noexcept
 
void resetToDefault ()
 Puts the declared default back as the user's own edit; nothing if none.
 
void installValueMenu ()
 Gives the editor and every field in it the shared value actions.
 
virtual QString toText () const
 The value as text, for Copy and the text form.
 
virtual std::optional< ossia::value > fromText (const QString &text) const
 
virtual bool hasTextForm () const noexcept
 Whether the value travels as text at all; an impulse does not.
 
virtual bool isTextual () const noexcept
 Whether the editor is already a text field, so "Edit as text" is moot.
 
void changed (ossia::value arg_1)
 
void editingFinished ()
 Focus left the editor entirely.
 

Protected Member Functions

virtual ossia::value getImpl () const =0
 
virtual void setImpl (ossia::value t)=0
 
void markEdited ()
 
void applyExternal (const ossia::value &v)
 

Member Function Documentation

◆ applyExternal()

void Explorer::AddressValueWidget::applyExternal ( const ossia::value &  v)
protected

A value from outside the fields (paste, text form, default), reported as the user's own edit.

◆ commitsImmediately()

virtual bool Explorer::AddressValueWidget::commitsImmediately ( ) const
inlinevirtualnoexcept

The editor acts rather than holds a value (an impulse button), so it commits as it is used and not when it closes.

◆ editingFinished()

void Explorer::AddressValueWidget::editingFinished ( )

Focus left the editor entirely.

Not what makes a cell editor commit – eventFilter() hands Qt a FocusOut for that, so that the commit and the close stay Qt's. This is for anything else that wants to know, and it is emitted after the commit.

◆ fromText()

std::optional< ossia::value > Explorer::AddressValueWidget::fromText ( const QString &  text) const
virtual

That text read back; empty when it names no value of this editor type, in which case nothing is committed.

◆ installValueMenu()

void Explorer::AddressValueWidget::installValueMenu ( )

Gives the editor and every field in it the shared value actions.

Copy, paste, "Edit as text" and "Reset to default", on the right-click that already types a value into a graphics slider elsewhere in score. They act on the value as a whole, which is what a multi-widget editor cannot otherwise offer: a vec4 has four fields and no way to paste four numbers.

Called by the factories below; a widget built by hand calls it itself, once its fields exist.


The documentation for this class was generated from the following files: