MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / saveSourceTimelineViewState

Method saveSourceTimelineViewState

pj_app/src/MainWindow.cpp:3602–3616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3600}
3601
3602QDomElement MainWindow::saveSourceTimelineViewState(QDomDocument& doc) const {
3603 // Read the view chrome off the widgets; layout_xml owns the XML schema.
3604 layout_xml::SourceTimelineViewState state;
3605 if (source_timeline_ != nullptr) {
3606 state.zoom = source_timeline_->zoom();
3607 state.scroll_left_ns = source_timeline_->viewportLeftDisplayNs();
3608 state.name_column_width = source_timeline_->nameColumnWidth();
3609 }
3610 if (ui_->timelineAlignRail != nullptr) {
3611 if (auto* snap = ui_->timelineAlignRail->findChild<QToolButton*>(QStringLiteral("buttonTimelineSnap"))) {
3612 state.snap = snap->isChecked();
3613 }
3614 }
3615 return layout_xml::writeSourceTimelineViewState(doc, state);
3616}
3617
3618void MainWindow::restoreSourceTimelineViewState(const QDomElement& element) {
3619 if (source_timeline_ == nullptr) {

Callers

nothing calls this directly

Calls 5

viewportLeftDisplayNsMethod · 0.80
nameColumnWidthMethod · 0.80
zoomMethod · 0.45
isCheckedMethod · 0.45

Tested by

no test coverage detected