Changeset View
Changeset View
Standalone View
Standalone View
src/orbitswidget.cpp
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Line(s) | 229 | for (int i = 0; i < num; ++i) { | |||
---|---|---|---|---|---|
234 | DC.setPen(Qt::black); | 234 | DC.setPen(Qt::black); | ||
235 | 235 | | |||
236 | //draw the big ellipses in concentric circles | 236 | //draw the big ellipses in concentric circles | ||
237 | DC.drawEllipse(mx, my, d, d); | 237 | DC.drawEllipse(mx, my, d, d); | ||
238 | 238 | | |||
239 | DC.setPen(Qt::NoPen); | 239 | DC.setPen(Qt::NoPen); | ||
240 | 240 | | |||
241 | for (int e = 0; e < *it; ++e) { | 241 | for (int e = 0; e < *it; ++e) { | ||
242 | int x = (int)translateToDX(d / 2.0, (double)e, *it); | 242 | int x = static_cast<int>(translateToDX(d / 2.0, static_cast<double>(e), *it)); | ||
243 | int y = (int)translateToDY(d / 2.0, (double)e, *it); | 243 | int y = static_cast<int>(translateToDY(d / 2.0, static_cast<double>(e), *it)); | ||
244 | 244 | | |||
245 | //Creating a gradient for the current electron. | 245 | //Creating a gradient for the current electron. | ||
246 | QRadialGradient grad(QPointF(x + mx + d / 2 - r_electron / 2, y + my + d / 2 - r_electron / 2), r_electron); | 246 | QRadialGradient grad(QPointF(x + mx + d / 2 - r_electron / 2, y + my + d / 2 - r_electron / 2), r_electron); | ||
247 | grad.setColorAt(0, Qt::white); | 247 | grad.setColorAt(0, Qt::white); | ||
248 | grad.setColorAt(0.2, Qt::yellow); | 248 | grad.setColorAt(0.2, Qt::yellow); | ||
249 | grad.setColorAt(1, QColor(Qt::yellow).darker()); | 249 | grad.setColorAt(1, QColor(Qt::yellow).darker()); | ||
250 | DC.setBrush(QBrush(grad)); | 250 | DC.setBrush(QBrush(grad)); | ||
251 | 251 | | |||
Show All 10 Lines |