Qt Code:
  1. QColor getRandomColor()
  2. {
  3. int r = rand() % 256;
  4. int g = rand() % 256;
  5. int b = rand() % 256;
  6. return QColor(r,g,b);
  7. }
To copy to clipboard, switch view to plain text mode