From fff806e1100db6fde518965d58e9b77049b2417d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 26 Jul 2015 10:17:53 +0300 Subject: [PATCH] Lock producing random attribute order in XML --HG-- branch : feature --- src/app/tape/main.cpp | 6 ++++++ src/app/valentina/main.cpp | 6 ++++++ src/libs/vformat/vmeasurements.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/src/app/tape/main.cpp b/src/app/tape/main.cpp index 7b768b2ea..e3c8e6131 100644 --- a/src/app/tape/main.cpp +++ b/src/app/tape/main.cpp @@ -31,6 +31,10 @@ #include // For QT_REQUIRE_VERSION +// Lock producing random attribute order in XML +// https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml +extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; + int main(int argc, char *argv[]) { Q_INIT_RESOURCE(tapeicon); @@ -40,6 +44,8 @@ int main(int argc, char *argv[]) QT_REQUIRE_VERSION(argc, argv, "5.0.0"); + qt_qhash_seed.store(0); // Lock producing random attribute order in XML + MApplication app(argc, argv); if (not app.IsTheOnly()) { diff --git a/src/app/valentina/main.cpp b/src/app/valentina/main.cpp index 95ad92b7f..b695a75ff 100644 --- a/src/app/valentina/main.cpp +++ b/src/app/valentina/main.cpp @@ -37,6 +37,10 @@ # include #endif +// Lock producing random attribute order in XML +// https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml +extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; + //--------------------------------------------------------------------------------------------------------------------- int main(int argc, char *argv[]) { @@ -50,6 +54,8 @@ int main(int argc, char *argv[]) QT_REQUIRE_VERSION(argc, argv, "5.0.0"); + qt_qhash_seed.store(0); // Lock producing random attribute order in XML + VApplication app(argc, argv); app.InitOptions(); diff --git a/src/libs/vformat/vmeasurements.h b/src/libs/vformat/vmeasurements.h index 8c670765a..5918d304c 100644 --- a/src/libs/vformat/vmeasurements.h +++ b/src/libs/vformat/vmeasurements.h @@ -118,6 +118,9 @@ public: static QString GenderToStr(const SexType &sex); static SexType StrToGender(const QString &sex); + QStringList ListAll() const; + QStringList ListKnown() const; + private: Q_DISABLE_COPY(VMeasurements)