| 113 | } |
| 114 | |
| 115 | void Header::paintEvent(QPaintEvent*) |
| 116 | { |
| 117 | using pv::view::Trace; |
| 118 | |
| 119 | QStyleOption o; |
| 120 | o.initFrom(this); |
| 121 | QPainter painter(this); |
| 122 | style()->drawPrimitive(QStyle::PE_Widget, &o, &painter, this); |
| 123 | |
| 124 | const int w = width(); |
| 125 | std::vector<Trace*> traces; |
| 126 | _view.get_traces(ALL_VIEW, traces); |
| 127 | |
| 128 | const bool dragging = !_drag_traces.empty(); |
| 129 | QColor fore(QWidget::palette().color(QWidget::foregroundRole())); |
| 130 | fore.setAlpha(View::ForeAlpha); |
| 131 | |
| 132 | QFont font(painter.font()); |
| 133 | float fSize = AppConfig::Instance().appOptions.fontSize; |
| 134 | if (fSize > 10) |
| 135 | fSize = 10; |
| 136 | font.setPointSizeF(fSize); |
| 137 | painter.setFont(font); |
| 138 | |
| 139 | for(auto t : traces) |
| 140 | { |
| 141 | t->paint_label(painter, w, dragging ? QPoint(-1, -1) : _mouse_point, fore); |
| 142 | } |
| 143 | |
| 144 | painter.end(); |
| 145 | } |
| 146 | |
| 147 | void Header::mouseDoubleClickEvent(QMouseEvent *event) |
| 148 | { |
nothing calls this directly
no test coverage detected