3ds Max C++ API Reference
QmaxWorldSpinBox Class Reference

A special QmaxDoubleSpinBox that displays its value using the current display units like cm or inches. More...

#include <QmaxSpinBox.h>

+ Inheritance diagram for QmaxWorldSpinBox:

Public Member Functions

 QmaxWorldSpinBox (QWidget *parent=nullptr)
 
QString textFromValue (double val) const override
 
double valueFromText (const QString &text) const override
 
void setDecimals (int decimals)
 Sets the number of decimals used. More...
 
- Public Member Functions inherited from QmaxDoubleSpinBox
 QmaxDoubleSpinBox (QWidget *parent=nullptr)
 
virtual ~QmaxDoubleSpinBox ()
 
double resetValue () const
 The reset value of this component. More...
 
bool hasAnimationKeyBrackets () const
 Determines if the animation key brackets around the component should be shown. More...
 
bool isIndeterminate () const
 Determines if the control should be shown in an indeterministic state. More...
 
bool isInteractive () const
 Determines whether this component is in interactive mode. More...
 
int visibleDigits () const
 The number of digits (before the period and the decimals) used for the calculation of the minimum width of the component. More...
 
void setDecimals (int decimals)
 Sets the number of decimals used. More...
 
QValidator::State validate (QString &input, int &pos) const override
 
void stepBy (int steps) override
 
QSize sizeHint () const override
 
QSize minimumSizeHint () const override
 

Protected Member Functions

void fixup (QString &str) const override
 
- Protected Member Functions inherited from QmaxDoubleSpinBox
void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void timerEvent (QTimerEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 
void contextMenuEvent (QContextMenuEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void setInteractive (bool interactive, bool userCanceled=false)
 
QString textFromValue (double val) const override
 
double valueFromText (const QString &text) const override
 
 QmaxDoubleSpinBox (QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > *d, QWidget *parent=nullptr)
 
QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > * d_func ()
 
const QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > * d_func () const
 

Additional Inherited Members

- Public Slots inherited from QmaxDoubleSpinBox
void setResetValue (double resetValue)
 Changes the reset value of this component. More...
 
void setAnimationKeyBrackets (bool animationKeyBrackets=true)
 Sets whether the animation key brackets around the component should be shown. More...
 
void setIndeterminate (bool indeterminate)
 Sets whether the control should be shown in an indeterministic state. More...
 
void setVisibleDigits (int visibleDigits)
 Sets the visibleDigits property. More...
 
void reset ()
 Resets this component's value to its resetValue. More...
 
- Signals inherited from QmaxDoubleSpinBox
void interactiveChanged (bool interactive, bool userCancelled=false)
 Gets emitted as soon the component's interactive mode changes. More...
 
void contextMenuCustomization (QMenu &contextMenu)
 Gets emitted when the context menu is shown. More...
 
void visibleDigitsChanged (int visibleDigits)
 Gets emitted when the visibleDigits have been changed. More...
 
- Protected Attributes inherited from QmaxDoubleSpinBox
QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > * d_ptr
 
- Properties inherited from QmaxDoubleSpinBox
double resetValue
 The reset value of this Component. More...
 
bool animationKeyBrackets
 Show the animation key brackets around the component. More...
 
bool indeterminate
 Draws '—' instead of the value to show the indeterministic state. More...
 
bool interactive
 Determines whether this component is in interactive mode. 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...
 

Detailed Description

A special QmaxDoubleSpinBox that displays its value using the current display units like cm or inches.

It will follow the settings in the Display Units Scale section of the Units Setup dialog of 3ds Max and should be used in every place a user is supposed to work with a value that represents some length unit in the scene.

See also
QmaxDoubleSpinBox, QmaxLightingSpinBox

Constructor & Destructor Documentation

◆ QmaxWorldSpinBox()

QmaxWorldSpinBox ( QWidget *  parent = nullptr)
explicit

Member Function Documentation

◆ textFromValue()

QString textFromValue ( double  val) const
override

◆ valueFromText()

double valueFromText ( const QString &  text) const
override

◆ setDecimals()

void setDecimals ( int  decimals)

Sets the number of decimals used.

Calling this function with a non-negative param will flag the component to override the 3ds Max default decimal setting. Note that once this method is called, this component will no longer reflect any changes in the 3ds Max settings.

Parameters
decimalsThe number of decimals to be used, or -1 to switch the component back to use the 3ds Max default settings, and re-enable the component to reflect any changes to those settings.
Note
This function only overloads the (non-virtual) setDecimal() function of the underlying QDoubleSpinBox, so beware that this only works when calling it on a pointer/object with an actual type of QmaxDoubleSpinBox or QmaxWorldSpinBox.
See also
QDoubleSpinBox::setDecimals

◆ fixup()

void fixup ( QString &  str) const
overrideprotected