Permalink
Browse files

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.
  • Loading branch information...
mgrojo committed Dec 2, 2017
1 parent bbe460c commit cef1e9020be975ad675d02f542b77747d778f8d0
Showing with 9 additions and 5 deletions.
  1. +4 −2 src/PlotDock.cpp
  2. +4 −3 src/PlotDock.ui
  3. +1 −0 src/icons/icons.qrc
  4. BIN src/icons/picture_save.png
@@ -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
@@ -246,7 +246,7 @@
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/save_table</normaloff>:/icons/save_table</iconset>
<normaloff>:/icons/image_save</normaloff>:/icons/image_save</iconset>
</property>
<property name="checkable">
<bool>false</bool>
@@ -265,11 +265,12 @@
<item>
<widget class="QToolButton" name="buttonLoadAllData">
<property name="toolTip">
<string>Load all data. This has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
<string>Load all data and redraw plot.
Data loading has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
</property>
<property name="icon">
<iconset resource="icons/icons.qrc">
<normaloff>:/icons/keyword</normaloff>:/icons/keyword</iconset>
<normaloff>:/icons/refresh</normaloff>:/icons/refresh</iconset>
</property>
</widget>
</item>
@@ -61,5 +61,6 @@
<file alias="close">cross.png</file>
<file alias="special_copy">page_white_copy.png</file>
<file alias="text_replace">text_replace.png</file>
<file alias="image_save">picture_save.png</file>
</qresource>
</RCC>
Binary file not shown.

0 comments on commit cef1e90

Please sign in to comment.