27 QPushButton::paintEvent(event);
29 QPainter Painter(
this);
32 QRect rect =
event->rect();
38 Painter.setRenderHint(QPainter::Antialiasing);
41 Painter.setBrush(QBrush(isEnabled() ?
mColor : Qt::lightGray));
42 Painter.setPen(QPen(isEnabled() ? QColor(25, 25, 25) : Qt::darkGray, 0.5));
45 Painter.drawRoundedRect(rect,
mRadius, Qt::AbsoluteSize);
50 QColorDialog colorDialog;
52 connect(&colorDialog, SIGNAL(currentColorChanged(
const QColor&)),
this, SLOT(
onColorChanged(
const QColor&)));
55 colorDialog.setCurrentColor(
mColor);
56 colorDialog.adjustSize();
91 blockSignals(BlockSignals);
109 QGridLayout* layout =
new QGridLayout;
110 layout->setContentsMargins(0, 0, 0, 0);
111 layout->setHorizontalSpacing(3);
113 this->setLayout(layout);
115 QLabel* name =
new QLabel();
117 name->setFixedSize(100, 18);
118 QFontMetrics fontMetrics(name->font());
119 QString elide = fontMetrics.elidedText(str, Qt::ElideRight, 100);
120 name->setText(elide);
122 name->setToolTip(str);
136 layout->addWidget(name, 0, 0);
146 std::string template_name =
field->getTemplateName();
151 if (template_name == std::string(
typeid(
Color).name()))
156 int r = int(v.r * 255) % 255;
157 int g = int(v.g * 255) % 255;
158 int b = int(v.b * 255) % 255;
186 if (template_name == std::string(
typeid(
Color).name()))
190 float r = float(v1) / 255;
191 float g = float(v2) / 255;
192 float b = float(v3) / 255;
virtual const std::string getTemplateName()
This is an implementation of AdditiveCCD based on peridyno.
QString FormatFieldWidgetName(std::string name)
void disconnect(Node *node, NodePort *port)