28 QFrame(parent), mFixPosX(false), mFixPosY(false), mMinSize(minimumSize)
47 void MousePadWidgetInternal::fixPos()
51 mLastPos.rx() = this->width() / 2;
55 mLastPos.ry() = this->height() / 2;
61 mLastPos = QPoint(this->width() / 2, this->height() / 2);
68 mLastPos =
event->pos();
75 QPoint delta =
event->pos() - mLastPos;
77 double padSize = (this->size().width() + this->size().height()) / 2.0;
78 QPointF deltaN(
double(delta.x()) / padSize,
double(delta.y()) / padSize);
82 mLastPos =
event->pos();
89 mLastPos = QPoint(this->width() / 2, this->height() / 2);
96 mLastPos = QPoint(this->width() / 2, this->height() / 2);
105 Vector3D center(this->width() / 2, this->height() / 2, 0);
106 double radius = center.length();
107 QPoint qcenter(this->width() / 2, this->height() / 2);
109 QRadialGradient radialGrad(qcenter, radius, mLastPos);
110 radialGrad.setColorAt(0.0, QColor(
"khaki"));
111 radialGrad.setColorAt(0.4, QColor(
"lightgrey"));
112 radialGrad.setColorAt(1, QColor(
"dimgrey"));
114 QColor color(146, 0, 146);
115 QBrush brush(radialGrad);
117 p.setPen(QColor(146, 0, 146));
118 p.setBrush(QColor(146, 0, 146));
119 p.fillRect(0, 0, width() - 1, height() - 1, brush);
133 this->setFrameStyle(QFrame::Panel | QFrame::Raised);
134 this->setLineWidth(3);
135 QVBoxLayout* fLayout =
new QVBoxLayout;
136 fLayout->setMargin(0);
137 this->setLayout(fLayout);
143 fLayout->addWidget(mInternal);