proper qt version check

This commit is contained in:
Aditya Kulkarni 2018-11-15 18:40:46 -08:00
parent 32bfaf252c
commit af4d99aa27
3 changed files with 9 additions and 2 deletions

4
.gitignore vendored
View File

@ -22,3 +22,7 @@ zec-qt-wallet_resource*
workspace.code-workspace
*.zip
*.tar.gz
*.xcsettings
.DS_Store
*.mak
*.plist

View File

@ -19,14 +19,17 @@ int main(int argc, char *argv[])
#endif
// QRandomGenerator generates a secure random number, which we use to seed.
#if QT_VERSION >= 0x051000
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
unsigned int seed = QRandomGenerator::securelySeeded().generate();
qDebug() << "yes" << QT_VERSION;
#else
// This will be used only during debugging for compatibility reasons
unsigned int seed = std::time(0);
qDebug() << "no" << QT_VERSION;
#endif
std::srand(seed);
Settings::init();
Settings::getInstance()->setExecName(argv[0]);

View File

@ -9,7 +9,7 @@
#include <QtGlobal>
#if QT_VERSION >= 0x051000
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif