MCPcopy Create free account
hub / github.com/IENT/YUView / paintEvent

Method paintEvent

YUViewLib/src/ui/views/PlotViewWidget.cpp:182–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void PlotViewWidget::paintEvent(QPaintEvent *)
183{
184 MoveAndZoomableView::updatePaletteIfNeeded();
185
186 QPainter painter(this);
187 painter.setRenderHint(QPainter::Antialiasing);
188
189 const auto widgetRect = QRectF(this->rect());
190
191 DEBUG_PLOT("PlotViewWidget::paintEvent widget " << widgetRect);
192
193 this->updatePlotRectAndAxis(painter);
194
195 const auto axisRangeX = getAxisRange(Axis::X, this->propertiesAxis[0]);
196 const auto axisRangeY = getAxisRange(Axis::Y, this->propertiesAxis[1]);
197
198 const auto ticksX = this->getAxisTicksToShow(Axis::X, axisRangeX);
199 const auto ticksY = this->getAxisTicksToShow(Axis::Y, axisRangeY);
200
201 this->drawGridLines(painter, this->propertiesAxis[0], ticksX, axisRangeX);
202 this->drawGridLines(painter, this->propertiesAxis[1], ticksY, axisRangeY);
203
204 this->drawLimits(painter);
205 this->drawPlot(painter);
206 this->drawZoomRect(painter);
207
208 this->drawWhiteBoarders(painter, widgetRect);
209 this->drawAxis(painter);
210
211 this->drawAxisTicks(painter, this->propertiesAxis[0], ticksX);
212 this->drawAxisTicks(painter, this->propertiesAxis[1], ticksY);
213 this->drawAxisTickLabels(painter, this->propertiesAxis[0], ticksX, axisRangeX);
214 this->drawAxisTickLabels(painter, this->propertiesAxis[1], ticksY, axisRangeY);
215
216 this->drawInfoBox(painter);
217 // this->drawDebugBox(painter, plotRect);
218
219 this->drawFadeBoxes(painter, widgetRect);
220 this->drawWhiteBoxesInLabelArea(painter, widgetRect);
221
222 if (this->model == nullptr)
223 {
224 drawTextInCenterOfArea(painter, this->rect(), "Please select an item");
225 }
226}
227
228void PlotViewWidget::mouseMoveEvent(QMouseEvent *mouseMoveEvent)
229{

Callers

nothing calls this directly

Calls 14

updatePlotRectAndAxisMethod · 0.95
getAxisTicksToShowMethod · 0.95
drawGridLinesMethod · 0.95
drawLimitsMethod · 0.95
drawPlotMethod · 0.95
drawZoomRectMethod · 0.95
drawWhiteBoardersMethod · 0.95
drawAxisMethod · 0.95
drawAxisTicksMethod · 0.95
drawAxisTickLabelsMethod · 0.95
drawInfoBoxMethod · 0.95
drawFadeBoxesMethod · 0.95

Tested by

no test coverage detected