0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 16:39:07 +03:00

Values translation in objectinspector has been added

This commit is contained in:
Arin Alexander
2017-12-10 22:10:41 +03:00
parent 21e4d98484
commit 6a889e9062
9 changed files with 1787 additions and 104 deletions

View File

@@ -31,17 +31,18 @@
#define LRENUMPROPITEM_H
#include "lrobjectpropitem.h"
#include <QMap>
namespace LimeReport{
class EnumPropItem : public ObjectPropItem
{
Q_OBJECT
public:
EnumPropItem():ObjectPropItem(), m_settingValue(false){}
EnumPropItem():ObjectPropItem(), m_settingValue(false){initTranslation();}
EnumPropItem(QObject* object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value,ObjectPropItem* parent, bool readonly)
:ObjectPropItem(object, objects, name, displayName, value, parent, readonly),m_settingValue(false){}
:ObjectPropItem(object, objects, name, displayName, value, parent, readonly),m_settingValue(false){initTranslation();}
EnumPropItem(QObject* object, ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& value,ObjectPropItem* parent, bool readonly, QVector<int> acceptableValues)
:ObjectPropItem(object, objects, name, displayName, value, parent, readonly),m_acceptableValues(acceptableValues),m_settingValue(false){}
:ObjectPropItem(object, objects, name, displayName, value, parent, readonly),m_acceptableValues(acceptableValues),m_settingValue(false){initTranslation();}
QWidget* createProperyEditor(QWidget *parent) const;
QString displayValue() const;
void setPropertyEditorData(QWidget * propertyEditor, const QModelIndex &) const;
@@ -52,9 +53,13 @@ protected:
int typeByName(const QString& propertyValue) const;
private slots:
void slotEnumChanged(const QString& text);
private:
void initTranslation();
void translateEnumItemName();
private:
QVector<int> m_acceptableValues;
bool m_settingValue;
QMap<QString, QString> m_translation;
};
}
#endif // LRENUMPROPITEM_H