| 180 | } |
| 181 | |
| 182 | void 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 | |
| 228 | void PlotViewWidget::mouseMoveEvent(QMouseEvent *mouseMoveEvent) |
| 229 | { |
nothing calls this directly
no test coverage detected