mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-25 08:28:06 +03:00
Define code style and format all source file using clang-format-14
except those placed in 3rdparty directories.
This commit is contained in:
@@ -1,37 +1,42 @@
|
||||
#include "lrsvgpropitem.h"
|
||||
|
||||
#include "editors/lrsvgeditor.h"
|
||||
|
||||
namespace{
|
||||
LimeReport::ObjectPropItem * createSvgPropItem(
|
||||
QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly)
|
||||
namespace {
|
||||
LimeReport::ObjectPropItem* createSvgPropItem(QObject* object,
|
||||
LimeReport::ObjectPropItem::ObjectsList* objects,
|
||||
const QString& name, const QString& displayName,
|
||||
const QVariant& data,
|
||||
LimeReport::ObjectPropItem* parent, bool readonly)
|
||||
{
|
||||
return new LimeReport::SvgPropItem(object, objects, name, displayName, data, parent, readonly);
|
||||
}
|
||||
bool VARIABLE_IS_NOT_USED registredImageProp = LimeReport::ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("image","LimeReport::SVGItem"),QObject::tr("image"),createSvgPropItem);
|
||||
}
|
||||
bool VARIABLE_IS_NOT_USED registredImageProp
|
||||
= LimeReport::ObjectPropFactory::instance().registerCreator(
|
||||
LimeReport::APropIdent("image", "LimeReport::SVGItem"), QObject::tr("image"),
|
||||
createSvgPropItem);
|
||||
} // namespace
|
||||
|
||||
namespace LimeReport{
|
||||
namespace LimeReport {
|
||||
|
||||
QWidget* SvgPropItem::createProperyEditor(QWidget *parent) const
|
||||
{
|
||||
return new SvgEditor(parent);
|
||||
}
|
||||
QWidget* SvgPropItem::createProperyEditor(QWidget* parent) const { return new SvgEditor(parent); }
|
||||
|
||||
QString SvgPropItem::displayValue() const
|
||||
{
|
||||
return (propertyValue().isNull()) ? "" : QObject::tr("image");
|
||||
}
|
||||
|
||||
void SvgPropItem::setPropertyEditorData(QWidget *propertyEditor, const QModelIndex &) const
|
||||
void SvgPropItem::setPropertyEditorData(QWidget* propertyEditor, const QModelIndex&) const
|
||||
{
|
||||
SvgEditor *editor = qobject_cast<SvgEditor*>(propertyEditor);
|
||||
SvgEditor* editor = qobject_cast<SvgEditor*>(propertyEditor);
|
||||
editor->setImage(propertyValue().value<QByteArray>());
|
||||
}
|
||||
|
||||
void SvgPropItem::setModelData(QWidget *propertyEditor, QAbstractItemModel *model, const QModelIndex &index)
|
||||
void SvgPropItem::setModelData(QWidget* propertyEditor, QAbstractItemModel* model,
|
||||
const QModelIndex& index)
|
||||
{
|
||||
model->setData(index,qobject_cast<SvgEditor*>(propertyEditor)->image());
|
||||
object()->setProperty(propertyName().toLatin1(),propertyValue());
|
||||
model->setData(index, qobject_cast<SvgEditor*>(propertyEditor)->image());
|
||||
object()->setProperty(propertyName().toLatin1(), propertyValue());
|
||||
}
|
||||
|
||||
QIcon SvgPropItem::iconValue() const
|
||||
@@ -39,4 +44,4 @@ QIcon SvgPropItem::iconValue() const
|
||||
return QIcon(QPixmap::fromImage(propertyValue().value<QImage>()));
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace LimeReport
|
||||
|
||||
Reference in New Issue
Block a user