Commit fb7cd311 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Port away from deprecated qrand()

parent e1fdb544
......@@ -533,10 +533,9 @@ int Parser::addFunction(const QString &str1, const QString &str2, Function::Type
m_ufkt[temp->id()] = temp;
temp->plotAppearance(Function::Derivative0).color = XParser::self()->defaultColor(temp->id());
// Better use QRandomGenerator::global()->generate() instead of qrand() since Qt 5.10
temp->plotAppearance(Function::Derivative1).color = QColor::fromRgb(qrand());
temp->plotAppearance(Function::Derivative2).color = QColor::fromRgb(qrand());
temp->plotAppearance(Function::Integral).color = QColor::fromRgb(qrand());
temp->plotAppearance(Function::Derivative1).color = QColor::fromRgb(QRandomGenerator::global()->generate());
temp->plotAppearance(Function::Derivative2).color = QColor::fromRgb(QRandomGenerator::global()->generate());
temp->plotAppearance(Function::Integral).color = QColor::fromRgb(QRandomGenerator::global()->generate());
emit functionAdded(temp->id());
return temp->id(); // return the unique ID-number for the function
......
Supports Markdown
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