3ds Max C++ API Reference
|
3ds Max's version of a Qt QDoubleSpinBox. More...
#include <QmaxSpinBox.h>
Public Slots | |
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 | |
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... | |
Public Member Functions | |
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 | 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 |
Protected Attributes | |
QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > * | d_ptr |
Properties | |
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... | |
Friends | |
class | QmaxSpinBoxPrivate< double, QmaxDoubleSpinBox > |
3ds Max's version of a Qt QDoubleSpinBox.
This class derives from QDoubleSpinBox and adds some 3ds Max specific properties and behaviors to it. In general, it behaves almost exactly like the regular Qt QDoubleSpinBox, with these additions:
This widget is intended to be used in plug-ins instead of QDoubleSpinBox to ensure consistency with the 3ds Max UI behavior.
|
explicit |
|
virtual |
|
explicitprotected |
double resetValue | ( | ) | const |
The reset value of this component.
If a user right-clicks the button-area of the control, it will be reset to this value.
bool hasAnimationKeyBrackets | ( | ) | const |
Determines if the animation key brackets around the component should be shown.
bool isIndeterminate | ( | ) | const |
Determines if the control should be shown in an indeterministic state.
In this state, it displays '—'
instead of the value.
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 parameter that is only meant to be meaningful on ending an interactive session: the userCancelled parameter.
int visibleDigits | ( | ) | const |
The number of digits (before the period and the decimals) used for the calculation of the minimum width of the component.
The actual displayed number of digits may vary.
The calculation of the minimum width is done in this way:
Qt internally calculates the widths of the renderings of the minimum and maximum values of the QSpinBox using its font, as well as - if set - the specialValueText property to determine the actual width needed to show all possible values. This value is used, if visibleDigits is set to 0.
Then the width of a value containing the absolute of visibleDigits digits, such as "222222.333" for 6 visibleDigits (and 3 decimals), is calculated using the widget's font, including prefix and suffix. If the visibleDigits is greater than 0, this value is compared against the prior calculation result and the minimum of both is used - meaning the QmaxSpin box will reserve up to visibleDigits space, but nor more.
If the visibleDigits is a negative number, the result of this calculation is used, regardless of the fact that it might be able to display all its values in a smaller space. This may be helpful to align different spin- boxes more precisely.
The default value for 3ds Max is 6 - but can be changed by the user with this entry in the 3dsmax.ini
file :
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.
decimals | The 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. |
|
override |
|
override |
|
override |
|
signal |
Gets emitted as soon the component's interactive mode changes.
interactive | The new interactive mode of the component. |
userCancelled | True 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 parameter is only meaningful if the interactive parameter was false. |
|
signal |
Gets emitted when the context menu is shown.
contextMenu | A menu in which custom actions can be added. |
Gets emitted when the visibleDigits have been changed.
visibleDigits | The new value of the visibleDigits property. |
|
slot |
Changes the reset value of this component.
[in] | resetValue | The new resetValue |
|
slot |
Sets whether the animation key brackets around the component should be shown.
|
slot |
Sets whether the control should be shown in an indeterministic state.
In this state, it displays '—'
instead of the value.
Sets the visibleDigits property.
Will emit a visibleDigitsChanged(visibleDigits) signal, if the property was changed.
|
slot |
Resets this component's value to its resetValue.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protected |
|
overrideprotected |
|
overrideprotected |
|
inlineprotected |
|
inlineprotected |
|
friend |
|
protected |
|
readwrite |
The reset value of this Component.
|
readwrite |
Show the animation key brackets around the component.
|
readwrite |
Draws '—'
instead of the value to show the indeterministic state.
|
read |
Determines whether this component is in interactive mode.
|
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.