3ds Max C++ API Reference
QmaxPoint2Spinner Class Reference

#include <QmaxMultiSpinner.h>

+ Inheritance diagram for QmaxPoint2Spinner:

Public Member Functions

 QmaxPoint2Spinner (QWidget *parent=nullptr)
 
virtual QVector< double > fromMaxTypeVariant (const QVariant &value) const override
 Creates a double array out of a variant with the subclass specific data structure. More...
 
virtual QVariant toMaxTypeVariant (const QVector< double > &spinnerValues) const override
 Creates a variant with the subclass specific data structure out of the multiple spinners values. More...
 
- Public Member Functions inherited from QmaxMultiSpinner
 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...
 
QAbstractSpinBox::StepType stepType () const
 Gets the step type of the spinners. More...
 

Additional Inherited Members

- Public Slots inherited from QmaxMultiSpinner
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 inherited from QmaxMultiSpinner
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...
 
- Properties inherited from QmaxMultiSpinner
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

◆ QmaxPoint2Spinner()

QmaxPoint2Spinner ( QWidget *  parent = nullptr)
inline
332  : QmaxMultiSpinner( 2, 2, parent ) {}
QmaxMultiSpinner(int numSpinners, int numCols, QWidget *parent=nullptr)
Constructs a multi-spinner control with a predefined number of spinners.

Member Function Documentation

◆ fromMaxTypeVariant()

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

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()

Implements QmaxMultiSpinner.

335  {
336  QVector<double> spinnerValues;
337  spinnerValues.reserve( 2 );
338  if ( value.canConvert<Point2>() )
339  {
340  Point2 p = qvariant_cast<Point2>(value);
341  spinnerValues << p.x << p.y;
342  }
343  return spinnerValues;
344  }
QVariant value
The 3ds Max type value wrapped in a variant associated with this spinner control.
Definition: QmaxMultiSpinner.h:39
Definition: point2.h:44
float y
Definition: point2.h:49
float x
Definition: point2.h:48

◆ toMaxTypeVariant()

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

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()

Implements QmaxMultiSpinner.

347  {
348  if ( spinnerValues.count() == 2 )
349  return QVariant::fromValue( Point2( spinnerValues[0], spinnerValues[1] ) );
350  else
351  return QVariant();
352  }