From d2b89776f4003aac30600a3408854f5ba5a3dcbd Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Mon, 8 Apr 2024 22:02:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B2=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D1=8C=20=D1=81=20Qt=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/myx-example-features/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/myx-example-features/main.cpp b/src/myx-example-features/main.cpp index cba9c85..2017b86 100644 --- a/src/myx-example-features/main.cpp +++ b/src/myx-example-features/main.cpp @@ -7,7 +7,11 @@ #include #include #include +#if QT_VERSION >= 0x051000 #include +#else +#include +#endif #include /** @@ -39,7 +43,11 @@ int slowFunction() double a[size]; for ( int i = 0; i < size; i++ ) { +#if QT_VERSION >= 0x051000 a[i] = QRandomGenerator::global()->bounded( 4 ); +#else + a[i] = std::rand() / (RAND_MAX / 4); +#endif for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] ); a[0] += a[i]; } @@ -56,7 +64,11 @@ int fastFunction() double a[size]; for ( int i = 0; i < size; i++ ) { +#if QT_VERSION >= 0x051000 a[i] = QRandomGenerator::global()->bounded( 4 ); +#else + a[i] = std::rand() / (RAND_MAX / 4); +#endif for ( int j = 0; j < i; j++ ) a[i] += sin( a[j] ); a[0] += a[i]; }