3ds Max C++ API Reference
QmaxMultiSpinner Class Referenceabstract

#include <QmaxMultiSpinner.h>

+ Inheritance diagram for QmaxMultiSpinner:

Public Slots

void setValue (const QVariant &value)
 Sets the value associated with this spinner control. More...
 
void setResetValue (const QVariant &resetValue)
 Changes the reset value of this component. More...
 
void setAnimationKeyBrackets (bool animationKeyBrackets=true)
 Sets whether the animation key brackets around the spinners should be shown. More...
 
void reset ()
 Resets this components value to its resetValue. More...
 
void setVisibleDigits (int visibleDigits)
 Sets the visibleDigits property. More...
 
void setStepType (QAbstractSpinBox::StepType stepType)
 Sets the step type of the spinners. More...
 

Signals

void valueChanged (const QVariant &value)
 Emitted if the actual variant value has changed. More...
 
void interactiveChanged (bool interactive, bool userCancelled=false)
 Emitted as soon as the components interactive mode changes. More...
 
void visibleDigitsChanged (int visibleDigits)
 Gets emitted when the visibleDigits have been changed. More...
 

Public Member Functions

 QmaxMultiSpinner (int numSpinners, int numCols, QWidget *parent=nullptr)
 Constructs a multi-spinner control with a predefined number of spinners. More...
 
virtual ~QmaxMultiSpinner ()
 
QVariant value () const
 The 3ds Max type value wrapped in a variant associated with this spinner control. More...
 
QVariant resetValue () const
 The reset value of this component. More...
 
bool hasAnimationKeyBrackets () const
 Determines if the animation key brackets around the spinners should be shown. More...
 
bool isInteractive () const
 Determines whether this component is in interactive mode. More...
 
double singleStep () const
 Returns the step increment/decrement value of the spinners. More...
 
void setSingleStep (double val)
 Sets the step increment/decrement value of the spinners. More...
 
double minimum () const
 Returns the minimum value of the spinners. More...
 
void setMinimum (double min)
 Sets the minimum value of the spinners. More...
 
double maximum () const
 Returns the maximum value of the spinners. More...
 
void setMaximum (double max)
 Sets the maximum value of the spinners. More...
 
QString prefix () const
 Returns the prefix of the spinners. More...
 
void setPrefix (const QString &prefix)
 Sets the prefix of the spinners. More...
 
QString suffix () const
 Returns the suffix of the spinners. More...
 
void setSuffix (const QString &suffix)
 Sets the suffix of the spinners. More...
 
int decimals () const
 Returns the number of decimals of the spinners. More...
 
void setDecimals (int decimals)
 Sets the step number of decimals of the spinners. More...
 
int visibleDigits () const
 The number of digits used for the calculation of the minimum width of the component - values from -127 to +127 are valid, the default value is 6. More...
 
int numColumns () const
 Returns the number of layout columns in which the multiple spinners are arranged. More...
 
void setNumColumns (int numCols)
 Sets the number of layout columns in which the multiple spinners should be arranged. More...
 
virtual QVector< double > fromMaxTypeVariant (const QVariant &value) const =0
 Creates a double array out of a variant with the subclass specific data structure. More...
 
virtual QVariant toMaxTypeVariant (const QVector< double > &spinnerValues) const =0
 Creates a variant with the subclass specific data structure out of the multiple spinners values. More...
 
QAbstractSpinBox::StepType stepType () const
 Gets the step type of the spinners. More...
 

Properties

QVariant value
 The 3ds Max type value wrapped in a variant associated with this spinner control. More...
 
QVariant resetValue
 The reset value of this Component. More...
 
bool animationKeyBrackets
 Indicates whether the animation key brackets are shown around the component. More...
 
double minimum
 The minimum value of the spinners. More...
 
double maximum
 The maximum value of the spinners. More...
 
double singleStep
 The step increment/decrement value of the spinners. More...
 
QString prefix
 The prefix of the spinners. More...
 
QString suffix
 The suffix of the spinners. More...
 
int decimals
 The decimals of the spinners. More...
 
int visibleDigits
 The number of digits used for the calculation of the minimum width of the component - values from -127 to +127 are valid, the default value is 6. More...
 
QAbstractSpinBox::StepType stepType
 The step type of the spinners. More...
 

Constructor & Destructor Documentation

◆ QmaxMultiSpinner()

QmaxMultiSpinner ( int  numSpinners,
int  numCols,
QWidget *  parent = nullptr 
)
explicit

Constructs a multi-spinner control with a predefined number of spinners.

Parameters
numSpinnersThe number of spinners the control should have.
numColsThe number of layout columns in which the multiple spinners should be arranged.
parentThe control's widget parent.

◆ ~QmaxMultiSpinner()

virtual ~QmaxMultiSpinner ( )
virtual

Member Function Documentation

◆ value()

QVariant value ( ) const

The 3ds Max type value wrapped in a variant associated with this spinner control.

See also
setValue(), valueChanged()

◆ resetValue()

QVariant resetValue ( ) const

The reset value of this component.

If a user right-clicks the button-area of a spinner, it will be reset to this value.

Returns
The reset - aka default - value of this component.
See also
reset(), setResetValue()

◆ hasAnimationKeyBrackets()

bool hasAnimationKeyBrackets ( ) const

Determines if the animation key brackets around the spinners should be shown.

Note
The whole animationKeyBrackets property normally gets driven internally by a param-block mapper, so if this component is bound to a param-block, it may change automatically while scrubbing through the time-line, etc. The brackets are shown for all spinners of the control.
Returns
True, if the animation key brackets should be shown.
See also
setAnimationKeyBrackets()

◆ isInteractive()

bool isInteractive ( ) const

Determines whether this component is in interactive mode.

A Component is in interactive mode if a user is changing its value in a continuous manner, that may be cancelled by the user at the end of the interaction. For the spinner this is while dragging the buttons to change the value or by holding down the left mouse-button over a button to increment or decrement the value over time.

The basic idea of having an interactive mode is to enable the undo/redo system to track those interactive continuous changes as ONE single change (or even just ignores the change on cancel).

Therefore the interactiveChanged signal that gets emitted as soon as the interactive mode changes has an additional param that is only meant to be meaningful on ending an interactive session: the userCancelled param.

See also
interactiveChanged()

◆ singleStep()

double singleStep ( ) const

Returns the step increment/decrement value of the spinners.

See also
setSingleStep()

◆ setSingleStep()

void setSingleStep ( double  val)

Sets the step increment/decrement value of the spinners.

See also
singleStep()

◆ minimum()

double minimum ( ) const

Returns the minimum value of the spinners.

See also
setMinimum(), maximum(), setMaximum()

◆ setMinimum()

void setMinimum ( double  min)

Sets the minimum value of the spinners.

See also
minimum(), maximum(), setMaximum()

◆ maximum()

double maximum ( ) const

Returns the maximum value of the spinners.

See also
setMaximum(), minimum(), setMinimum()

◆ setMaximum()

void setMaximum ( double  max)

Sets the maximum value of the spinners.

See also
maximum(), minimum(), setMinimum()

◆ prefix()

QString prefix ( ) const

Returns the prefix of the spinners.

See also
setPrefix(), suffix(), setSuffix()

◆ setPrefix()

void setPrefix ( const QString &  prefix)

Sets the prefix of the spinners.

See also
prefix(), suffix(), setSuffix()

◆ suffix()

QString suffix ( ) const

Returns the suffix of the spinners.

See also
setSuffix(), prefix(), setPrefix()

◆ setSuffix()

void setSuffix ( const QString &  suffix)

Sets the suffix of the spinners.

See also
suffix(), prefix(), setPrefix()

◆ decimals()

int decimals ( ) const

Returns the number of decimals of the spinners.

See also
setDecimals()

◆ setDecimals()

void setDecimals ( int  decimals)

Sets the step number of decimals of the spinners.

See also
decimals()

◆ visibleDigits()

int visibleDigits ( ) const

The number of digits used for the calculation of the minimum width of the component - values from -127 to +127 are valid, the default value is 6.

See also
visibleDigits(), setVisibleDigits(), visibleDigitsChanged()

◆ numColumns()

int numColumns ( ) const

Returns the number of layout columns in which the multiple spinners are arranged.

See also
setNumColumns()

◆ setNumColumns()

void setNumColumns ( int  numCols)

Sets the number of layout columns in which the multiple spinners should be arranged.

Parameters
numColsThe number of layout columns.
See also
numColumns()

◆ fromMaxTypeVariant()

virtual QVector<double> fromMaxTypeVariant ( const QVariant &  value) const
pure virtual

Creates a double array out of a variant with the subclass specific data structure.

The implementation of this method should use the given variant, containing its subclass specific data structure, to create a double array which can be used to fill the spinner values of the control. For instance a QVariant with a Point2 value would construct and return a two value double array. The array order should match the order of the spinners in the UI.

Parameters
valueA variant with the subclass specific data structure.
Returns
A double array containing the values for the spinners of the control.
See also
toMaxTypeVariant()

Implemented in QmaxMatrix3Spinner, QmaxPoint4Spinner, QmaxPoint3Spinner, and QmaxPoint2Spinner.

◆ toMaxTypeVariant()

virtual QVariant toMaxTypeVariant ( const QVector< double > &  spinnerValues) const
pure virtual

Creates a variant with the subclass specific data structure out of the multiple spinners values.

The implementation of this method should use the given double array values, which represent the spinner values as shown in UI, to construct a QVariant containing the subclass specific data structure. For instance a two value double array would construct and return a QVariant with a Point2 value. The spinner values in the array match the order as shown in the UI.

Parameters
spinnerValuesThe multiple spinner values for the creation of the variant.
Returns
A variant with the subclass specific data structure.
See also
fromMaxTypeVariant()

Implemented in QmaxMatrix3Spinner, QmaxPoint4Spinner, QmaxPoint3Spinner, and QmaxPoint2Spinner.

◆ stepType()

QAbstractSpinBox::StepType stepType ( ) const

Gets the step type of the spinners.

The step type can be either QAbstractSpinBox::DefaultStepType or QAbstractSpinBox::AdaptiveDecimalStepType. DefaultStepType uses the singleStep for each step, while AdaptiveDecimalStepType uses a step size based on the current value.

Note
This is set automatically by the 3ds Max param block binding if the scale of a parameter is set to SPIN_AUTOSCALE.
See also
https://doc.qt.io/qt-5/qdoublespinbox.html#stepType-prop

◆ valueChanged

void valueChanged ( const QVariant &  value)
signal

Emitted if the actual variant value has changed.

Parameters
valueThe new value associated with this spinner control.
See also
value(), setValue().

◆ interactiveChanged

void interactiveChanged ( bool  interactive,
bool  userCancelled = false 
)
signal

Emitted as soon as the components interactive mode changes.

Parameters
interactiveThe new interactive mode of the component.
userCancelledTrue if the user actively cancelled an interactive session, for example by pressing the right mouse-button during a interactive dragging-operation. As a matter of fact, this param is only meaningful if the interactive param was false.
See also
interactiveChanged(), interactiveChanged

◆ visibleDigitsChanged

void visibleDigitsChanged ( int  visibleDigits)
signal

Gets emitted when the visibleDigits have been changed.

Parameters
visibleDigitsThe new value of the visibleDigits property.
See also
QmaxDoubleSpinBox::visibleDigits, setVisibleDigits(), visibleDigits()

◆ setValue

void setValue ( const QVariant &  value)
slot

Sets the value associated with this spinner control.

Parameters
valueThe new value associated with this spinner control. If the new value is different from the old one, a valueChanged() is emitted.
See also
value(), valueChanged().

◆ setResetValue

void setResetValue ( const QVariant &  resetValue)
slot

Changes the reset value of this component.

Parameters
resetValueThe new resetValue
See also
reset(), resetValue()

◆ setAnimationKeyBrackets

void setAnimationKeyBrackets ( bool  animationKeyBrackets = true)
slot

Sets whether the animation key brackets around the spinners should be shown.

Note
The whole animationKeyBrackets property normally gets driven internally by a param-block mapper, so if this component is bound to a param-block, it may change automatically while scrubbing through the time-line, etc.
See also
hasAnimationKeyBrackets()

◆ reset

void reset ( )
slot

Resets this components value to its resetValue.

See also
setResetValue(), resetValue()

◆ setVisibleDigits

void setVisibleDigits ( int  visibleDigits)
slot

Sets the visibleDigits property.

Will emit a visibleDigitsChanged(visibleDigits) signal, if the property was changed.

See also
QmaxDoubleSpinBox::visibleDigits, visibleDigits(), visibleDigitsChanged

◆ setStepType

void setStepType ( QAbstractSpinBox::StepType  stepType)
slot

Sets the step type of the spinners.

The step type can be either QAbstractSpinBox::DefaultStepType or QAbstractSpinBox::AdaptiveDecimalStepType. DefaultStepType uses the singleStep for each step, while AdaptiveDecimalStepType uses a step size based on the current value.

Note
This is set automatically by the 3ds Max param block binding if the scale of a parameter is set to SPIN_AUTOSCALE.
See also
https://doc.qt.io/qt-5/qdoublespinbox.html#stepType-prop

Property Documentation

◆ value

QVariant value
readwrite

The 3ds Max type value wrapped in a variant associated with this spinner control.

See also
value(), setValue(), valueChanged()

◆ resetValue

QVariant resetValue
readwrite

The reset value of this Component.

See also
resetValue(), setResetValue()

◆ animationKeyBrackets

bool animationKeyBrackets
readwrite

Indicates whether the animation key brackets are shown around the component.

See also
hasAnimationKeyBrackets(), setAnimationKeyBrackets()

◆ minimum

double minimum
readwrite

The minimum value of the spinners.

The default is 0.

See also
minimum(), setMinimum(), maximum(), setMaximum()

◆ maximum

double maximum
readwrite

The maximum value of the spinners.

The default is 99.99.

See also
maximum(), setMaximum(), minimum(), setMinimum()

◆ singleStep

double singleStep
readwrite

The step increment/decrement value of the spinners.

The singleStep value is applied to the current spinner value when the user clicks on the up/down arrow buttons of the spinner. The default is 1.0.

See also
singleStep(), setSingleStep()

◆ prefix

QString prefix
readwrite

The prefix of the spinners.

The prefix is prepended to the displayed value of the spinner. A common usage for a suffix would be the display of a unit of measurement or a currency symbol. For displaying no prefix just apply an empty string. By default no prefix is shown.

See also
prefix(), setPrefix(), suffix(), setSuffix()

◆ suffix

QString suffix
readwrite

The suffix of the spinners.

The suffix is appended to the displayed value of the spinner. A common usage for a suffix would be the display of a unit of measurement or a currency symbol. For displaying no suffix just apply an empty string. By default no suffix is shown.

See also
suffix(), setSuffix(), prefix(), setPrefix()

◆ decimals

int decimals
readwrite

The decimals of the spinners.

Sets how many decimals the spinners will use for displaying and interpreting doubles. The default is 3.

See also
decimals(), setDecimals()

◆ visibleDigits

int visibleDigits
readwrite

The number of digits used for the calculation of the minimum width of the component - values from -127 to +127 are valid, the default value is 6.

See also
visibleDigits(), setVisibleDigits(), visibleDigitsChanged()

◆ stepType

QAbstractSpinBox::StepType stepType
readwrite

The step type of the spinners.

The step type can be either QAbstractSpinBox::DefaultStepType or QAbstractSpinBox::AdaptiveDecimalStepType. DefaultStepType uses the singleStep for each step, while AdaptiveDecimalStepType uses a step size based on the current value.

Note
This is set automatically by the 3ds Max param block binding if the scale of a parameter is set to SPIN_AUTOSCALE.
See also
https://doc.qt.io/qt-5/qdoublespinbox.html#stepType-prop