18#include "colorwheel.h"
21#include "colormanager.h"
26 setWindowTitle(tr(
"Color Box",
"Color Box window title"));
33void ColorBox::initUI()
46 connect(mColorWheel, &ColorWheel::colorChanged,
this, &ColorBox::onWheelMove);
47 connect(mColorWheel, &ColorWheel::colorSelected,
this, &ColorBox::onWheelRelease);
49 connect(editor(), &Editor::objectLoaded,
this, &ColorBox::updateUI);
52void ColorBox::updateUI()
60 return mColorWheel->color();
63void ColorBox::setColor(
QColor newColor)
65 newColor = newColor.
toHsv();
67 if ( newColor != mColorWheel->color() )
69 mColorWheel->setColor(newColor);
73void ColorBox::onWheelMove(
const QColor& color)
75 emit colorChanged(color);
78void ColorBox::onWheelRelease(
const QColor& color)
80 emit colorChanged(color);
QColor frontColor(bool useIndexedColor=true)
frontColor
QColor toHsv() const const
void setContentsMargins(int left, int top, int right, int bottom)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)