提交 39d1795b 编写于 作者: D dev

Old Qt Version 兼容性修改

上级 c4292c28
......@@ -103,7 +103,11 @@ namespace TASKBUS {
QString l = s.readLine();
while (l.size() && hit<2)
{
#if QT_VERSION >= 0x051500
QStringList lst = l.split(":",Qt::SkipEmptyParts);
#else
QStringList lst = l.split(":",QString::SkipEmptyParts);
#endif
if (lst.size()>=2)
{
QString keystr = lst.first().trimmed();
......
......@@ -18,6 +18,7 @@
#include <QJsonParseError>
#include <QMimeData>
#include <QDataStream>
#include <QRegularExpression>
taskCell::taskCell()
{
......@@ -312,7 +313,11 @@ QString taskCell::set_function_exec(const QString & func , const QString & execs
}
const QString taskCell::function_class(const QString & func) const
{
#if QT_VERSION >= 0x051500
QStringList strV = func.split(QRegularExpression("[:_]"),Qt::SkipEmptyParts);
#else
QStringList strV = func.split(QRegularExpression("[:_]"),QString::SkipEmptyParts);
#endif
if (strV.size()>1)
{
strV.pop_back();
......@@ -713,7 +718,11 @@ QVariant taskCell::view_to_internal(const QVariant & vtdef
else if (targetType==QVariant::List)
{
QString strVal = vtdef.toString();
#if QT_VERSION >= 0x051500
QStringList lstv = strVal.split(",",Qt::SkipEmptyParts);
#else
QStringList lstv = strVal.split(",",QString::SkipEmptyParts);
#endif
QVariantList lsttag;
foreach(QString vii, lstv)
{
......@@ -739,7 +748,11 @@ QVariant taskCell::view_to_internal(const QVariant & vtdef
QString taskCell::pureName(const QVariant & v)
{
QString sv = v.toString();
#if QT_VERSION >= 0x051500
QStringList ls = sv.split(QRegularExpression("[:_]"),Qt::SkipEmptyParts);
#else
QStringList ls = sv.split(QRegularExpression("[:_]"),QString::SkipEmptyParts);
#endif
if (ls.size())
return ls.last();
return QString("");
......@@ -758,7 +771,11 @@ QString taskCell::pureName(const QVariant & v)
QString taskCell::className(const QVariant & v)
{
QString sv = v.toString();
#if QT_VERSION >= 0x051500
QStringList ls = sv.split(QRegularExpression("[:_]"),Qt::SkipEmptyParts);
#else
QStringList ls = sv.split(QRegularExpression("[:_]"),QString::SkipEmptyParts);
#endif
QString res;
while (ls.size()>1)
{
......
......@@ -369,9 +369,13 @@ void PDesignerView::update_paths()
const QList<unsigned int> srcs = m_project->idx_in2instances().keys();
const QList<unsigned int> dsts = m_project->idx_out2instances().keys();
#if QT_VERSION >=0x051500
const QSet<unsigned int> setin = QSet<unsigned int>(srcs.begin(),srcs.end());
const QSet<unsigned int> setout = QSet<unsigned int>(dsts.begin(),dsts.end());
#else
const QSet<unsigned int> setin = QSet<unsigned int>::fromList(srcs);
const QSet<unsigned int> setout = QSet<unsigned int>::fromList(dsts);
#endif
QEasingCurve cuve(QEasingCurve::InOutCubic);
foreach (unsigned int pins, setin)
......
......@@ -449,7 +449,11 @@ int taskModule::draw_direction(const QString & func, bool bInput, int n) const
strMasks = mp["IND"].toString();
else
strMasks = mp["OUTD"].toString();
#if QT_VERSION >= 0x051500
QStringList lstMasks = strMasks.split(",",Qt::SkipEmptyParts);
#else
QStringList lstMasks = strMasks.split(",",QString::SkipEmptyParts);
#endif
if (lstMasks.size()<=n)
return bInput==true?-(n+1):(n+1);
QString nn = lstMasks.at(n);
......@@ -488,7 +492,11 @@ void taskModule::set_draw_direction(const QString & func, bool bInput, int n, in
strMasks = mp["IND"].toString();
else
strMasks = mp["OUTD"].toString();
#if QT_VERSION >=0x051500
QStringList lstMasks = strMasks.split(",",Qt::SkipEmptyParts);
#else
QStringList lstMasks = strMasks.split(",",QString::SkipEmptyParts);
#endif
QString strVal;
const int sz = lstMasks.size();
QString nstr = QString("%1").arg(direction);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册