| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -105,6 +105,7 @@ ChartsWidget::ChartsWidget(QWidget *parent) : align_timer(this), auto_scroll_tim | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QObject::connect(reset_zoom_btn, &QToolButton::clicked, this, &ChartsWidget::zoomReset); | 
					 | 
					 | 
					 | 
					  QObject::connect(reset_zoom_btn, &QToolButton::clicked, this, &ChartsWidget::zoomReset); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QObject::connect(&settings, &Settings::changed, this, &ChartsWidget::settingChanged); | 
					 | 
					 | 
					 | 
					  QObject::connect(&settings, &Settings::changed, this, &ChartsWidget::settingChanged); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QObject::connect(new_tab_btn, &QToolButton::clicked, this, &ChartsWidget::newTab); | 
					 | 
					 | 
					 | 
					  QObject::connect(new_tab_btn, &QToolButton::clicked, this, &ChartsWidget::newTab); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  QObject::connect(this, &ChartsWidget::seriesChanged, this, &ChartsWidget::updateTabBar); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QObject::connect(tabbar, &QTabBar::tabCloseRequested, this, &ChartsWidget::removeTab); | 
					 | 
					 | 
					 | 
					  QObject::connect(tabbar, &QTabBar::tabCloseRequested, this, &ChartsWidget::removeTab); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  QObject::connect(tabbar, &QTabBar::currentChanged, [this](int index) { | 
					 | 
					 | 
					 | 
					  QObject::connect(tabbar, &QTabBar::currentChanged, [this](int index) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (index != -1) updateLayout(true); | 
					 | 
					 | 
					 | 
					    if (index != -1) updateLayout(true); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -126,10 +127,8 @@ void ChartsWidget::newTab() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  static int tab_unique_id = 0; | 
					 | 
					 | 
					 | 
					  static int tab_unique_id = 0; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  int idx = tabbar->addTab(""); | 
					 | 
					 | 
					 | 
					  int idx = tabbar->addTab(""); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  tabbar->setTabData(idx, tab_unique_id++); | 
					 | 
					 | 
					 | 
					  tabbar->setTabData(idx, tab_unique_id++); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  for (int i = 0; i < tabbar->count(); ++i) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    tabbar->setTabText(i, QString("Tab %1").arg(i + 1)); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  tabbar->setCurrentIndex(idx); | 
					 | 
					 | 
					 | 
					  tabbar->setCurrentIndex(idx); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  updateTabBar(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void ChartsWidget::removeTab(int index) { | 
					 | 
					 | 
					 | 
					void ChartsWidget::removeTab(int index) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -139,6 +138,14 @@ void ChartsWidget::removeTab(int index) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  tab_charts.erase(id); | 
					 | 
					 | 
					 | 
					  tab_charts.erase(id); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  tabbar->removeTab(index); | 
					 | 
					 | 
					 | 
					  tabbar->removeTab(index); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  updateTabBar(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					void ChartsWidget::updateTabBar() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  for (int i = 0; i < tabbar->count(); ++i) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    const auto &charts_in_tab = tab_charts[tabbar->tabData(i).toInt()]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    tabbar->setTabText(i, QString("Tab %1 (%2)").arg(i + 1).arg(charts_in_tab.count())); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void ChartsWidget::eventsMerged() { | 
					 | 
					 | 
					 | 
					void ChartsWidget::eventsMerged() { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -381,18 +388,19 @@ void ChartsWidget::removeChart(ChartView *chart) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void ChartsWidget::removeAll() { | 
					 | 
					 | 
					 | 
					void ChartsWidget::removeAll() { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  while (tabbar->count() > 1) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    tabbar->removeTab(1); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					  tab_charts.clear(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  if (!charts.isEmpty()) { | 
					 | 
					 | 
					 | 
					  if (!charts.isEmpty()) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    for (auto c : charts) { | 
					 | 
					 | 
					 | 
					    for (auto c : charts) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      c->deleteLater(); | 
					 | 
					 | 
					 | 
					      c->deleteLater(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    charts.clear(); | 
					 | 
					 | 
					 | 
					    charts.clear(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    tab_charts.clear(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    updateToolBar(); | 
					 | 
					 | 
					 | 
					    updateToolBar(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    emit seriesChanged(); | 
					 | 
					 | 
					 | 
					    emit seriesChanged(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  while (tabbar->count() > 1) { | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    tabbar->removeTab(1); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void ChartsWidget::alignCharts() { | 
					 | 
					 | 
					 | 
					void ChartsWidget::alignCharts() { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -475,6 +483,7 @@ void ChartsContainer::dropEvent(QDropEvent *event) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      int to = w ? charts_widget->currentCharts().indexOf(w) + 1 : 0; | 
					 | 
					 | 
					 | 
					      int to = w ? charts_widget->currentCharts().indexOf(w) + 1 : 0; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      charts_widget->currentCharts().insert(to, chart); | 
					 | 
					 | 
					 | 
					      charts_widget->currentCharts().insert(to, chart); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      charts_widget->updateLayout(true); | 
					 | 
					 | 
					 | 
					      charts_widget->updateLayout(true); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      charts_widget->updateTabBar(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      event->acceptProposedAction(); | 
					 | 
					 | 
					 | 
					      event->acceptProposedAction(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      chart->startAnimation(); | 
					 | 
					 | 
					 | 
					      chart->startAnimation(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |