Changeset 092a3d9 in sasview for src/sas/qtgui/PlotterBase.py
- Timestamp:
- Jan 20, 2017 8:26:35 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 03c372d
- Parents:
- 0f3c22d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/PlotterBase.py
rb46f285 r092a3d9 3 3 4 4 from PyQt4 import QtGui 5 from PyQt4 import QtCore 5 6 6 7 # TODO: Replace the qt4agg calls below with qt5 equivalent. … … 16 17 from sas.sasgui.plottools.binder import BindArtist 17 18 19 import sas.qtgui.GuiUtils as GuiUtils 20 from sas.sasgui.guiframe.dataFitting import Data1D, Data2D 18 21 from sas.qtgui.ScaleProperties import ScaleProperties 19 22 from sas.qtgui.WindowTitle import WindowTitle … … 37 40 # ... and the toolbar with all the default MPL buttons 38 41 self.toolbar = NavigationToolbar(self.canvas, self) 42 43 # Simple window for data display 44 self.txt_widget = QtGui.QTextEdit(None) 39 45 40 46 # Set the layout and place the canvas widget in it. … … 474 480 if self._scale_yhi is not None and self._scale_ylo is not None: 475 481 ax.set_ylim(self._scale_ylo, self._scale_yhi) 482 483 def onDataInfo(self, plot_data): 484 """ 485 Displays data info text window for the selected plot 486 """ 487 if isinstance(plot_data, Data1D): 488 text_to_show = GuiUtils.retrieveData1d(plot_data) 489 else: 490 text_to_show = GuiUtils.retrieveData2d(plot_data) 491 # Hardcoded sizes to enable full width rendering with default font 492 self.txt_widget.resize(420,600) 493 494 self.txt_widget.setReadOnly(True) 495 self.txt_widget.setWindowFlags(QtCore.Qt.Window) 496 self.txt_widget.setWindowIcon(QtGui.QIcon(":/res/ball.ico")) 497 self.txt_widget.setWindowTitle("Data Info: %s" % plot_data.filename) 498 self.txt_widget.insertPlainText(text_to_show) 499 500 self.txt_widget.show() 501 # Move the slider all the way up, if present 502 vertical_scroll_bar = self.txt_widget.verticalScrollBar() 503 vertical_scroll_bar.triggerAction(QtGui.QScrollBar.SliderToMinimum) 504 505 def onSavePoints(self, plot_data): 506 """ 507 Saves plot data to a file 508 """ 509 if isinstance(plot_data, Data1D): 510 GuiUtils.saveData1D(plot_data) 511 else: 512 GuiUtils.saveData2D(plot_data)
Note: See TracChangeset
for help on using the changeset viewer.