- connect(_action_set_name, SIGNAL(triggered()),
- this, SLOT(on_action_set_name_triggered()));
- connect(_action_set_colour, SIGNAL(triggered()),
- this, SLOT(on_action_set_colour_triggered()));
+ connect(&_view.session(), SIGNAL(signals_changed()),
+ this, SLOT(on_signals_changed()));
+
+ connect(&_view, SIGNAL(signals_moved()),
+ this, SLOT(on_signals_moved()));
+
+ // Trigger the initial event manually. The default device has signals
+ // which were created before this object came into being
+ on_signals_changed();
+}
+
+QSize Header::sizeHint() const
+{
+ int max_width = 0;
+
+ const vector< shared_ptr<Trace> > traces(_view.get_traces());
+ BOOST_FOREACH(shared_ptr<Trace> t, traces) {
+ assert(t);
+
+ if (t->enabled()) {
+ max_width = max(max_width, (int)t->get_label_rect(0).width());
+ }
+ }
+
+ return QSize(max_width + Padding, 0);