Improve the user interactions over plot: zooming and range dragging.

The rectangle selection is no longer possible. Control+click can be used
for selecting a range of items.

This allows more freedom for performing customisations as requested in
issue "Change axis limits #838".

The "Load all data" button tool-tip and icon have been readjusted so they
hint the additional use pattern of resetting the plot to the original
zoom and range limits.

New and more appropriate icon for the "Save Plot" button. Icon from the
Silk set from famfamfam.com.
This commit is contained in:
mgrojo
2017-12-02 17:41:41 +01:00
parent bbe460c349
commit cef1e9020b
4 changed files with 9 additions and 5 deletions

View File

@@ -197,8 +197,10 @@ void PlotDock::updatePlot(SqliteTableModel* model, BrowseDataTableSettings* sett
graph->setPen(QPen(item->backgroundColor(PlotColumnY)));
graph->setSelectable (QCP::stDataRange);
ui->plotWidget->setInteractions(QCP::iSelectPlottables);
ui->plotWidget->setSelectionRectMode(QCP::srmSelect);
// Enable: click on items to select them, Ctrl+Click for multi-selection, mouse-wheel for zooming and mouse drag for
// changing the visible range.
ui->plotWidget->setInteractions(QCP::iSelectPlottables | QCP::iMultiSelect | QCP::iRangeZoom | QCP::iRangeDrag);
ui->plotWidget->setSelectionRectMode(QCP::srmNone);
// prepare the data vectors for qcustomplot
// possible improvement might be a QVector subclass that directly