MCPcopy Create free account
hub / github.com/KDAB/KDChart / applyColor

Method applyColor

examples/Stock/Advanced/mainwindow.cpp:67–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void MainWindow::applyColor(const QColor &color)
68{
69 if (color.isValid()) {
70 m_diagram.setPen(0, QPen(color.darker(130)));
71 m_diagram.setBrush(0, QBrush(color));
72 QColor inverse(255 - color.red(), 255 - color.green(), 255 - color.blue());
73 m_diagram.setPen(1, QPen(inverse.darker(130)));
74 m_diagram.setBrush(1, QBrush(inverse));
75 QPalette pal = colorChooser->palette();
76 pal.setBrush(QPalette::Button, QBrush(color));
77 colorChooser->setPalette(pal);
78 }
79}
80
81void MainWindow::initValues()
82{

Callers

nothing calls this directly

Calls 4

QPenClass · 0.50
isValidMethod · 0.45
setPenMethod · 0.45
setBrushMethod · 0.45

Tested by

no test coverage detected