22 printf(
"QRampWidget\n");
26 printf(
"QRamp Nullptr\n");
34 int curIndex2 = int(f->
getValue().getInterpMode());
35 int enumNum = f->
getValue().InterpolationCount;
36 QComboBox* combox2 =
new QComboBox;
37 combox2->setMaximumWidth(256);
38 combox2->addItem(QString::fromStdString(
"Linear"));
39 combox2->addItem(QString::fromStdString(
"Bezier"));
41 combox2->setCurrentIndex(curIndex2);
42 combox2->setStyleSheet(
"background-color: qlineargradient(spread : pad, x1 : 0, y1 : 0, x2 : 0, y2 : 0.7, stop : 0 rgba(100, 100, 100, 255), stop : 1 rgba(35, 35, 35, 255)); ");
48 QLabel* name =
new QLabel();
49 name->setFixedSize(80, 18);
51 name->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
63 connect(combox2, SIGNAL(currentIndexChanged(
int)), DrawLabel, SLOT(changeInterpValue(
int)));
66 QVBoxLayout* VLayout =
new QVBoxLayout();
67 QSpacerItem* VSpacer =
new QSpacerItem(10, 380, QSizePolicy::Minimum, QSizePolicy::Expanding);
68 VLayout->addItem(VSpacer);
69 VLayout->addWidget(combox2);
70 VLayout->setSpacing(5);
73 QGridLayout* Gridlayout =
new QGridLayout;
74 Gridlayout->setContentsMargins(0, 0, 0, 0);
75 Gridlayout->setSpacing(5);
76 Gridlayout->addWidget(name, 0, 0,3,1, Qt::AlignLeft);
77 Gridlayout->addWidget(DrawLabel,0,1, Qt::AlignCenter);
78 Gridlayout->addLayout(VLayout,0,2, Qt::AlignRight);
79 Gridlayout->setColumnStretch(0, 0);
80 Gridlayout->setColumnStretch(1, 5);
81 Gridlayout->setColumnStretch(2, 0);
84 QLabel* spacingName =
new QLabel(
"Spacing");
90 spacingSlider->
id = -1;
92 spacingSpinner->setRange(1, 40);
94 spacingSpinner->
id = -1;
95 QObject::connect(spacingSlider, SIGNAL(valueChanged(
double)), spacingSpinner, SLOT(setValue(
double)));
96 QObject::connect(spacingSpinner, SIGNAL(valueChanged(
double)), spacingSlider, SLOT(setValue(
double)));
97 QObject::connect(spacingSpinner, SIGNAL(valueChangedAndID(
double,
int)), DrawLabel, SLOT(setSpacingToDrawLabel(
double,
int)));
99 QHBoxLayout* SpacingHlayout =
new QHBoxLayout;
100 SpacingHlayout->setContentsMargins(0, 0, 0, 0);
101 SpacingHlayout->setSpacing(0);
102 SpacingHlayout->addWidget(spacingName);
103 SpacingHlayout->addWidget(spacingSlider);
104 SpacingHlayout->addWidget(spacingSpinner);
106 QHBoxLayout* Hlayout1 =
new QHBoxLayout;
107 Hlayout1->setContentsMargins(0, 0, 0, 0);
108 Hlayout1->setSpacing(0);
112 QHBoxLayout* boolLayout =
new QHBoxLayout;
113 boolLayout->setContentsMargins(0, 0, 0, 0);
114 boolLayout->setSpacing(0);
116 QLabel* boolName =
new QLabel();
117 boolName->setFixedHeight(24);
118 boolName->setText(
"Resample");
121 Checkbox->QWidget::setFixedWidth(20);
122 Checkbox->QAbstractButton::setChecked(f->
getValue().getResample());
124 connect(Checkbox, SIGNAL(mValueChanged(
int)), DrawLabel, SLOT(setLinearResample(
int)));
125 connect(Checkbox, SIGNAL(mValueChanged(
int)), spacingSlider, SLOT(setNewVisable(
int)));
126 connect(Checkbox, SIGNAL(mValueChanged(
int)), spacingSpinner, SLOT(setNewVisable(
int)));
128 if (f->
getValue().getResample() ==
false)
130 spacingSlider->setVisible(
false);
131 spacingSpinner->setVisible(
false);
132 spacingName->setVisible(
false);
136 boolLayout->addWidget(boolName, 0);
137 boolLayout->addStretch(1);
138 boolLayout->addWidget(Checkbox, 0);
143 QVBoxLayout* TotalLayout =
new QVBoxLayout();
144 TotalLayout->setContentsMargins(0, 0, 0, 0);
145 TotalLayout->setSpacing(5);
146 TotalLayout->addLayout(Gridlayout);
147 TotalLayout->addLayout(Hlayout1);
148 TotalLayout->addLayout(boolLayout);
149 TotalLayout->addLayout(SpacingHlayout);
151 this->setLayout(TotalLayout);
170 int w = this->width();
171 int h = this->height();
182 if (
mField->getValue().getUserPoints().empty())
231 QPainter painter(
this);
232 painter.setRenderHint(QPainter::Antialiasing,
true);
235 QBrush brush = QBrush(Qt::black, Qt::SolidPattern);
236 painter.setBrush(brush);
238 painter.drawRect(Bound);
241 QBrush brush2 = QBrush(QColor(100,100,100), Qt::CrossPattern);
242 painter.setBrush(brush2);
243 painter.drawRect(Bound);
248 QVector<QPointF> QCoordArray;
263 QPen LinePen = QPen(QPen(QBrush(QColor(200,200,200)), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
264 painter.setPen(LinePen);
280 int idf = itf->second;
284 painter.drawPath(
mPath);
290 if (QCoordArray.size() >= 2)
292 for (
size_t i = 1; i < QCoordArray.size(); i++)
299 painter.drawPath(
mPath);
305 QPen LinePenWhite = QPen(QPen(QBrush(Qt::white), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
306 painter.setPen(LinePenWhite);
309 for (
size_t i = 0; i < ptNum; i++)
311 painter.setBrush(QBrush(Qt::gray, Qt::SolidPattern));
313 painter.setPen(QPen(QBrush(QColor(200, 200, 200), Qt::SolidPattern), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
320 painter.setBrush(QBrush(QColor(80, 179, 255), Qt::SolidPattern));
322 painter.setPen(QPen(QBrush(Qt::white, Qt::SolidPattern), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
328 painter.setBrush(QBrush(QColor(80, 179, 255), Qt::SolidPattern));
330 painter.setPen(QPen(QBrush(Qt::white, Qt::SolidPattern), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
363 painter.setBrush(QBrush(QColor(80, 179, 255), Qt::SolidPattern));
367 QPen LinePen2 = QPen(QPen(QBrush(QColor(255, 255, 255)), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
368 painter.setPen(LinePen2);
373 QPen LinePen2 = QPen(QPen(QBrush(QColor(255, 255, 255)), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
374 painter.setPen(LinePen2);
389 painter.setBrush(QBrush(QColor(80, 179, 255), Qt::SolidPattern));
390 painter.setPen(QPen(QPen(QBrush(QColor(255, 255, 255)), 2, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin)));
402 painter.setBrush(QBrush(QColor(255, 0, 0), Qt::SolidPattern));
403 painter.setPen(QPen(QPen(QBrush(QColor(255, 0, 0)), 1, Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin)));