@@ -163,6 +163,8 @@ void MainWindow::init()
163163 restoreState (PreferencesDialog::getSettingsValue (" MainWindow" , " windowState" ).toByteArray ());
164164 ui->comboLogSubmittedBy ->setCurrentIndex (ui->comboLogSubmittedBy ->findText (PreferencesDialog::getSettingsValue (" SQLLogDock" , " Log" ).toString ()));
165165 ui->splitterForPlot ->restoreState (PreferencesDialog::getSettingsValue (" PlotDock" , " splitterSize" ).toByteArray ());
166+ ui->comboLineType ->setCurrentIndex (PreferencesDialog::getSettingsValue (" PlotDock" , " lineType" ).toInt ());
167+ ui->comboPointShape ->setCurrentIndex (PreferencesDialog::getSettingsValue (" PlotDock" , " pointShape" ).toInt ());
166168
167169 // plot widgets
168170 ui->treePlotColumns ->setSelectionMode (QAbstractItemView::NoSelection);
@@ -432,6 +434,8 @@ void MainWindow::closeEvent( QCloseEvent* event )
432434 PreferencesDialog::setSettingsValue (" MainWindow" , " windowState" , saveState ());
433435 PreferencesDialog::setSettingsValue (" SQLLogDock" , " Log" , ui->comboLogSubmittedBy ->currentText ());
434436 PreferencesDialog::setSettingsValue (" PlotDock" , " splitterSize" , ui->splitterForPlot ->saveState ());
437+ PreferencesDialog::setSettingsValue (" PlotDock" , " lineType" , ui->comboLineType ->currentIndex ());
438+ PreferencesDialog::setSettingsValue (" PlotDock" , " pointShape" , ui->comboPointShape ->currentIndex ());
435439 QMainWindow::closeEvent (event);
436440 } else {
437441 event->ignore ();
@@ -1624,8 +1628,8 @@ void MainWindow::updatePlot(SqliteTableModel *model, bool update)
16241628 // set some graph styles, this could also be improved to let the user choose
16251629 // some styling
16261630 graph->setData (xdata, ydata);
1627- graph->setLineStyle (QCPGraph::lsLine );
1628- graph->setScatterStyle (QCPScatterStyle (QCPScatterStyle::ssDisc , 5 ));
1631+ graph->setLineStyle (( QCPGraph::LineStyle) ui-> comboLineType -> currentIndex () );
1632+ graph->setScatterStyle (QCPScatterStyle (( QCPScatterStyle::ScatterShape)ui-> comboPointShape -> currentIndex () , 5 ));
16291633
16301634 // gather Y label column names
16311635 yAxisLabels << model->headerData (y, Qt::Horizontal).toString ();
@@ -2110,3 +2114,31 @@ void MainWindow::copyCurrentCreateStatement()
21102114 // Copy the statement to the global application clipboard
21112115 QApplication::clipboard ()->setText (stmt);
21122116}
2117+
2118+ void MainWindow::on_comboLineType_currentIndexChanged (int index)
2119+ {
2120+ Q_ASSERT (index >= QCPGraph::lsNone &&
2121+ index <= QCPGraph::lsImpulse);
2122+ QCPGraph::LineStyle lineStyle = (QCPGraph::LineStyle) index;
2123+ for (int i = 0 , ie = ui->plotWidget ->graphCount (); i < ie; ++i)
2124+ {
2125+ QCPGraph * graph = ui->plotWidget ->graph (i);
2126+ if (graph)
2127+ graph->setLineStyle (lineStyle);
2128+ }
2129+ ui->plotWidget ->replot ();
2130+ }
2131+
2132+ void MainWindow::on_comboPointShape_currentIndexChanged (int index)
2133+ {
2134+ Q_ASSERT (index >= QCPScatterStyle::ssNone &&
2135+ index < QCPScatterStyle::ssPixmap);
2136+ QCPScatterStyle::ScatterShape shape = (QCPScatterStyle::ScatterShape) index;
2137+ for (int i = 0 , ie = ui->plotWidget ->graphCount (); i < ie; ++i)
2138+ {
2139+ QCPGraph * graph = ui->plotWidget ->graph (i);
2140+ if (graph)
2141+ graph->setScatterStyle (QCPScatterStyle (shape, 5 ));
2142+ }
2143+ ui->plotWidget ->replot ();
2144+ }
0 commit comments