9 const QString &sHeight,
const QString &baseRes)
11 setRect(sX,sY,sWidth,sHeight,baseRes);
26 QRect::setX(other.x());
27 QRect::setY(other.y());
28 QRect::setWidth(other.width());
29 QRect::setHeight(other.height());
56 (QRect)(*
this) == (QRect)other);
99 QRect::setRect(X,Y,w,h);
131 QRect::moveTopLeft(QPoint(X,Y));
140 const QString &sWidth,
const QString &sHeight,
141 const QString &rectBaseRes)
149 QString vWidth = sWidth;
150 QString vHeight = sHeight;
151 if (!rectBaseRes.isEmpty())
153 QStringList res = rectBaseRes.split(
'x');
157 int rectBaseWidth = res[0].toInt();
158 int rectBaseHeight = res[1].toInt();
159 if (rectBaseWidth > 0 && rectBaseHeight > 0)
164 iX = iX * themeBaseSize.width() / rectBaseWidth;
165 vX = QString::number(iX);
170 iY = iY * themeBaseSize.height() / rectBaseHeight;
171 vY = QString::number(iY);
173 int iWidth = sWidth.toInt();
176 iWidth = iWidth * themeBaseSize.width() / rectBaseWidth;
177 vWidth = QString::number(iWidth);
179 int iHeight = sHeight.toInt();
182 iHeight = iHeight * themeBaseSize.height() / rectBaseHeight;
183 vHeight = QString::number(iHeight);
200 const QString &value,
bool is_size)
222 QTextStream is(&
tmp);
225 if (is.status() != QTextStream::Ok)
232 if (is_size && number < 0)
241 percent =
static_cast<float>(number) / 100.0F;
251 QRect::setX(absoluteX);
261 QRect::setY(absoluteY);
268 int absoluteWidth = 0;
272 QRect::setWidth(absoluteWidth);
279 int absoluteHeight = 0;
283 QRect::setHeight(absoluteHeight);
300 QRect::moveTopLeft(point);
314 QRect::moveLeft(absoluteX);
324 QRect::moveTop(absoluteY);
333 stringX = QString(
"%1%").arg((
int)(
m_percentX * 100));
335 stringX = QString(
"%1").arg(x() -
m_offsetX);
349 stringY = QString(
"%1%").arg((
int)(
m_percentY * 100));
351 stringY = QString(
"%1").arg(y() -
m_offsetY);
379 QString stringHeight;
395 QString result = QString(
"(%1,%2,%3,%4)")
396 .arg(x()).arg(y()).arg(width()).arg(height());
399 result += QString(
" [%1,%2,%3,%4]")
407 return {x(),y(),width(),height()};
430 QPoint::setX(other.x());
431 QPoint::setY(other.y());
489 const QString &value)
511 QTextStream is(&
tmp);
514 if (is.status() != QTextStream::Ok)
525 percent =
static_cast<float>(number) / 100.0F;
535 QPoint::setX(absoluteX);
545 QPoint::setY(absoluteY);
554 stringX = QString(
"%1%").arg((
int)(
m_percentX * 100));
556 stringX = QString(
"%1").arg(x() -
m_offsetX);
570 stringY = QString(
"%1%").arg((
int)(
m_percentY * 100));
572 stringY = QString(
"%1").arg(y() -
m_offsetY);
584 QString result = QString(
"(%1,%2)")
588 result += QString(
" [%1,%2]")