17 #include <QVBoxLayout>
18 #include "colorwheel.h"
21 #include "colormanager.h"
33 void 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);
52 void ColorBox::updateUI()
54 QColor newColor = editor()->color()->frontColor();
60 return mColorWheel->color();
63 void ColorBox::setColor(
QColor newColor)
65 newColor = newColor.
toHsv();
67 if ( newColor != mColorWheel->color() )
69 mColorWheel->setColor(newColor);
73 void ColorBox::onWheelMove(
const QColor& color)
75 emit colorChanged(color);
78 void ColorBox::onWheelRelease(
const QColor& color)
80 emit colorChanged(color);
void setContentsMargins(int left, int top, int right, int bottom)
void setStretch(int index, int stretch)
QString tr(const char *sourceText, const char *disambiguation, int n)
QColor toHsv() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)