3ds Max C++ API Reference
|
Simple UI component to display and modify a color-value. More...
#include <QMaxColorSwatch.h>
Public Slots | |
void | setValue (const AColor &value) |
Sets the color value associated with this color swatch. More... | |
void | setUseAlpha (bool useAlpha) |
Sets whether the color swatch should expose the alpha component. More... | |
void | setTitle (const QString &title) |
Sets the title used in the color-picker, when opened. More... | |
void | setAnimationKeyBrackets (bool show_brackets) |
Sets whether the animation key brackets should be shown. More... | |
void | setIgnoreColorCorrection (bool ignore) |
Sets whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value. More... | |
Signals | |
void | valueChanged (const AColor &value) |
Will be emitted, if the actual color value has changed. More... | |
void | interactiveChanged (bool interactive, bool canceled=false) |
Will be emitted, if swatch changed its interactive state. More... | |
Public Member Functions | |
QMaxColorSwatch (QWidget *parent=nullptr) | |
Default constructor. More... | |
virtual | ~QMaxColorSwatch () |
AColor | value () const |
The color value associated with this color swatch. More... | |
bool | useAlpha () const |
Determines whether the color swatch should expose the alpha component. More... | |
QString | title () const |
The title used in the color-picker, when opened. More... | |
bool | isInteractive () const |
Determines whether the color swatch is in interactive mode. More... | |
bool | hasAnimationKeyBrackets () const |
If the animation key brackets should be shown. More... | |
bool | useModalPicker () const |
Determines whether the modal version of the color picker dialog should be used. More... | |
void | setUseModalPicker (bool use_modal_picker) |
Sets, if a modal color-picker should be used. More... | |
bool | ignoreColorCorrection () const |
Determines whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value. More... | |
virtual QSize | minimumSizeHint () const override |
Protected Member Functions | |
QMaxColorSwatch (QMaxColorSwatchPrivate *_d, QWidget *parent=nullptr) | |
virtual void | paintEvent (QPaintEvent *event) override |
virtual void | mousePressEvent (QMouseEvent *event) override |
virtual void | mouseMoveEvent (QMouseEvent *event) override |
virtual void | mouseReleaseEvent (QMouseEvent *event) override |
virtual void | dragEnterEvent (QDragEnterEvent *event) override |
virtual void | dragMoveEvent (QDragMoveEvent *event) override |
virtual void | dropEvent (QDropEvent *event) override |
void | startInteractive () |
void | stopInteractive (bool canceled) |
Q_DECLARE_PRIVATE (QMaxColorSwatch) | |
Properties | |
AColor | value |
The color value associated with this color swatch. More... | |
bool | useAlpha |
Determines whether the color swatch should expose the alpha component. More... | |
QString | title |
The title of the color picker when shown. More... | |
bool | useModalPicker |
Determines whether the modal version of the color picker dialog should be used. More... | |
bool | ignoreColorCorrection |
Determines whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value. More... | |
bool | animationKeyBrackets |
Show the animation key brackets around the component. More... | |
bool | interactive |
Determines whether the color swatch is in interactive mode. More... | |
Friends | |
class | ColorSwatch |
class | CSCallback |
Simple UI component to display and modify a color-value.
The color aka 'value' is stored as a AColor, what means that the RGB color and alpha channels are stored in floats in a range between 0.0f and 1.0f.
If the alpha channel should not be used, please set the useAlpha property to false, in that case the ColorPicker shown on left mouse click will display in non-alpha mode.
|
explicit |
Default constructor.
Constructs a new QMaxColorSwatch with the following settings:
|
virtual |
|
explicitprotected |
AColor value | ( | ) | const |
The color value associated with this color swatch.
bool useAlpha | ( | ) | const |
Determines whether the color swatch should expose the alpha component.
QString title | ( | ) | const |
The title used in the color-picker, when opened.
bool isInteractive | ( | ) | const |
Determines whether the color swatch is in interactive mode.
A color watch is in interactive mode, while the color picker dialog is opened and associated to this color swatch - so the user may perform several sequential 'interactive' color changes, that are meant to be captured as one common value change in terms of the undo/redo history.
Since the user has the option to cancel the interactive changes - by pressing the "Cancel" button on the color picker dialog, the signal emitted by that change also includes that information.
bool hasAnimationKeyBrackets | ( | ) | const |
If the animation key brackets should be shown.
bool useModalPicker | ( | ) | const |
Determines whether the modal version of the color picker dialog should be used.
When using the non-modal version of the color picker dialog, what's the default behavior, a color picker dialog can be used to manipulate the color of different swatches by just clicking on them. The active swatch get painted with white outline, so the user can distinguish what color swatch is to be modified. Switching color swatches in that way will emit an interactiveChanged signal to the previous active color swatch, as if the user had clicked on the Ok button to close the dialog.
void setUseModalPicker | ( | bool | use_modal_picker | ) |
Sets, if a modal color-picker should be used.
bool ignoreColorCorrection | ( | ) | const |
Determines whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value.
|
overridevirtual |
Will be emitted, if the actual color value has changed.
value | The new color value associated with this color swatch. Please note, that Qt internally takes care if this signal gets handled asynchronously and creates a copy of this parameter, so it's always safe to access its data. |
|
signal |
Will be emitted, if swatch changed its interactive state.
interactive | The new interactive state of this color swatch. |
canceled | If the interactive param is false, meaning the color picker dialog has been closed, the user has canceled the previous interactive changes. In that case, no redo/undo record should be filed. |
Sets the color value associated with this color swatch.
value | The new color to be associated with this color swatch. If the new color differs from the recent one, a valueChange() is emitted. |
|
slot |
Sets whether the color swatch should expose the alpha component.
|
slot |
|
slot |
Sets whether the animation key brackets should be shown.
|
slot |
Sets whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
protected |
|
protected |
|
protected |
|
friend |
|
friend |
|
readwrite |
The color value associated with this color swatch.
|
readwrite |
Determines whether the color swatch should expose the alpha component.
|
readwrite |
The title of the color picker when shown.
|
readwrite |
Determines whether the modal version of the color picker dialog should be used.
|
readwrite |
Determines whether the color swatch should ignore the application-wide color correction and display the raw RGB(A) value.
|
readwrite |
Show the animation key brackets around the component.
|
read |
Determines whether the color swatch is in interactive mode.