Fix deprecation warnings.
(grafted from 686129d90f37b8d0c428092668673d44f06545d8) --HG-- branch : develop
This commit is contained in:
parent
d74225e63e
commit
1f6285aef9
|
@ -2795,8 +2795,13 @@ void TMainWindow::WriteSettings()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QStringList TMainWindow::FilterMeasurements(const QStringList &mNew, const QStringList &mFilter)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
const auto import = QSet<QString>(mNew.begin(), mNew.end()).subtract(QSet<QString>(mFilter.begin(), mFilter.end()));
|
||||
return QStringList(import.begin(), import.end());
|
||||
#else
|
||||
const QSet<QString> import = mNew.toSet().subtract(mFilter.toSet());
|
||||
return QStringList(import.toList());
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -3065,7 +3070,12 @@ QString TMainWindow::CheckMName(const QString &name, const QSet<QString> &import
|
|||
}
|
||||
else
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
const QStringList allGroupNames = AllGroupNames();
|
||||
if (not QSet<QString>(allGroupNames.begin(), allGroupNames.end()).contains(name))
|
||||
#else
|
||||
if (not AllGroupNames().toSet().contains(name))
|
||||
#endif
|
||||
{
|
||||
throw VException(tr("Measurement '%1' is not one of known measurements.").arg(name));
|
||||
}
|
||||
|
|
|
@ -2116,10 +2116,22 @@ QSharedPointer<VMeasurements> MainWindowsNoGUI::OpenMeasurementFile(const QStrin
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindowsNoGUI::CheckRequiredMeasurements(const VMeasurements *m) const
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QStringList patternMeasurments = doc->ListMeasurements();
|
||||
QStringList bodyMeasurments = m->ListAll();
|
||||
const auto match = QSet<QString>(patternMeasurments.begin(), patternMeasurments.end())
|
||||
.subtract(QSet<QString>(bodyMeasurments.begin(), bodyMeasurments.end()));
|
||||
#else
|
||||
const QSet<QString> match = doc->ListMeasurements().toSet().subtract(m->ListAll().toSet());
|
||||
#endif
|
||||
|
||||
if (not match.isEmpty())
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QList<QString> list = QList<QString>(match.begin(), match.end());
|
||||
#else
|
||||
QList<QString> list = match.toList();
|
||||
#endif
|
||||
for (int i = 0; i < list.size(); ++i)
|
||||
{
|
||||
list[i] = qApp->TrVars()->MToUser(list.at(i));
|
||||
|
|
|
@ -98,7 +98,12 @@ void GatherCount(int &count, const int nodes)
|
|||
QString DefLabelLanguage()
|
||||
{
|
||||
QString def = qApp->ValentinaSettings()->GetLabelLanguage();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QStringList languages = VApplication::LabelLanguages();
|
||||
if (not QSet<QString>(languages.begin(), languages.end()).contains(def));
|
||||
#else
|
||||
if (not VApplication::LabelLanguages().toSet().contains(def))
|
||||
#endif
|
||||
{
|
||||
def = QStringLiteral("en");
|
||||
}
|
||||
|
@ -4376,7 +4381,12 @@ void VPattern::SetLabelPrefix(const QString &prefix)
|
|||
|
||||
if (not pattern.isNull())
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QStringList languages = VApplication::LabelLanguages();
|
||||
if (QSet<QString>(languages.begin(), languages.end()).contains(prefix));
|
||||
#else
|
||||
if (VApplication::LabelLanguages().toSet().contains(prefix))
|
||||
#endif
|
||||
{
|
||||
SetAttribute(pattern, AttrLabelPrefix, prefix);
|
||||
modified = true;
|
||||
|
|
|
@ -256,7 +256,11 @@ QList<QString> GetTokens(const VFormulaField &formula)
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void GatherTokens(QSet<QString> &tokens, const QList<QString> &tokenList)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
tokens = tokens.unite(QSet<QString>(tokenList.begin(), tokenList.end()));
|
||||
#else
|
||||
tokens = tokens.unite(tokenList.toSet());
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -313,11 +317,21 @@ QStringList VAbstractPattern::ListMeasurements() const
|
|||
{
|
||||
const QFuture<QStringList> futureIncrements = QtConcurrent::run(this, &VAbstractPattern::ListIncrements);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QSet<QString> results = QtConcurrent::blockingMappedReduced(ListExpressions(), GetTokens, GatherTokens);
|
||||
const auto tokens = QList<QString>(results.begin(), results.end());
|
||||
#else
|
||||
const QList<QString> tokens = QtConcurrent::blockingMappedReduced(ListExpressions(), GetTokens,
|
||||
GatherTokens).toList();
|
||||
#endif
|
||||
|
||||
QSet<QString> measurements;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QStringList result = futureIncrements.result();
|
||||
QSet<QString> others = QSet<QString>(result.begin(), result.end());
|
||||
#else
|
||||
QSet<QString> others = futureIncrements.result().toSet();
|
||||
#endif
|
||||
|
||||
for (const auto &token : tokens)
|
||||
{
|
||||
|
@ -329,7 +343,7 @@ QStringList VAbstractPattern::ListMeasurements() const
|
|||
IsVariable(token) || IsFunction(token) ? others.insert(token) : measurements.insert(token);
|
||||
}
|
||||
|
||||
return QStringList(measurements.toList());
|
||||
return QStringList(measurements.values());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -343,7 +343,11 @@ bool VBank::PrepareUnsorted()
|
|||
Insert(unsorted, group, i, square);
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
groups = QVector<uint>(uniqueGroup.begin(), uniqueGroup.end());
|
||||
#else
|
||||
groups = QVector<uint>::fromList(uniqueGroup.toList());
|
||||
#endif
|
||||
std::sort(groups.begin(), groups.end());
|
||||
|
||||
PrepareGroup();
|
||||
|
|
|
@ -642,7 +642,11 @@ QList<VLayoutPiece> VLayoutGenerator::MoveDetails(qreal length, const QVector<VL
|
|||
{
|
||||
if (qFuzzyIsNull(length))
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
return QList<VLayoutPiece>(details.begin(), details.end());
|
||||
#else
|
||||
return details.toList();
|
||||
#endif
|
||||
}
|
||||
|
||||
QList<VLayoutPiece> newDetails;
|
||||
|
|
|
@ -500,7 +500,11 @@ QVector<T> VLayoutPiece::Map(QVector<T> points) const
|
|||
|
||||
if (d->mirror)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
auto list = QList<T>(p.begin(), p.end());
|
||||
#else
|
||||
QList<T> list = points.toList();
|
||||
#endif
|
||||
for (int k=0, s=list.size(), max=(s/2); k<max; k++)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
|
||||
|
|
|
@ -659,7 +659,7 @@ QStringList VContainer::AllUniqueNames(const QString &nspace)
|
|||
if (uniqueNames.contains(nspace))
|
||||
{
|
||||
QStringList names = builInFunctions;
|
||||
names.append(uniqueNames.value(nspace).toList());
|
||||
names.append(uniqueNames.value(nspace).values());
|
||||
return names;
|
||||
}
|
||||
else
|
||||
|
@ -707,7 +707,7 @@ void VContainer::ClearUniqueNames() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::ClearUniqueIncrementNames() const
|
||||
{
|
||||
const QList<QString> list = uniqueNames.value(d->nspace).toList();
|
||||
const QList<QString> list = uniqueNames.value(d->nspace).values();
|
||||
ClearUniqueNames();
|
||||
|
||||
for(auto &name : list)
|
||||
|
@ -810,7 +810,11 @@ const QHash<QString, QSharedPointer<VInternalVariable> > *VContainer::DataVariab
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainerData::~VContainerData()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
if (ref.loadRelaxed() == 0)
|
||||
#else
|
||||
if (ref.load() == 0)
|
||||
#endif
|
||||
{
|
||||
--VContainer::copyCounter[nspace];
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ QVector<quint32> PieceMissingNodes(const QVector<quint32> &d1Nodes, const QVecto
|
|||
set2.insert(d2Nodes.at(j));
|
||||
}
|
||||
|
||||
const QList<quint32> set3 = set1.subtract(set2).toList();
|
||||
const QList<quint32> set3 = set1.subtract(set2).values();
|
||||
QVector<quint32> r;
|
||||
r.reserve(set3.size());
|
||||
for (qint32 i = 0; i < set3.size(); ++i)
|
||||
|
|
|
@ -629,7 +629,7 @@ QVector<quint32> VPiecePath::MissingNodes(const VPiecePath &path) const
|
|||
set2.insert(path.at(j).GetId());
|
||||
}
|
||||
|
||||
const QList<quint32> set3 = set1.subtract(set2).toList();
|
||||
const QList<quint32> set3 = set1.subtract(set2).values();
|
||||
QVector<quint32> nodes;
|
||||
nodes.reserve(set3.size());
|
||||
for (qint32 i = 0; i < set3.size(); ++i)
|
||||
|
|
|
@ -95,7 +95,12 @@ QVector<quint32> SaveToolOptions::Missing(const QList<quint32> &list1, const QLi
|
|||
{
|
||||
QSet<quint32> set1 = QSet<quint32>::fromList(list1);
|
||||
QSet<quint32> set2 = QSet<quint32>::fromList(list2);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QSet<quint32> substracted = set1.subtract(set2);
|
||||
return QVector<quint32>(substracted.begin(), substracted.end());
|
||||
#else
|
||||
return set1.subtract(set2).toList().toVector();
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user