mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-23 08:29:07 +03:00
WIP
This commit is contained in:
@@ -13,7 +13,7 @@ class AbstractLayout: public LayoutDesignIntf
|
||||
Q_PROPERTY(int layoutSpacing READ layoutSpacing WRITE setLayoutSpacing)
|
||||
public:
|
||||
enum LayoutType{Layout,Table};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(LayoutType)
|
||||
#else
|
||||
Q_ENUMS(LayoutType)
|
||||
|
@@ -152,7 +152,7 @@ public:
|
||||
KANJI_INPUT_MODE = 3,
|
||||
SJIS_INPUT_MODE = 4
|
||||
};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(BarcodeType)
|
||||
Q_ENUM(AngleType)
|
||||
Q_ENUM(InputMode)
|
||||
|
@@ -33,7 +33,7 @@ class SeriesItem : public QObject{
|
||||
Q_PROPERTY(SeriesItemPreferredType preferredType READ preferredType WRITE setPreferredType)
|
||||
public:
|
||||
enum SeriesItemPreferredType {Bar, Line};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(SeriesItemPreferredType)
|
||||
#else
|
||||
Q_ENUMS(SeriesItemPreferredType)
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
enum LegendAlign{LegendAlignTop,LegendAlignCenter,LegendAlignBottom};
|
||||
enum TitleAlign{TitleAlignLeft, TitleAlignCenter, TitleAlignRight};
|
||||
enum ChartType{Pie, VerticalBar, HorizontalBar, Lines};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(LegendAlign)
|
||||
Q_ENUM(TitleAlign)
|
||||
Q_ENUM(ChartType)
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
Hex = 1,
|
||||
Base64 = 2
|
||||
};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(Format)
|
||||
#else
|
||||
Q_ENUMS(Format)
|
||||
|
@@ -47,7 +47,7 @@ class ShapeItem: public LimeReport::ItemDesignIntf
|
||||
Q_PROPERTY(int cornerRadius READ cornerRadius WRITE setCornerRadius)
|
||||
public:
|
||||
enum ShapeType{HorizontalLine,VerticalLine,Ellipse,Rectangle};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(ShapeType)
|
||||
#else
|
||||
Q_ENUMS(ShapeType)
|
||||
|
@@ -28,14 +28,18 @@
|
||||
* GNU General Public License for more details. *
|
||||
****************************************************************************/
|
||||
#include "lrsimpletagparser.h"
|
||||
#include <QRegExp>
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
#if QT_VERSION < 0x060000
|
||||
#include <QRegExp>
|
||||
#else
|
||||
#include <QRegularExpression>
|
||||
#endif
|
||||
namespace LimeReport{
|
||||
|
||||
void HtmlContext::fillTagVector(QString html)
|
||||
{
|
||||
#if QT_VERSION < 0x060000
|
||||
QRegExp rx("<[^<]*>");
|
||||
QString buff=html;
|
||||
int curPos=0;
|
||||
@@ -49,10 +53,20 @@ void HtmlContext::fillTagVector(QString html)
|
||||
}
|
||||
buff=buff.right(buff.length()-rx.matchedLength());
|
||||
}
|
||||
#else
|
||||
QRegularExpression rx("<[^<]*>");
|
||||
QString buff=html;
|
||||
while(buff.contains(rx)){
|
||||
QRegularExpressionMatch match = rx.match(buff);
|
||||
// TODO: Qt6 port
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
QString HtmlContext::parseTag(QVector<Tag *> &storage, QString text, int &curPos, bool createTag)
|
||||
{
|
||||
#if QT_VERSION < 0x060000
|
||||
QRegExp rx("<[^<]*>");
|
||||
int pos=rx.indexIn(text);
|
||||
int begPos=pos+curPos;
|
||||
@@ -78,12 +92,16 @@ QString HtmlContext::parseTag(QVector<Tag *> &storage, QString text, int &curPos
|
||||
buff=buff.right(buff.length()-rx.matchedLength());
|
||||
}
|
||||
}
|
||||
#else
|
||||
QRegularExpression rx("<[^<]*>");
|
||||
// TODO: Qt6 port
|
||||
#endif
|
||||
return "";
|
||||
}
|
||||
|
||||
void HtmlContext::parseSymbs(QString text)
|
||||
{
|
||||
|
||||
#if QT_VERSION < 0x060000
|
||||
QRegExp rx("<[^<]*[^/]>");
|
||||
while (text.contains(rx)){
|
||||
int pos=rx.indexIn(text);
|
||||
@@ -100,6 +118,10 @@ void HtmlContext::parseSymbs(QString text)
|
||||
text.replace(rx.cap(0)," ");
|
||||
}
|
||||
}
|
||||
#else
|
||||
QRegularExpression rx("<[^<]*>");
|
||||
// TODO: Qt6 port
|
||||
#endif
|
||||
}
|
||||
|
||||
void HtmlContext::initSymbPatterns()
|
||||
|
@@ -79,7 +79,7 @@ public:
|
||||
enum AutoWidth{NoneAutoWidth, MaxWordLength, MaxStringLength};
|
||||
enum AngleType{Angle0, Angle90, Angle180, Angle270, Angle45, Angle315};
|
||||
enum ValueType{Default, DateTime, Double};
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))
|
||||
#if QT_VERSION >= 0x050500
|
||||
Q_ENUM(AutoWidth)
|
||||
Q_ENUM(AngleType)
|
||||
Q_ENUM(ValueType)
|
||||
|
Reference in New Issue
Block a user