Skip to content

Commit cef1e90

Browse files
committed
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.
1 parent bbe460c commit cef1e90

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/PlotDock.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ void PlotDock::updatePlot(SqliteTableModel* model, BrowseDataTableSettings* sett
197197

198198
graph->setPen(QPen(item->backgroundColor(PlotColumnY)));
199199
graph->setSelectable (QCP::stDataRange);
200-
ui->plotWidget->setInteractions(QCP::iSelectPlottables);
201-
ui->plotWidget->setSelectionRectMode(QCP::srmSelect);
200+
// Enable: click on items to select them, Ctrl+Click for multi-selection, mouse-wheel for zooming and mouse drag for
201+
// changing the visible range.
202+
ui->plotWidget->setInteractions(QCP::iSelectPlottables | QCP::iMultiSelect | QCP::iRangeZoom | QCP::iRangeDrag);
203+
ui->plotWidget->setSelectionRectMode(QCP::srmNone);
202204

203205
// prepare the data vectors for qcustomplot
204206
// possible improvement might be a QVector subclass that directly

src/PlotDock.ui

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
</property>
247247
<property name="icon">
248248
<iconset resource="icons/icons.qrc">
249-
<normaloff>:/icons/save_table</normaloff>:/icons/save_table</iconset>
249+
<normaloff>:/icons/image_save</normaloff>:/icons/image_save</iconset>
250250
</property>
251251
<property name="checkable">
252252
<bool>false</bool>
@@ -265,11 +265,12 @@
265265
<item>
266266
<widget class="QToolButton" name="buttonLoadAllData">
267267
<property name="toolTip">
268-
<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>
268+
<string>Load all data and redraw plot.
269+
Data loading has only an effect if not all data has been fetched from the table yet due to the partial fetch mechanism.</string>
269270
</property>
270271
<property name="icon">
271272
<iconset resource="icons/icons.qrc">
272-
<normaloff>:/icons/keyword</normaloff>:/icons/keyword</iconset>
273+
<normaloff>:/icons/refresh</normaloff>:/icons/refresh</iconset>
273274
</property>
274275
</widget>
275276
</item>

src/icons/icons.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@
6161
<file alias="close">cross.png</file>
6262
<file alias="special_copy">page_white_copy.png</file>
6363
<file alias="text_replace">text_replace.png</file>
64+
<file alias="image_save">picture_save.png</file>
6465
</qresource>
6566
</RCC>

src/icons/picture_save.png

755 Bytes
Loading

0 commit comments

Comments
 (0)