• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

paulmthompson / WhiskerToolbox / 18045385035

26 Sep 2025 05:53PM UTC coverage: 69.782% (+0.01%) from 69.77%
18045385035

push

github

paulmthompson
fix corrupted lambda capture with notification in data transform sub widgets

42952 of 61552 relevant lines covered (69.78%)

1129.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.69
/src/WhiskerToolbox/Analysis_Dashboard/PlotContainer.cpp
1
#include "PlotContainer.hpp"
2
#include "DataManager/DataManager.hpp"
3
#include "Plots/AbstractPlotWidget.hpp"
4
#include "Properties/AbstractPlotPropertiesWidget.hpp"
5

6
PlotContainer::PlotContainer(std::unique_ptr<AbstractPlotWidget> plot_widget,
14✔
7
                             std::unique_ptr<AbstractPlotPropertiesWidget> properties_widget,
8
                             QObject * parent)
14✔
9
    : QObject(parent),
10
      plot_widget_(std::move(plot_widget)),
14✔
11
      properties_widget_(std::move(properties_widget)) {
28✔
12
    // Ensure the plot widget has this container as parent for proper cleanup
13
    //if (plot_widget_) {
14
    //    plot_widget_->setParent(this);
15
    //}
16

17
    // Set properties widget configuration
18
    if (properties_widget_) {
14✔
19
        // Note: We don't set parent here because properties_widget_ is a QWidget
20
        // and this is a QObject. The unique_ptr ownership is sufficient.
21
        properties_widget_->setPlotWidget(plot_widget_.get());
14✔
22
    }
23

24
    connectInternalSignals();
14✔
25
}
14✔
26

27
PlotContainer::~PlotContainer() = default;
28✔
28

29

30
QString PlotContainer::getPlotId() const {
12✔
31
    return plot_widget_ ? plot_widget_->getPlotId() : QString();
12✔
32
}
33

34
QString PlotContainer::getPlotType() const {
×
35
    return plot_widget_ ? plot_widget_->getPlotType() : QString();
×
36
}
37

38
void PlotContainer::configureManagers(std::shared_ptr<DataManager> data_manager,
2✔
39
                                      GroupManager * group_manager) {
40
    qDebug() << "PlotContainer::configureManagers: Configuring with DataManager for plot:" << getPlotId();
2✔
41
    qDebug() << "  - DataManager:" << (data_manager != nullptr);
2✔
42
    qDebug() << "  - GroupManager:" << (group_manager != nullptr);
2✔
43

44
    if (plot_widget_) {
2✔
45
        plot_widget_->setDataManager(std::move(data_manager));
2✔
46
        plot_widget_->setGroupManager(group_manager);
2✔
47
        qDebug() << "PlotContainer::configureManagers: Configured plot widget with DataManager";
2✔
48
    } else {
49
        qDebug() << "PlotContainer::configureManagers: ERROR - null plot_widget_";
×
50
    }
51
    // Properties widgets retrieve DataManager through setDataManager in analysis dashboard
52
}
2✔
53

54
void PlotContainer::updatePropertiesFromPlot() {
×
55
    if (properties_widget_) {
×
56
        properties_widget_->updateFromPlot();
×
57
    }
58
}
×
59

60
void PlotContainer::applyPropertiesToPlot() {
×
61
    if (properties_widget_) {
×
62
        properties_widget_->applyToPlot();
×
63
    }
64
}
×
65

66
void PlotContainer::onPlotSelected(QString const & plot_id) {
×
67
    qDebug() << "PlotContainer::onPlotSelected called with plot_id:" << plot_id;
×
68
    emit plotSelected(plot_id);
×
69
}
×
70

71
void PlotContainer::onPropertiesChanged() {
×
72
    // Automatically apply properties when they change
73
    applyPropertiesToPlot();
×
74
    emit propertiesChanged(getPlotId());
×
75
}
×
76

77
void PlotContainer::onFrameJumpRequested(int64_t time_frame_index, std::string const & data_key) {
×
78
    emit frameJumpRequested(time_frame_index, data_key);
×
79
}
×
80

81
void PlotContainer::connectInternalSignals() {
14✔
82
    if (plot_widget_) {
14✔
83
        connect(plot_widget_.get(), &AbstractPlotWidget::plotSelected,
42✔
84
                this, &PlotContainer::onPlotSelected);
28✔
85
        connect(plot_widget_.get(), &AbstractPlotWidget::frameJumpRequested,
42✔
86
                this, &PlotContainer::onFrameJumpRequested);
28✔
87
    }
88

89
    if (properties_widget_) {
14✔
90
        connect(properties_widget_.get(), &AbstractPlotPropertiesWidget::propertiesChanged,
42✔
91
                this, &PlotContainer::onPropertiesChanged);
28✔
92
    }
93
}
14✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc