From fdab56b1d88797e3dcd81c4aaf8337e502a583f8 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Tue, 27 Mar 2018 00:39:59 +0300 Subject: [PATCH] Bool property item fixed --- common.pri | 2 +- .../propertyItems/lrboolpropitem.cpp | 19 +++---------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/common.pri b/common.pri index 50e1bb1..d46e57d 100644 --- a/common.pri +++ b/common.pri @@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 72 +LIMEREPORT_VERSION_RELEASE = 73 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/objectinspector/propertyItems/lrboolpropitem.cpp b/limereport/objectinspector/propertyItems/lrboolpropitem.cpp index 9ed1eea..7e3cc5f 100644 --- a/limereport/objectinspector/propertyItems/lrboolpropitem.cpp +++ b/limereport/objectinspector/propertyItems/lrboolpropitem.cpp @@ -71,28 +71,15 @@ bool BoolPropItem::paint(QPainter *painter, const StyleOptionViewItem &option, c { QStyle* style = option.widget ? option.widget->style() : QApplication::style(); - int offset = 0; - -#ifdef Q_OS_MAC - offset = 2; -#endif if (index.column()==1){ - StyleOptionViewItem so(option); + QStyleOptionButton so; int border = (option.rect.height() - style->pixelMetric(QStyle::PM_IndicatorWidth))/2; so.rect = option.rect.adjusted(border,border,0,-border); - so.rect.setWidth(style->pixelMetric(QStyle::PM_IndicatorWidth)+offset); - so.rect.setHeight(style->pixelMetric(QStyle::PM_IndicatorHeight)+offset); - -// if (!isValueReadonly()) -// so.state = QStyle::State_Enabled; -// else -// so.state &= ~QStyle::State_Enabled; - + so.rect.setWidth(style->pixelMetric(QStyle::PM_IndicatorWidth)); + so.rect.setHeight(style->pixelMetric(QStyle::PM_IndicatorHeight)); so.state |= propertyValue().toBool() ? QStyle::State_On : QStyle::State_Off; - style->drawPrimitive(QStyle::PE_IndicatorItemViewItemCheck,&so,painter); - return true; } else return false; }