Unexpected colour when displaying a pixmap
-
I ran the following code in the debugger with breakpoint set on the first pen.setColor call.
if (stars[i].m_bAdded) pen.setColor(qRgba(0, 0, 255, m_bCometMode ? 255 * 0.5 : 255)); else pen.setColor(qRgba(0, 190, 0, m_bCometMode ? 255 * 0.5 : 255)); painter.drawEllipse(rc);the breakpoint was never hit.
Putting the breakpoint on the second pen.setColor was hit many times (for every star).
So I know that the colour used to draw the ellipse should be green.
The pixmap is built and then written to the screen in the paintEvent handler:
void EditStars::paintEvent([[maybe_unused]] QPaintEvent* event) { QPainter painter(this); drawOnPixmap(); // // Draw the stuff we drew onto the working pixmap onto the screen // painter.setBackgroundMode(Qt::TransparentMode); painter.drawPixmap(0, 0, pixmap); painter.end(); }So why are all those ellipses
-RED??? -
I ran the following code in the debugger with breakpoint set on the first pen.setColor call.
if (stars[i].m_bAdded) pen.setColor(qRgba(0, 0, 255, m_bCometMode ? 255 * 0.5 : 255)); else pen.setColor(qRgba(0, 190, 0, m_bCometMode ? 255 * 0.5 : 255)); painter.drawEllipse(rc);the breakpoint was never hit.
Putting the breakpoint on the second pen.setColor was hit many times (for every star).
So I know that the colour used to draw the ellipse should be green.
The pixmap is built and then written to the screen in the paintEvent handler:
void EditStars::paintEvent([[maybe_unused]] QPaintEvent* event) { QPainter painter(this); drawOnPixmap(); // // Draw the stuff we drew onto the working pixmap onto the screen // painter.setBackgroundMode(Qt::TransparentMode); painter.drawPixmap(0, 0, pixmap); painter.end(); }So why are all those ellipses
-RED???