Question of comprehension

I would like to temporarily change the text color in the StatusBar.

Question is, why does the original palette change after the modified palette has been assigned to the StatusBar?

I already know how to solve this by simply resetting the color.

Qt Code:
  1. const QPalette& palOrg = statusBar()->palette();
  2.  
  3. QPalette palCopy = palOrg;
  4.  
  5. palCopy.setColor(QPalette::WindowText, Qt::red);
  6.  
  7. qDebug() << palCopy.color(QPalette::WindowText) << palOrg.color(QPalette::WindowText);
  8. //logs QColor(ARGB 1, 1, 0, 0) QColor(ARGB 1, 0, 0, 0)
  9.  
  10. statusBar()->setPalette(palCopy);
  11.  
  12. qDebug() << palCopy.color(QPalette::WindowText) << palOrg.color(QPalette::WindowText);
  13. //logs QColor(ARGB 1, 1, 0, 0) QColor(ARGB 1, 1, 0, 0)
To copy to clipboard, switch view to plain text mode