TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
TTKThirdParty
TTKExtras
qalgorithm
random.cpp
Go to the documentation of this file.
1
#include "
random.h
"
2
#include "
ttkqtglobal.h
"
3
4
#if TTK_QT_VERSION_CHECK(5,10,0)
5
# include <QRandomGenerator>
6
#endif
7
8
namespace
QAlgorithm
9
{
10
void
initRandom
()
11
{
12
#if !TTK_QT_VERSION_CHECK(5,10,0)
13
qsrand(QDateTime::currentMSecsSinceEpoch());
14
#endif
15
}
16
17
int
random
(
int
value)
18
{
19
#if TTK_QT_VERSION_CHECK(5,10,0)
20
return
QRandomGenerator::global()->bounded(value);
21
#else
22
return
qrand() % value;
23
#endif
24
}
25
}
QAlgorithm::initRandom
void initRandom()
Definition:
random.cpp:10
QAlgorithm
The namespace of the algorithm.
Definition:
musictransitionanimationlabel.h:26
QAlgorithm::random
int random(int value)
Definition:
random.cpp:17
ttkqtglobal.h
random.h
Generated on Tue Jan 21 2025 21:07:14 for TTKMusicPlayer by
1.8.8