From fbbfcbcaea3d2dc011358b348cfda8cd1cb1cd54 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Wed, 19 Mar 2014 12:16:41 +0100 Subject: [PATCH] make use of new module widgets, set a matplotlib figure the central GUI element --- pylot/QtPyLoT.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pylot/QtPyLoT.py b/pylot/QtPyLoT.py index 7948e27e..fad213cc 100755 --- a/pylot/QtPyLoT.py +++ b/pylot/QtPyLoT.py @@ -12,6 +12,7 @@ import helpform from pylot.core.util import _getVersionString from pylot.core.read.inputs import FilterOptions from pylot.core.util import FILTERDEFAULTS +from pylot.core.util import MPLWidget # Version information __version__ = _getVersionString() @@ -22,6 +23,10 @@ class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) + # create central matplotlib figure widget + dataPlot = setupPlot() + self.setCentralWidget(dataPlot) + filterOptionsP = FILTERDEFAULTS['P'] filterOptionsS = FILTERDEFAULTS['S'] self.filterOptionsP = FilterOptions(**filterOptionsP) @@ -32,7 +37,13 @@ class MainWindow(QMainWindow): filterDockWidget = FilterOptionsDock(titleString="Filter Options", parent=self, filterOptions=filteroptions) - self. + + def setupPlot(self): + # create a matplotlib widget + self.DataPlot = MPLWidget() + # create a layout inside the blank widget and add the matplotlib widget + layout = QtGui.QVBoxLayout(self.ui.widget_PlotArea) + layout.addWidget(self.DataPlot, 1) class PickWindow(QDialog): @@ -64,8 +75,6 @@ class FilterOptionsDock(QDockWidget): except e: raise OptionsError('%s' % e) - - class OptionsError(Exception): pass