10#include <QPixmapCache>
12#include <QStyleOption>
14#include <QJsonDocument>
18#include <QGuiApplication>
19#include <qpa/qplatformnativeinterface.h>
20#include <qpa/qplatformtheme.h>
33 checkBoxControl = NULL;
43 qwidgetsFonts->
clear();
51 objectIterator !=
object->constEnd();
56 qWarning(
"Style.json structure is unrecognized.");
68 m_androidControlsHash[int(itemType)] = checkBoxControl;
142 switch (contentsType) {
172 switch (controlElement) {
174 case CE_PushButtonBevel:
175 case CE_PushButtonLabel:
179 case CE_CheckBoxLabel:
183 case CE_RadioButtonLabel:
187 case CE_TabBarTabShape:
188 case CE_TabBarTabLabel:
192 case CE_ProgressBarGroove:
193 case CE_ProgressBarContents:
194 case CE_ProgressBarLabel:
197 case CE_ComboBoxLabel:
210 switch (primitiveElement) {
231 switch (subElement) {
239 case SE_RadioButtonContents:
242 case SE_CheckBoxContents:
255 const ItemType itemType = qtControl(pe);
257 ? m_androidControlsHash.
find(itemType)
258 : m_androidControlsHash.
end();
259 if (
it != m_androidControlsHash.
end()) {
261 it.value()->drawControl(
opt,
p,
w);
265 it.value()->drawControl(&
copy,
p,
w);
267 }
else if (pe == PE_FrameGroupBox) {
282 QFusionStyle::drawPrimitive(pe,
opt,
p,
w);
292 const ItemType itemType = qtControl(element);
294 ? m_androidControlsHash.
find(itemType)
295 : m_androidControlsHash.
end();
296 if (
it != m_androidControlsHash.
end()) {
313 qstyleoption_cast<const QStyleOptionButton *>(
opt)) {
317 QFusionStyle::drawControl(CE_PushButtonLabel, &
copy,
p,
w);
323 qstyleoption_cast<const QStyleOptionButton *>(
opt)) {
324 const bool isRadio = (element == CE_RadioButton);
327 : SE_CheckBoxContents,
btn,
w);
328 QFusionStyle::drawControl(isRadio ? CE_RadioButtonLabel : CE_CheckBoxLabel, &
subopt,
p,
w);
333 qstyleoption_cast<const QStyleOptionComboBox *>(
opt)) {
337 QFusionStyle::drawControl(CE_ComboBoxLabel, comboboxOption,
p,
w);
341 QFusionStyle::drawControl(element,
opt,
p,
w);
346 QFusionStyle::drawControl(element,
opt,
p,
w);
354 const ItemType itemType = qtControl(subElement);
356 ? m_androidControlsHash.
find(itemType)
357 : m_androidControlsHash.
end();
358 if (
it != m_androidControlsHash.
end())
360 return QFusionStyle::subElementRect(subElement,
option,
widget);
368 const ItemType itemType = qtControl(cc);
370 ? m_androidControlsHash.
find(itemType)
371 : m_androidControlsHash.
end();
372 if (
it != m_androidControlsHash.
end()) {
376 if (cc == CC_GroupBox) {
381 if (
groupBox->subControls & SC_GroupBoxCheckBox)
385 frame.QStyleOption::operator=(*groupBox);
397 finalRect.
adjust(ltr ? -4 : 0, 0, ltr ? 0 : 4, 0);
403 p->setClipRegion(region);
412 p->setPen(textColor);
421 if (
groupBox->state & State_HasFocus) {
423 fropt.QStyleOption::operator=(*groupBox);
430 if (
groupBox->subControls & SC_GroupBoxCheckBox) {
432 box.QStyleOption::operator=(*groupBox);
433 box.rect = checkBoxRect;
439 QFusionStyle::drawComplexControl(cc,
opt,
p,
widget);
447 const ItemType itemType = qtControl(cc);
449 ? m_androidControlsHash.
find(itemType)
450 : m_androidControlsHash.
end();
451 if (
it != m_androidControlsHash.
end()) {
454 if (
const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(
opt)) {
455 QRect r =
it.value()->subControlRect(slider, SC_SliderHandle,
widget);
456 if (
r.isValid() &&
r.contains(pt)) {
457 return SC_SliderHandle;
459 r =
it.value()->subControlRect(slider, SC_SliderGroove,
widget);
460 if (
r.isValid() &&
r.contains(pt))
461 return SC_SliderGroove;
469 return QFusionStyle::hitTestComplexControl(cc,
opt, pt,
widget);
477 const ItemType itemType = qtControl(cc);
479 ? m_androidControlsHash.
find(itemType)
480 : m_androidControlsHash.
end();
481 if (
it != m_androidControlsHash.
end())
482 return it.value()->subControlRect(
opt, sc,
widget);
489 int indicatorWidth = checkBoxSize.
width();
490 int indicatorHeight = checkBoxSize.
height();
493 checkBoxRect.
setWidth(indicatorWidth);
501 if (sc == SC_GroupBoxFrame) {
505 }
else if (sc == SC_GroupBoxContents) {
508 int leftMarginExtension = 0;
510 frameRect.
adjust(leftMarginExtension + margin, margin + topMargin, -margin, -margin -
groupBox->lineWidth);
514 }
else if (sc == SC_GroupBoxCheckBox) {
516 }
else if (sc == SC_GroupBoxLabel) {
530 return QFusionStyle::subControlRect(cc,
opt, sc,
widget);
537 case PM_ButtonMargin:
538 case PM_FocusFrameVMargin:
539 case PM_FocusFrameHMargin:
540 case PM_ComboBoxFrameWidth:
541 case PM_SpinBoxFrameWidth:
542 case PM_ScrollBarExtent:
544 case PM_IndicatorWidth:
546 case PM_IndicatorHeight:
549 return QFusionStyle::pixelMetric(metric,
option,
widget);
556 const QSize &contentsSize,
559 QSize sz = QFusionStyle::sizeFromContents(ct,
opt, contentsSize,
w);
560 if (ct == CT_HeaderSection) {
562 bool nullIcon = hdr->icon.isNull();
571 if (
qApp->styleSheet().isEmpty())
572 txt = hdr->fontMetrics.size(0, hdr->text);
578 + (hdr->text.isNull() ? 0 : margin) +
txt.width() + margin);
589 const ItemType itemType = qtControl(ct);
591 ? m_androidControlsHash.
find(itemType)
592 : m_androidControlsHash.
end();
593 if (
it != m_androidControlsHash.
end())
594 return it.value()->sizeFromContents(
opt, sz,
w);
595 if (ct == CT_GroupBox) {
599 int indicatorWidth = checkBoxSize.
width();
600 int indicatorHeight = checkBoxSize.
height();
603 checkBoxRect.
setWidth(indicatorWidth);
629 return QFusionStyle::generatedIconPixmap(iconMode,
pixmap,
opt);
635 case SH_Slider_AbsoluteSetButtons:
638 case SH_Slider_PageSetButtons:
641 case SH_RequestSoftwareInputPanel:
642 return RSIP_OnMouseClick;
644 case SH_SpinBox_SelectOnStep:
654 return m_standardPalette;
681 if (
it != drawable.
end())
682 m_padding = extractMargins(
it.value().toMap());
732 if (m_padding.isNull() && !sz.
isNull())
733 m_padding.setLeft(sz.
width());
753 if (m_hashKey.isEmpty())
803int QAndroidStyle::Android9PatchDrawable::calculateStretch(
int boundsLimit,
806 int numStrechyPixelsRemaining,
807 int numFixedPixelsRemaining)
809 int spaceRemaining = boundsLimit - startingPoint;
810 int stretchySpaceRemaining = spaceRemaining - numFixedPixelsRemaining;
811 return (
float(srcSpace) * stretchySpaceRemaining / numStrechyPixelsRemaining + .5);
824 if (m_hashKey.isEmpty())
836 const int pixmapWidth =
pixmap.width();
837 const int pixmapHeight =
pixmap.height();
839 if (bounds.
isNull() || !pixmapWidth || !pixmapHeight)
850 const qint32 x0 = m_chunkData.xDivs[0];
851 const qint32 y0 = m_chunkData.yDivs[0];
852 const quint8 numXDivs = m_chunkData.xDivs.size();
853 const quint8 numYDivs = m_chunkData.yDivs.size();
859 const bool initialXIsStretchable = (
x0 == 0);
860 bool yIsStretchable = (
y0 == 0);
861 const int bitmapWidth =
pixmap.width();
862 const int bitmapHeight =
pixmap.height();
864 int *dstRights =
static_cast<int *
>(alloca((numXDivs + 1) *
sizeof(
int)));
865 bool dstRightsHaveBeenCached =
false;
867 int numStretchyXPixelsRemaining = 0;
868 for (
i = 0;
i < numXDivs;
i += 2)
869 numStretchyXPixelsRemaining += m_chunkData.xDivs[
i + 1] - m_chunkData.xDivs[
i];
871 int numFixedXPixelsRemaining = bitmapWidth - numStretchyXPixelsRemaining;
872 int numStretchyYPixelsRemaining = 0;
873 for (
i = 0;
i < numYDivs;
i += 2)
874 numStretchyYPixelsRemaining += m_chunkData.yDivs[
i + 1] - m_chunkData.yDivs[
i];
876 int numFixedYPixelsRemaining = bitmapHeight - numStretchyYPixelsRemaining;
895 for (
j = yIsStretchable ? 1 : 0;
896 j <= numYDivs &&
src.top() < bitmapHeight;
897 j++, yIsStretchable = !yIsStretchable) {
901 src.setBottom(bitmapHeight);
904 src.setBottom(m_chunkData.yDivs[
j]);
905 const int srcYSize =
src.bottom() -
src.top();
906 if (yIsStretchable) {
909 numStretchyYPixelsRemaining,
910 numFixedYPixelsRemaining));
911 numStretchyYPixelsRemaining -= srcYSize;
913 dst.setBottom(
dst.top() + srcYSize);
914 numFixedYPixelsRemaining -= srcYSize;
918 xIsStretchable = initialXIsStretchable;
921 for (
i = xIsStretchable ? 1 : 0;
922 i <= numXDivs &&
src.left() < bitmapWidth;
923 i++, xIsStretchable = !xIsStretchable) {
924 color = m_chunkData.colors[colorIndex++];
925 if (
color != TRANSPARENT_COLOR)
928 src.setRight(bitmapWidth);
931 src.setRight(m_chunkData.xDivs[
i]);
932 if (dstRightsHaveBeenCached) {
933 dst.setRight(dstRights[
i]);
935 const int srcXSize =
src.right() -
src.left();
936 if (xIsStretchable) {
937 dst.setRight(
dst.left() + calculateStretch(bounds.
right(),
dst.left(),
939 numStretchyXPixelsRemaining,
940 numFixedXPixelsRemaining));
941 numStretchyXPixelsRemaining -= srcXSize;
943 dst.setRight(
dst.left() + srcXSize);
944 numFixedXPixelsRemaining -= srcXSize;
946 dstRights[
i] =
dst.right();
952 if (
src.left() >=
src.right()) {
957 if (
dst.right() <=
dst.left() ||
dst.bottom() <=
dst.top()) {
961 if (
color == TRANSPARENT_COLOR)
963 if (
color != NO_COLOR)
973 dstRightsHaveBeenCached =
true;
989 for (
int i = 0;
i < min;
i++)
993 if (orientation ==
"TOP_BOTTOM")
995 else if (orientation ==
"TR_BL")
996 m_orientation =
TR_BL;
997 else if (orientation ==
"RIGHT_LEFT")
999 else if (orientation ==
"BR_TL")
1000 m_orientation =
BR_TL;
1001 else if (orientation ==
"BOTTOM_TOP")
1003 else if (orientation ==
"BL_TR")
1004 m_orientation =
BL_TR;
1005 else if (orientation ==
"LEFT_RIGHT")
1007 else if (orientation ==
"TL_BR")
1008 m_orientation =
TL_BR;
1010 qWarning(
"AndroidGradientDrawable: unknown orientation");
1022 switch (m_orientation) {
1025 m_gradient.setStart(
width / 2, 0);
1030 m_gradient.setStart(
width, 0);
1031 m_gradient.setFinalStop(0,
height);
1036 m_gradient.setFinalStop(0,
height / 2);
1041 m_gradient.setFinalStop(0, 0);
1046 m_gradient.setFinalStop(
width / 2, 0);
1050 m_gradient.setStart(0,
height);
1051 m_gradient.setFinalStop(
width, 0);
1055 m_gradient.setStart(0,
height / 2);
1060 m_gradient.setStart(0, 0);
1076 return QSize(m_radius * 2, m_radius * 2);
1101 m_orientation = orientation;
1108 copy.rect.setWidth(
copy.rect.width() * m_factor);
1110 copy.rect.setHeight(
copy.rect.height() * m_factor);
1137 for (
const StateType &
type : std::as_const(m_states))
1157 s = drawable->
size();
1165 if (m_states.size())
1166 return m_states[0].second;
1170 uint bestCost = 0xffff;
1171 for (
const StateType &
state : m_states) {
1173 return state.second;
1202 if (
cost < bestCost) {
1204 bestMatch =
state.second;
1257 return static_cast<int>(
state);
1262 for (
const StateType &
type : std::as_const(m_states))
1288 for (
const LayerType &
layer : std::as_const(m_layers))
1289 delete layer.second;
1301 m_orientation = orientation;
1306 for (
const LayerType &
layer : m_layers) {
1307 if (
layer.first == m_id) {
1310 copy.rect.setWidth(
copy.rect.width() * m_factor);
1312 copy.rect.setHeight(
copy.rect.height() * m_factor);
1322 for (
const LayerType &
layer : m_layers) {
1323 if (
layer.first ==
id)
1324 return layer.second;
1332 for (
const LayerType &
layer : m_layers)
1341 if (
it != control.
end())
1347 if (
it != control.
end())
1348 m_minSize.setWidth(
it.value().toInt());
1351 if (
it != control.
end())
1352 m_minSize.setHeight(
it.value().toInt());
1355 if (
it != control.
end())
1356 m_maxSize.setWidth(
it.value().toInt());
1359 if (
it != control.
end())
1360 m_maxSize.setHeight(
it.value().toInt());
1365 delete m_background;
1371 m_background->draw(
p,
opt);
1374 if ((
frame->state & State_Sunken) || (
frame->state & State_Raised)) {
1382 QColor bg = fropt->backgroundColor;
1383 QPen oldPen =
p->pen();
1395 p->drawRect(focusRect.
adjusted(0, 0, -1, -1));
1409 if (drawable->type() ==
State)
1412 const QMargins &padding = drawable->padding();
1417 if (
r.width() < m_minSize.width())
1420 if (
r.height() < m_minSize.height())
1421 r.setHeight(m_minSize.height());
1436 const QSize &contentsSize,
1442 if (drawable->type() ==
State)
1444 const QMargins &padding = drawable->padding();
1448 sz = drawable->size();
1453 if (sz.
height() < m_minSize.height())
1455 if (sz.
width() < m_minSize.width())
1463 if (drawable->type() ==
State)
1473 if (drawable->type() ==
State)
1475 return drawable->
size();
1482 return m_background;
1490 if (
it != control.
end()) {
1509 m_button->draw(
p,
opt);
1515 return m_button->padding();
1522 if (m_button->type() ==
State)
1524 return m_button->size();
1531 return m_background ? m_background : m_button;
1538 QVariantMap::const_iterator
it = control.
find(
QLatin1String(
"ProgressBar_indeterminateDrawable"));
1539 if (
it != control.
end())
1545 if (
it != control.
end())
1551 if (
it != control.
end())
1555 if (
it != control.
end())
1559 if (
it != control.
end())
1563 if (
it != control.
end())
1567 if (
it != control.
end())
1571 if (
it != control.
end())
1577 delete m_progressDrawable;
1578 delete m_indeterminateDrawable;
1583 if (!m_progressDrawable)
1588 const double fraction = double(
qint64(pb->progress) - pb->minimum) / (
qint64(pb->maximum) - pb->minimum);
1594 static_cast<AndroidLayerDrawable *
>(m_progressDrawable)->setFactor(m_progressId, fraction, orientation);
1605 qstyleoption_cast<const QStyleOptionProgressBar *>(
option)) {
1610 QMargins padding = m_background->padding();
1612 padding = m_indeterminateDrawable->padding();
1614 padding = m_progressDrawable->padding();
1619 if (
r.height()<m_minSize.height())
1622 if (
r.height()>m_maxSize.height())
1623 r.setHeight(m_maxSize.height());
1625 if (
r.width()<m_minSize.width())
1626 r.setWidth(m_minSize.width());
1628 if (
r.width()>m_maxSize.width())
1629 r.setWidth(m_maxSize.width());
1637 const QSize &contentsSize,
1640 QSize sz(contentsSize);
1641 if (sz.
height() < m_minSize.height())
1643 if (sz.
width() < m_minSize.width())
1647 qstyleoption_cast<const QStyleOptionProgressBar *>(
opt)) {
1649 if (sz.
width() > m_maxSize.width())
1652 if (sz.
height() > m_maxSize.height())
1656 return contentsSize;
1664 if (
it != control.
end())
1672 delete m_seekBarThumb;
1679 if (!m_seekBarThumb || !m_progressDrawable)
1682 if (
const QStyleOptionSlider *styleOption =
1683 qstyleoption_cast<const QStyleOptionSlider *>(
option)) {
1684 double factor = double(styleOption->sliderPosition - styleOption->minimum)
1685 / double(styleOption->maximum - styleOption->minimum);
1690 factor = 1 - factor;
1712 copy.rect.setHeight(m_progressDrawable->size().height());
1714 const int yTranslate = abs(drawable->
size().
height() -
copy.rect.height()) / 2;
1715 copy.rect.translate(drawable->
size().
width() / 2, yTranslate);
1716 m_progressDrawable->draw(
p, &
copy);
1718 copy.rect.translate(
pos, -yTranslate);
1719 copy.rect.setSize(drawable->
size());
1720 m_seekBarThumb->draw(
p, &
copy);
1727 const QSize &contentsSize,
1731 if (!m_seekBarThumb)
1743 const QStyleOptionSlider *styleOption =
1744 qstyleoption_cast<const QStyleOptionSlider *>(
option);
1746 if (m_seekBarThumb && sc == SC_SliderHandle && styleOption) {
1752 double factor = double(styleOption->sliderPosition - styleOption->minimum)
1753 / (styleOption->maximum - styleOption->minimum);
1756 r.setY(
r.y() +
pos);
1759 r.setX(
r.x() +
pos);
1761 r.setSize(drawable->
size());
virtual AndroidDrawableType type() const
Android9PatchDrawable(const QVariantMap &drawable, ItemType itemType)
virtual void draw(QPainter *painter, const QStyleOption *opt) const
virtual void setFactor(double factor, Qt::Orientation orientation)
virtual AndroidDrawableType type() const
virtual void draw(QPainter *painter, const QStyleOption *opt) const
AndroidClipDrawable(const QVariantMap &drawable, ItemType itemType)
virtual void draw(QPainter *painter, const QStyleOption *opt) const
virtual AndroidDrawableType type() const
AndroidColorDrawable(const QVariantMap &drawable, ItemType itemType)
virtual QSize size(const QStyleOption *option)
virtual QMargins padding()
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const
virtual ~AndroidControl()
virtual void drawControl(const QStyleOption *opt, QPainter *p, const QWidget *w)
AndroidControl(const QVariantMap &control, ItemType itemType)
virtual const AndroidDrawable * backgroundDrawable() const
virtual QRect subControlRect(const QStyleOptionComplex *option, SubControl sc, const QWidget *widget=nullptr) const
virtual QSize sizeFromContents(const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const
const QMargins & padding() const
virtual QSize size() const
virtual ~AndroidDrawable()
static AndroidDrawable * fromMap(const QVariantMap &drawable, ItemType itemType)
static QMargins extractMargins(const QVariantMap &value)
virtual AndroidDrawableType type() const =0
AndroidDrawable(const QVariantMap &drawable, ItemType itemType)
virtual void setPaddingLeftToSizeWidth()
virtual void initPadding(const QVariantMap &drawable)
virtual void draw(QPainter *painter, const QStyleOption *opt) const =0
virtual void draw(QPainter *painter, const QStyleOption *opt) const
virtual AndroidDrawableType type() const
AndroidGradientDrawable(const QVariantMap &drawable, ItemType itemType)
virtual QSize size() const
AndroidImageDrawable(const QVariantMap &drawable, ItemType itemType)
virtual AndroidDrawableType type() const
virtual void draw(QPainter *painter, const QStyleOption *opt) const
virtual AndroidDrawableType type() const
AndroidLayerDrawable(const QVariantMap &drawable, QAndroidStyle::ItemType itemType)
virtual void setFactor(int id, double factor, Qt::Orientation orientation)
virtual void draw(QPainter *painter, const QStyleOption *opt) const
AndroidDrawable * layer(int id) const
AndroidDrawable * m_indeterminateDrawable
QSize sizeFromContents(const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const
AndroidDrawable * m_progressDrawable
virtual void drawControl(const QStyleOption *option, QPainter *p, const QWidget *w)
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const
int m_secondaryProgress_id
virtual ~AndroidProgressBarControl()
AndroidProgressBarControl(const QVariantMap &control, ItemType itemType)
virtual ~AndroidSeekBarControl()
virtual void drawControl(const QStyleOption *option, QPainter *p, const QWidget *w)
QRect subControlRect(const QStyleOptionComplex *option, SubControl sc, const QWidget *widget=nullptr) const
QSize sizeFromContents(const QStyleOption *opt, const QSize &contentsSize, const QWidget *w) const
AndroidSeekBarControl(const QVariantMap &control, ItemType itemType)
virtual QRect subControlRect(const QStyleOptionComplex *option, SubControl sc, const QWidget *widget=nullptr) const
AndroidSpinnerControl(const QVariantMap &control, ItemType itemType)
const AndroidDrawable * bestAndroidStateMatch(const QStyleOption *opt) const
virtual void setPaddingLeftToSizeWidth()
static int extractState(const QVariantMap &value)
AndroidStateDrawable(const QVariantMap &drawable, ItemType itemType)
virtual void draw(QPainter *painter, const QStyleOption *opt) const
virtual AndroidDrawableType type() const
QSize sizeImage(const QStyleOption *opt) const
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const
virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=nullptr) const
virtual void drawControl(QStyle::ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const
void polish(QWidget *widget)
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const
virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const
int styleHint(StyleHint hint, const QStyleOption *option=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const
virtual QPalette standardPalette() const
virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=nullptr) const
void unpolish(QWidget *widget)
static QFont font()
Returns the default application font.
static void setFont(const QFont &, const char *className=nullptr)
Changes the default application font to font.
const QColor & color() const
Returns the brush color.
The QColor class provides colors based on RGB, HSV or CMYK values.
void setRgba(QRgb rgba) noexcept
Sets the RGB value to rgba, including its alpha.
void getHsv(int *h, int *s, int *v, int *a=nullptr) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
\inmodule QtCore \reentrant
QString fileName() const
Returns the name of the file, excluding the path.
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
QRect boundingRect(QChar) const
Returns the rectangle that is covered by ink if character ch were to be drawn at the origin of the co...
QSize size(int flags, const QString &str, int tabstops=0, int *tabarray=nullptr) const
Returns the size in pixels of text.
int midLineWidth
the width of the mid-line
int lineWidth
the line width
void setColorAt(qreal pos, const QColor &color)
Creates a stop point at the given position with the given color.
static QPlatformNativeInterface * platformNativeInterface()
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
friend class const_iterator
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
T value(const Key &key, const T &defaultValue=T()) const
iterator find(const Key &key)
constexpr int bottom() const noexcept
Returns the bottom margin.
constexpr int left() const noexcept
Returns the left margin.
constexpr int right() const noexcept
Returns the right margin.
constexpr int top() const noexcept
Returns the top margin.
The QPainter class performs low-level painting on widgets and other paint devices.
const QPen & pen() const
Returns the painter's current pen.
RenderHints renderHints() const
Returns a flag that specifies the rendering hints that are set for this painter.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QBrush & brush() const
Returns the painter's current brush.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
void setRenderHints(RenderHints hints, bool on=true)
void fillRect(const QRectF &, const QBrush &)
Fills the given rectangle with the brush specified.
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode=Qt::AbsoluteSize)
The QPalette class contains color groups for each widget state.
const QBrush & windowText() const
Returns the window text (general foreground) brush of the current color group.
const QBrush & window() const
Returns the window (general background) brush of the current color group.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
static void clear()
Removes all pixmaps from the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
int height() const
Returns the height of the pixmap.
bool load(const QString &fileName, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the file with the given fileName.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr void adjust(int x1, int y1, int x2, int y2) noexcept
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint topRight() const noexcept
Returns the position of the rectangle's top-right corner.
constexpr void moveLeft(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr int width() const noexcept
Returns the width of the rectangle.
QRect united(const QRect &other) const noexcept
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
The QRegion class specifies a clip region for a painter.
const_iterator cbegin() const noexcept
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr int & rwidth() noexcept
Returns a reference to the width.
constexpr bool isNull() const noexcept
Returns true if both the width and height is 0; otherwise returns false.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\variable QStyleOptionGraphicsItem::exposedRect
\variable QStyleOptionToolButton::features
\variable QStyleOptionMenuItem::menuItemType
\variable QStyleOption::palette
\variable QStyleOptionFocusRect::backgroundColor
\variable QStyleOptionFrame::features
\variable QStyleOptionButton::features
The QStyleOption class stores the parameters used by QStyle functions.
Qt::LayoutDirection direction
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
ContentsType
This enum describes the available contents types.
StyleHint
This enum describes the available style hints.
ControlElement
This enum represents a control element.
ComplexControl
This enum describes the available complex controls.
PrimitiveElement
This enum describes the various primitive elements.
@ PE_IndicatorItemViewItemCheck
SubElement
This enum represents a sub-area of a widget.
SubControl
This enum describes the available sub controls.
@ SC_ComboBoxListBoxPopup
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has userType() \l QMetaType::QVariantList.
QMap< QString, QVariant > toMap() const
Returns the variant as a QVariantMap if the variant has type() \l QMetaType::QVariantMap.
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has userType() \l QMetaType::QByteArray or \l QMet...
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
QStyleOptionButton subopt
[2]
const QStyleOptionButton * btn
[3]
Combined button and popup list for selecting options.
const quint32 TRANSPARENT_COLOR
static jboolean copy(JNIEnv *, jobject)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
void qDrawShadePanel(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, const QBrush *fill)
void qDrawShadeLine(QPainter *p, int x1, int y1, int x2, int y2, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth)
void qDrawShadeRect(QPainter *p, int x, int y, int w, int h, const QPalette &pal, bool sunken, int lineWidth, int midLineWidth, const QBrush *fill)
void qDrawPlainRect(QPainter *p, int x, int y, int w, int h, const QColor &c, int lineWidth, const QBrush *fill)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
const EGLAttrib EGLOutputLayerEXT * layers
static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)
constexpr const T & qMax(const T &a, const T &b)
GLenum GLsizei GLsizei GLint * values
[15]
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat y0
GLsizei const GLint * box
GLfloat GLfloat GLfloat GLfloat h
static qsizetype cost(const QPixmap &pixmap)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
static QList< QVariant > toList(char **buf, int count)
QLatin1StringView QLatin1String
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
static int toInt(const QChar &qc, int R)
value toMap().value(key)
[3]