Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
without naming the dataset if its data could not be read (e.g.
corrupt file or lost connection to DCOR); such datasets are now
skipped and listed (#208)
- fix: copying the statistics in the Quick View to the clipboard
raised an AttributeError (`QtWidgets.qApp` does not exist in PyQt6)
- enh: user-defined default settings for new plots ("Save as default"
in the plot settings) and default Young's modulus viscosity model
and look-up table for new datasets (preferences) (#129)
Expand Down
2 changes: 1 addition & 1 deletion dcscope/gui/quick_view/qv_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def on_stats2clipboard(self):
tsv = ""
for hi, vi in zip(h, v):
tsv += f"{hi}\t{vi:.7g}\n"
QtWidgets.qApp.clipboard().setText(tsv)
QtWidgets.QApplication.clipboard().setText(tsv)

@QtCore.pyqtSlot()
def on_tool(self, collapse=False):
Expand Down
22 changes: 22 additions & 0 deletions tests/test_gui_quickview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,3 +1486,25 @@ def test_hide_fluorescence_channel_traces_issue_200(qtbot, mw):
# show FL-2 again
qv.ui.checkBox_trace_fl2.setChecked(True)
qtbot.waitUntil(lambda: tp["fl2_raw"].isVisible(), timeout=5000)


def test_statistics_to_clipboard(qtbot, mw):
"""Copy the Quick View statistics to the clipboard"""
qtbot.addWidget(mw)
mw.add_dataslot(paths=[datapath / "calibration_beads_47.rtdc"])
slot_id = mw.pipeline.slot_ids[0]
filt_id = mw.pipeline.filter_ids[0]
em = mw.ui.block_matrix.get_widget(slot_id, filt_id)
qtbot.mouseClick(em, QtCore.Qt.MouseButton.LeftButton)
qtbot.mouseClick(em, QtCore.Qt.MouseButton.LeftButton,
QtCore.Qt.KeyboardModifier.ShiftModifier)
qv = mw.widget_quick_view
qtbot.waitUntil(qv.isVisible, timeout=5000)

QtWidgets.QApplication.clipboard().clear()
# (the settings tool is not shown, so we cannot use qtbot.mouseClick)
qv.ui.toolButton_stats2clipboard.click()
text = QtWidgets.QApplication.clipboard().text()
lines = text.strip().split("\n")
assert lines[0].startswith("Events\t47")
assert len(lines) > 5
Loading