35QString uniqueName(
const QString &key,
const QStyleOption *option,
const QSize &size, qreal dpr)
40 const QStyleOptionComplex *complexOption = qstyleoption_cast<
const QStyleOptionComplex *>(option);
41 QString tmp = key % HexString<uint>(option->state)
42 % HexString<uint>(option->direction)
43 % HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
44 % HexString<quint64>(option->palette.cacheKey())
45 % HexString<uint>(size.width())
46 % HexString<uint>(size.height())
47 % HexString<qreal>(dpr);
50 if (
const QStyleOptionSpinBox *spinBox = qstyleoption_cast<
const QStyleOptionSpinBox *>(option)) {
51 tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
52 % HexString<uint>(spinBox->stepEnabled)
53 % QChar(spinBox->frame ? u'1' : u'0');
353void drawBorderPixmap(
const QPixmap &pixmap, QPainter *painter,
const QRect &rect,
354 int left,
int top,
int right,
357 QSize size = pixmap.size();
362 painter->drawPixmap(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), pixmap,
363 QRect(left, 0, size.width() -right - left, top));
367 painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap,
368 QRect(0, 0, left, top));
372 painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top(), right, top), pixmap,
373 QRect(size.width() - right, 0, right, top));
378 painter->drawPixmap(QRect(rect.left(), rect.top()+top, left, rect.height() - top - bottom), pixmap,
379 QRect(0, top, left, size.height() - bottom - top));
382 painter->drawPixmap(QRect(rect.left() + left, rect.top()+top, rect.width() -right - left,
383 rect.height() - bottom - top), pixmap,
384 QRect(left, top, size.width() -right -left,
385 size.height() - bottom - top));
388 painter->drawPixmap(QRect(rect.left() +rect.width() - right, rect.top()+top, right, rect.height() - top - bottom), pixmap,
389 QRect(size.width() - right, top, right, size.height() - bottom - top));
393 painter->drawPixmap(QRect(rect.left() +left, rect.top() + rect.height() - bottom,
394 rect.width() - right - left, bottom), pixmap,
395 QRect(left, size.height() - bottom,
396 size.width() - right - left, bottom));
399 painter->drawPixmap(QRect(rect.left(), rect.top() + rect.height() - bottom, left, bottom), pixmap,
400 QRect(0, size.height() - bottom, left, bottom));
404 painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top() + rect.height() - bottom, right, bottom), pixmap,
405 QRect(size.width() - right, size.height() - bottom, right, bottom));