to fix the crash issue. due to extractAcceptableValue() function was return an empty list

This commit is contained in:
turbineyan 2020-12-27 18:51:03 +08:00
parent 3c2388dce5
commit 7e4e6684c6

View File

@ -32,6 +32,8 @@
#include "objectinspector/editors/lrcomboboxeditor.h" #include "objectinspector/editors/lrcomboboxeditor.h"
#include "lrtextitem.h" #include "lrtextitem.h"
#include <QtDebug>
namespace{ namespace{
LimeReport::ObjectPropItem * createAlignItem( LimeReport::ObjectPropItem * createAlignItem(
QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly
@ -160,7 +162,12 @@ QString AlignmentItemEditor::displayValue() const
void AlignmentItemEditor::setPropertyValue(QVariant value) void AlignmentItemEditor::setPropertyValue(QVariant value)
{ {
ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]); //ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]);
qDebug()<<"value "<<value;
QVector<int> _accpepttableValueList= extractAcceptableValue(value.toInt());
if(_accpepttableValueList.isEmpty()) return;
ObjectPropItem::setPropertyValue(_accpepttableValueList[0]);
} }
} }