|
|
@ -207,7 +207,6 @@ ChartView::ChartView(const QString &id, const Signal *sig, QWidget *parent) |
|
|
|
item_group->setZValue(chart->zValue() + 10); |
|
|
|
item_group->setZValue(chart->zValue() + 10); |
|
|
|
|
|
|
|
|
|
|
|
// title
|
|
|
|
// title
|
|
|
|
msg_title = new QGraphicsTextItem(chart); |
|
|
|
|
|
|
|
QToolButton *remove_btn = new QToolButton(); |
|
|
|
QToolButton *remove_btn = new QToolButton(); |
|
|
|
remove_btn->setText("X"); |
|
|
|
remove_btn->setText("X"); |
|
|
|
remove_btn->setAutoRaise(true); |
|
|
|
remove_btn->setAutoRaise(true); |
|
|
@ -236,13 +235,11 @@ ChartView::ChartView(const QString &id, const Signal *sig, QWidget *parent) |
|
|
|
|
|
|
|
|
|
|
|
void ChartView::resizeEvent(QResizeEvent *event) { |
|
|
|
void ChartView::resizeEvent(QResizeEvent *event) { |
|
|
|
QChartView::resizeEvent(event); |
|
|
|
QChartView::resizeEvent(event); |
|
|
|
msg_title->setPos(11, 6); |
|
|
|
|
|
|
|
close_btn_proxy->setPos(event->size().width() - close_btn_proxy->size().width() - 11, 8); |
|
|
|
close_btn_proxy->setPos(event->size().width() - close_btn_proxy->size().width() - 11, 8); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChartView::updateTitle() { |
|
|
|
void ChartView::updateTitle() { |
|
|
|
chart()->setTitle(signal->name.c_str()); |
|
|
|
chart()->setTitle(tr("<font color=\"gray\" text-align:left>%1 %2</font> <b>%3</b>").arg(dbc()->msg(id)->name).arg(id).arg(signal->name.c_str())); |
|
|
|
msg_title->setHtml(tr("%1 <font color=\"gray\">%2</font>").arg(dbc()->msg(id)->name).arg(id)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChartView::updateFromSettings() { |
|
|
|
void ChartView::updateFromSettings() { |
|
|
@ -250,7 +247,6 @@ void ChartView::updateFromSettings() { |
|
|
|
chart()->setTheme(settings.chart_theme == 0 ? QChart::ChartThemeLight : QChart::QChart::ChartThemeDark); |
|
|
|
chart()->setTheme(settings.chart_theme == 0 ? QChart::ChartThemeLight : QChart::QChart::ChartThemeDark); |
|
|
|
auto color = chart()->titleBrush().color(); |
|
|
|
auto color = chart()->titleBrush().color(); |
|
|
|
line_marker->setPen(QPen(color, 2)); |
|
|
|
line_marker->setPen(QPen(color, 2)); |
|
|
|
msg_title->setDefaultTextColor(color); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ChartView::setRange(double min, double max, bool force_update) { |
|
|
|
void ChartView::setRange(double min, double max, bool force_update) { |
|
|
|