mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-30 19:19:56 +03:00
Merge branch 'master' into 1.4
Conflicts: limereport/items/lrtextitem.cpp limereport/items/lrtextitem.h
This commit is contained in:
@@ -44,6 +44,7 @@ class TextItem : public LimeReport::ContentItemDesignIntf {
|
||||
Q_OBJECT
|
||||
Q_ENUMS(AutoWidth)
|
||||
Q_ENUMS(AngleType)
|
||||
Q_ENUMS(ValueType)
|
||||
Q_PROPERTY(QString content READ content WRITE setContent)
|
||||
Q_PROPERTY(int margin READ marginSize WRITE setMarginSize)
|
||||
Q_PROPERTY(Qt::Alignment alignment READ alignment() WRITE setAlignment)
|
||||
@@ -63,10 +64,13 @@ class TextItem : public LimeReport::ContentItemDesignIntf {
|
||||
Q_PROPERTY(int underlineLineSize READ underlineLineSize WRITE setUnderlineLineSize)
|
||||
Q_PROPERTY(bool allowHTML READ allowHTML WRITE setAllowHTML)
|
||||
Q_PROPERTY(bool allowHTMLInFields READ allowHTMLInFields WRITE setAllowHTMLInFields)
|
||||
Q_PROPERTY(QString format READ format WRITE setFormat)
|
||||
Q_PROPERTY(ValueType valueType READ valueType WRITE setValueType)
|
||||
public:
|
||||
|
||||
enum AutoWidth{NoneAutoWidth,MaxWordLength,MaxStringLength};
|
||||
enum AngleType{Angle0,Angle90,Angle180,Angle270,Angle45,Angle315};
|
||||
enum ValueType{Default,DateTime,Double};
|
||||
|
||||
void Init();
|
||||
TextItem(QObject* owner=0, QGraphicsItem* parent=0);
|
||||
@@ -130,6 +134,12 @@ public:
|
||||
bool allowHTMLInFields() const;
|
||||
void setAllowHTMLInFields(bool allowHTMLInFields);
|
||||
|
||||
QString format() const;
|
||||
void setFormat(const QString &format);
|
||||
|
||||
ValueType valueType() const;
|
||||
void setValueType(const ValueType valueType);
|
||||
|
||||
protected:
|
||||
void updateLayout();
|
||||
bool isNeedExpandContent() const;
|
||||
@@ -140,6 +150,9 @@ private:
|
||||
void initText();
|
||||
void setTextFont(const QFont &value);
|
||||
void adaptFontSize();
|
||||
QString formatDateTime(const QDateTime &value);
|
||||
QString formatNumber(const double value);
|
||||
QString formatFieldValue();
|
||||
private:
|
||||
QString m_strText;
|
||||
|
||||
@@ -158,6 +171,9 @@ private:
|
||||
int m_underlineLineSize;
|
||||
bool m_allowHTML;
|
||||
bool m_allowHTMLInFields;
|
||||
|
||||
QString m_format;
|
||||
ValueType m_valueType;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user