! \brief Redraw the plot If the autoReplot option is not set (which is the default) or if any curves are attached to raw data, the plot has to be refreshed explicitly in order to make changes visible. \sa updateAxes(), setAutoReplot() */
| 543 | \sa updateAxes(), setAutoReplot() |
| 544 | */ |
| 545 | void QwtPlot::replot() |
| 546 | { |
| 547 | bool doAutoReplot = autoReplot(); |
| 548 | setAutoReplot( false ); |
| 549 | |
| 550 | updateAxes(); |
| 551 | |
| 552 | /* |
| 553 | Maybe the layout needs to be updated, because of changed |
| 554 | axes labels. We need to process them here before painting |
| 555 | to avoid that scales and canvas get out of sync. |
| 556 | */ |
| 557 | QApplication::sendPostedEvents( this, QEvent::LayoutRequest ); |
| 558 | |
| 559 | if ( m_data->canvas ) |
| 560 | { |
| 561 | const bool ok = QMetaObject::invokeMethod( |
| 562 | m_data->canvas, "replot", Qt::DirectConnection ); |
| 563 | if ( !ok ) |
| 564 | { |
| 565 | // fallback, when canvas has no a replot method |
| 566 | m_data->canvas->update( m_data->canvas->contentsRect() ); |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | setAutoReplot( doAutoReplot ); |
| 571 | } |
| 572 | |
| 573 | /*! |
| 574 | \brief Adjust plot content to its current size. |
no test coverage detected