49 QFrame(parent), mFixPosX(false), mFixPosY(false), mMinSize(minimumSize)
68 void MousePadWidgetInternal::fixPos()
72 mLastPos.rx() = this->width() / 2;
76 mLastPos.ry() = this->height() / 2;
82 mLastPos = QPoint(this->width() / 2, this->height() / 2);
89 mLastPos =
event->pos();
96 QPoint delta =
event->pos() - mLastPos;
98 double padSize = (this->size().width() + this->size().height()) / 2.0;
99 QPointF deltaN(
double(delta.x()) / padSize,
double(delta.y()) / padSize);
103 mLastPos =
event->pos();
110 mLastPos = QPoint(this->width() / 2, this->height() / 2);
117 mLastPos = QPoint(this->width() / 2, this->height() / 2);
126 Vector3D center(this->width() / 2, this->height() / 2, 0);
127 double radius = center.length();
128 QPoint qcenter(this->width() / 2, this->height() / 2);
130 QRadialGradient radialGrad(qcenter, radius, mLastPos);
131 radialGrad.setColorAt(0.0, QColor(
"khaki"));
132 radialGrad.setColorAt(0.4, QColor(
"lightgrey"));
133 radialGrad.setColorAt(1, QColor(
"dimgrey"));
135 QColor color(146, 0, 146);
136 QBrush brush(radialGrad);
138 p.setPen(QColor(146, 0, 146));
139 p.setBrush(QColor(146, 0, 146));
140 p.fillRect(0, 0, width() - 1, height() - 1, brush);
154 this->setFrameStyle(QFrame::Panel | QFrame::Raised);
155 this->setLineWidth(3);
156 QVBoxLayout* fLayout =
new QVBoxLayout;
157 fLayout->setMargin(0);
158 this->setLayout(fLayout);
164 fLayout->addWidget(mInternal);
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.