Skip to content

Commit

Permalink
1、切换绘图方式时,不清除复选框。
Browse files Browse the repository at this point in the history
2、使用“数据分析窗”绘图时强制隐藏复选框。
  • Loading branch information
SuWeipeng committed Apr 12, 2019
1 parent 5a8d24e commit a89dc02
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion mainwindow.cpp
Expand Up @@ -325,6 +325,15 @@ void MainWindow::clearGraph()
_clearTreeWidget(_ui.treeWidget);
}

void MainWindow::clearGraphNotTree()
{
clear_alreadyPloted();
_ui.customPlot->legend->setVisible(false);
_ui.customPlot->clearGraphs();
_ui.customPlot->replot();
// _clearTreeWidget(_ui.treeWidget);
}

void MainWindow::_resetGraph()
{
_action_bold = (0x1<<0);
Expand Down Expand Up @@ -703,7 +712,7 @@ MainWindow::plotConf(QStringList conf)
QString offsetX("0");
QString offsetY("0");

clearGraph();
clearGraphNotTree();
_plotConf = true;

for(int i=0; i<conf.length(); i++){
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Expand Up @@ -53,6 +53,7 @@ public slots:
bool from); // false:DataAnalyzeController,true:Other
void clear_alreadyPloted() { _alreadyPloted.clear(); }
void clearGraph();
void clearGraphNotTree();
void plotConf(QStringList conf);

private slots:
Expand Down
5 changes: 4 additions & 1 deletion src/DataAnalyzeController.cpp
Expand Up @@ -11,7 +11,7 @@ DataAnalyzeController::DataAnalyzeController()
{
connect(MainWindow::getMainWindow(), &MainWindow::treeWidgetAddItem, this, &DataAnalyzeController::_setTableList);
connect(this, &DataAnalyzeController::plotGraph, MainWindow::getMainWindow(), &MainWindow::plotGraph);
connect(this, &DataAnalyzeController::clearGraph, MainWindow::getMainWindow(), &MainWindow::clearGraph);
connect(this, &DataAnalyzeController::clearGraph, MainWindow::getMainWindow(), &MainWindow::clearGraphNotTree);
connect(this, &DataAnalyzeController::clear_alreadyPloted, MainWindow::getMainWindow(), &MainWindow::clear_alreadyPloted);

QList<int> list;
Expand Down Expand Up @@ -188,6 +188,9 @@ DataAnalyzeController::_update_hide_tables(QString table)
void
DataAnalyzeController::_plot(){
QCustomPlot* customPlot = MainWindow::getMainWindow()->ui().customPlot;
QList<int> list;

MainWindow::getMainWindow()->ui().splitter->setSizes(list<<0<<1);

emit clearGraph();

Expand Down

0 comments on commit a89dc02

Please sign in to comment.