~neon/kgeography/master

« back to all changes in this revision

Viewing changes to src/boxasker.cpp

  • Committer: Albert Astals Cid
  • Date: 2020-07-23 22:10:48 UTC
  • Revision ID: git-v1:53f6e9f689a8916dc1e4ac190436e14859406c86
Port away from KRandom

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
#include "boxasker.h"
12
12
 
13
 
#include <stdlib.h> // for RAND_MAX
14
 
 
15
13
#include <KAcceleratorManager>
16
14
#include <KLocalizedString>
17
 
#include <KRandom>
18
15
 
19
16
#include <QButtonGroup>
20
17
#include <QGroupBox>
22
19
#include <QLabel>
23
20
#include <QLayout>
24
21
#include <QRadioButton>
 
22
#include <QRandomGenerator>
25
23
#include <QPushButton>
26
24
#include <QKeyEvent>
27
25
 
193
191
        auxList << div -> getUntranslatedName ();
194
192
 
195
193
        // we put the division in a random place
196
 
        p_position = (int)((float)NB_CHOICES * KRandom::random() / (RAND_MAX + 1.0));
 
194
        p_position = QRandomGenerator::global()->bounded(NB_CHOICES);
197
195
        nextBoxAskerQuestionHook(div, p_position, true);
198
196
 
199
197
        // fill the other names