MCPcopy Create free account
hub / github.com/KDAB/GammaRay / pickColor

Method pickColor

ui/remoteviewwidget.cpp:1070–1079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1068}
1069
1070void RemoteViewWidget::pickColor() const
1071{
1072 QPointF sourceCoordinates = frame().transform().inverted().map(QPointF(m_currentMousePosition)); // for quick view, transform is needed
1073 QPoint sourceCoordinatesInt = QPoint(std::floor(sourceCoordinates.x()), std::floor(sourceCoordinates.y()));
1074 if (frame().image().rect().contains(sourceCoordinatesInt)) {
1075 m_trailingColorLabel->setPickedColor(frame().image().pixel(sourceCoordinatesInt));
1076 } else {
1077 m_trailingColorLabel->setPickedColor(Qt::transparent);
1078 }
1079}
1080
1081void RemoteViewWidget::mouseMoveEvent(QMouseEvent *event)
1082{

Callers

nothing calls this directly

Calls 5

QPointFClass · 0.85
QPointClass · 0.85
setPickedColorMethod · 0.80
transformMethod · 0.45
imageMethod · 0.45

Tested by

no test coverage detected