Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
ButtonField Class Reference

The ButtonField class. More...

#include <buttonfield.h>

Inheritance diagram for ButtonField:
EffectField

Public Slots

void SetChecked (bool c)
 A slot for when a widget's (created and connected from CreateWidget() ) checked state is changed. More...
 

Signals

void CheckedChanged (bool)
 A signal emitted whenever the field's internal checked state is changed. More...
 
void Toggled (bool)
 A signal emitted whenever the checked state of a connected widget changes. More...
 
- Signals inherited from EffectField
void Changed ()
 Changed signal. More...
 
void Clicked ()
 Clicked signal. More...
 
void EnabledChanged (bool)
 Enable change state signal. More...
 

Public Member Functions

 ButtonField (EffectRow *parent, const QString &string)
 Reimplementation of EffectField::EffectField(). More...
 
void SetCheckable (bool c)
 Set whether this pushbutton is checkable. More...
 
virtual QWidget * CreateWidget (QWidget *existing=nullptr) override
 Reimplementation of EffectField::CreateWidget() More...
 
- Public Member Functions inherited from EffectField
 EffectField (EffectRow *parent, const QString &i, EffectFieldType t)
 EffectField Constructor. More...
 
EffectRowGetParentRow ()
 Get the EffectRow that this field is a member of. More...
 
const EffectFieldTypetype ()
 Get the type of data to expect from this field. More...
 
const QString & id ()
 Get the unique identifier of this field set in the constructor. More...
 
QVariant GetValueAt (double timecode)
 Get the value of this field at a given timecode. More...
 
void SetValueAt (double time, const QVariant &value)
 Set the value of this field at a given timecode. More...
 
double Now ()
 Get the current clip/media time. More...
 
void PrepareDataForKeyframing (bool enabled, ComboAction *ca)
 Set up keyframing on this field. More...
 
int GetColumnSpan ()
 Get field's column span. More...
 
void SetColumnSpan (int i)
 Set field's column span. More...
 
virtual QString ConvertValueToString (const QVariant &v)
 Convert a value from this field to a string. More...
 
virtual QVariant ConvertStringToValue (const QString &s)
 Convert a string to a value appropriate for this field. More...
 
virtual void UpdateWidgetValue (QWidget *widget, double timecode)
 Update a widget created by CreateWidget() using the value at a given time. More...
 
double GetValidKeyframeHandlePosition (int key, bool post)
 Get the correct X position/time value of a bezier keyframe's handles. More...
 
bool IsEnabled ()
 Return whether this field is enabled or not. More...
 
void SetEnabled (bool e)
 Set the enabled state of this field. More...
 

Private Attributes

bool checkable_
 Internal button text string passed to widgets created by CreateWidget() More...
 
bool checked_
 Internal checked value passed to and from widgets created by CreateWidget() More...
 
QString button_text_
 Internal button text string passed to widgets created by CreateWidget() More...
 

Additional Inherited Members

- Public Types inherited from EffectField
enum  EffectFieldType {
  EFFECT_FIELD_DOUBLE, EFFECT_FIELD_COLOR, EFFECT_FIELD_STRING, EFFECT_FIELD_BOOL,
  EFFECT_FIELD_COMBO, EFFECT_FIELD_FONT, EFFECT_FIELD_FILE, EFFECT_FIELD_UI
}
 The EffectFieldType enum. More...
 
- Public Attributes inherited from EffectField
QVariant persistent_data_
 Persistent data object. More...
 
QVector< EffectKeyframekeyframes
 Keyframe array. More...
 

Detailed Description

The ButtonField class.

A UI-type EffectField. This field is largely an EffectField wrapper around a QPushButton and provides no data that's usable in the Effect. It's primarily useful for other UI functions (e.g. showing/hiding a dialog or other UI elements). This field is not exposed to the external shader API as it requires raw C++ code to connect it to other elements.

As with all widgets created from EffectField::CreateWidget(), you should never interface with the resulting widget directly (apart from adding it to a layout and deleting it when it's unnecessary). All signals/slots should pass through ButtonField instead to keep consistency with every layer involved.

Constructor & Destructor Documentation

ButtonField::ButtonField ( EffectRow parent,
const QString &  string 
)

Reimplementation of EffectField::EffectField().

Member Function Documentation

void ButtonField::CheckedChanged ( bool  )
signal

A signal emitted whenever the field's internal checked state is changed.

Primarily used to set any connected widget's checked state to be consistent with the field's.

QWidget * ButtonField::CreateWidget ( QWidget *  existing = nullptr)
overridevirtual

Reimplementation of EffectField::CreateWidget()

Creates and connects to a QPushButton.

Implements EffectField.

void ButtonField::SetCheckable ( bool  c)

Set whether this pushbutton is checkable.

This function is mainly a wrapper around QPushButton::setCheckable().

"Checkable" means the button can be toggled between a state of being "normal" and being "pressed". In checkable mode this field still cannot be used as a value in an Effect. Instead use BoolField (which uses a QCheckBox representation) for passing values to the Effect that can only be true or false.

Parameters
cTRUE if this button should be checkable or not.
void ButtonField::SetChecked ( bool  c)
slot

A slot for when a widget's (created and connected from CreateWidget() ) checked state is changed.

Parameters
cThe current checked state (automatically filled by the QPushButton::toggled() signal)
void ButtonField::Toggled ( bool  )
signal

A signal emitted whenever the checked state of a connected widget changes.

Any widgets associated with this field will emit this signal when their checked state changes.

Member Data Documentation

QString ButtonField::button_text_
private

Internal button text string passed to widgets created by CreateWidget()

bool ButtonField::checkable_
private

Internal button text string passed to widgets created by CreateWidget()

bool ButtonField::checked_
private

Internal checked value passed to and from widgets created by CreateWidget()


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