Fix deprecation warnings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2020-01-12 18:42:58 +02:00
parent 48fbc9262e
commit 1847b068b5
3 changed files with 27 additions and 11 deletions

View File

@ -160,12 +160,18 @@ bool SavePieceOptions::mergeWith(const QUndoCommand *command)
}
else
{
const QSet<quint32> currentSet;
currentSet.fromList(m_newDet.Dependencies());
const VPiece candidate = saveCommand->NewDet();
const QSet<quint32> candidateSet;
candidateSet.fromList(candidate.Dependencies());
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QList<quint32> currentDependencies = m_newDet.Dependencies();
QList<quint32> candidateDependencies = candidate.Dependencies();
auto currentSet = QSet<quint32>(currentDependencies.begin(), currentDependencies.end());
auto candidateSet = QSet<quint32>(candidateDependencies.begin(), candidateDependencies.end());
#else
auto currentSet = QSet<quint32>::fromList(m_newDet.Dependencies());
auto candidateSet = QSet<quint32>::fromList(candidate.Dependencies());
#endif
if (currentSet != candidateSet)
{

View File

@ -127,12 +127,18 @@ bool SavePiecePathOptions::mergeWith(const QUndoCommand *command)
}
else
{
const QSet<quint32> currentSet;
currentSet.fromList(m_newPath.Dependencies());
const VPiecePath candidate = saveCommand->NewPath();
const QSet<quint32> candidateSet;
candidateSet.fromList(candidate.Dependencies());
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QList<quint32> currentDependencies = m_newPath.Dependencies();
QList<quint32> candidateDependencies = candidate.Dependencies();
auto currentSet = QSet<quint32>(currentDependencies.begin(), currentDependencies.end());
auto candidateSet = QSet<quint32>(candidateDependencies.begin(), candidateDependencies.end());
#else
auto currentSet = QSet<quint32>::fromList(m_newPath.Dependencies());
auto candidateSet = QSet<quint32>::fromList(candidate.Dependencies());
#endif
if (currentSet != candidateSet)
{

View File

@ -185,7 +185,11 @@ void TST_AbstractRegExp::CallTestCheckNoOriginalNamesInTranslation()
QFETCH(QString, originalName);
static const QStringList originalNames = AllNames();
static const QSet<QString> names = QSet<QString>::fromList(originalNames);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
static const auto names = QSet<QString>(originalNames.begin(), originalNames.end());
#else
static const auto names = QSet<QString>::fromList(originalNames);
#endif
const QString translated = m_trMs->VarToUser(originalName);
if (names.contains(translated))