36QString uniqueName(
const QString &key,
const QStyleOption *option,
const QSize &size, qreal dpr)
41 const QStyleOptionComplex *complexOption = qstyleoption_cast<
const QStyleOptionComplex *>(option);
42 QString tmp = key % HexString<uint>(option->state)
43 % HexString<uint>(option->direction)
44 % HexString<uint>(complexOption ? uint(complexOption->activeSubControls) : 0u)
45 % HexString<quint64>(option->palette.cacheKey())
46 % HexString<uint>(size.width())
47 % HexString<uint>(size.height())
48 % HexString<qreal>(dpr);
51 if (
const QStyleOptionSpinBox *spinBox = qstyleoption_cast<
const QStyleOptionSpinBox *>(option)) {
52 tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
53 % HexString<uint>(spinBox->stepEnabled)
54 % QChar(spinBox->frame ? u'1' : u'0');
354void drawBorderPixmap(
const QPixmap &pixmap, QPainter *painter,
const QRect &rect,
355 int left,
int top,
int right,
358 QSize size = pixmap.size();
363 painter->drawPixmap(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), pixmap,
364 QRect(left, 0, size.width() -right - left, top));
368 painter->drawPixmap(QRect(rect.left(), rect.top(), left, top), pixmap,
369 QRect(0, 0, left, top));
373 painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top(), right, top), pixmap,
374 QRect(size.width() - right, 0, right, top));
379 painter->drawPixmap(QRect(rect.left(), rect.top()+top, left, rect.height() - top - bottom), pixmap,
380 QRect(0, top, left, size.height() - bottom - top));
383 painter->drawPixmap(QRect(rect.left() + left, rect.top()+top, rect.width() -right - left,
384 rect.height() - bottom - top), pixmap,
385 QRect(left, top, size.width() -right -left,
386 size.height() - bottom - top));
389 painter->drawPixmap(QRect(rect.left() +rect.width() - right, rect.top()+top, right, rect.height() - top - bottom), pixmap,
390 QRect(size.width() - right, top, right, size.height() - bottom - top));
394 painter->drawPixmap(QRect(rect.left() +left, rect.top() + rect.height() - bottom,
395 rect.width() - right - left, bottom), pixmap,
396 QRect(left, size.height() - bottom,
397 size.width() - right - left, bottom));
400 painter->drawPixmap(QRect(rect.left(), rect.top() + rect.height() - bottom, left, bottom), pixmap,
401 QRect(0, size.height() - bottom, left, bottom));
405 painter->drawPixmap(QRect(rect.left() + rect.width() - right, rect.top() + rect.height() - bottom, right, bottom), pixmap,
406 QRect(size.width() - right, size.height() - bottom, right, bottom));