Commit af574e0e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile against qt5.15 without deprecated method

Port to QRandomGenerator
parent 01b832e0
......@@ -23,6 +23,7 @@
#include <KSharedConfig>
#include <QNetworkAccessManager>
#include <QColor>
#include <QRandomGenerator>
LanguageToolManager::LanguageToolManager(QObject *parent)
: QObject(parent)
......@@ -73,7 +74,7 @@ QColor LanguageToolManager::grammarColorForError(const QString &error)
if (col.isValid()) {
return col;
}
col.setRgb(qrand() % 256, qrand() % 256, qrand() % 256);
col.setRgb(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256));
//Generate color.
mGrammarColor.insert(error, col);
return col;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment