Changeset 464cd07 in sasview for src/sas/qtgui/Plotting


Ignore:
Timestamp:
Aug 22, 2017 5:59:29 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
b2a5042
Parents:
457d961
Message:

Use singleton QApplication in unit tests to avoid issues on Ubuntu. SASVIEW-485

Location:
src/sas/qtgui/Plotting/UnitTesting
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/UnitTesting/AddTextTest.py

    r83eb5208 r464cd07  
    1111from sas.qtgui.Plotting.AddText import AddText 
    1212 
    13 app = QtGui.QApplication(sys.argv) 
     13if not QtGui.QApplication.instance(): 
     14    app = QtGui.QApplication(sys.argv) 
    1415 
    1516class AddTextTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/BoxSumTest.py

    r83eb5208 r464cd07  
    1212from sas.qtgui.Plotting.BoxSum import BoxSum 
    1313 
    14 app = QtGui.QApplication(sys.argv) 
     14if not QtGui.QApplication.instance(): 
     15    app = QtGui.QApplication(sys.argv) 
    1516 
    1617class BoxSumTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py

    rdc5ef15 r464cd07  
    1818from sas.qtgui.Plotting.ColorMap import ColorMap 
    1919 
    20 app = QtGui.QApplication(sys.argv) 
     20if not QtGui.QApplication.instance(): 
     21    app = QtGui.QApplication(sys.argv) 
    2122 
    2223class ColorMapTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py

    rdc5ef15 r464cd07  
    1515from sas.qtgui.Plotting.LinearFit import LinearFit 
    1616 
    17 app = QtGui.QApplication(sys.argv) 
     17if not QtGui.QApplication.instance(): 
     18    app = QtGui.QApplication(sys.argv) 
    1819 
    1920class LinearFitTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/PlotPropertiesTest.py

    r83eb5208 r464cd07  
    1111from sas.qtgui.Plotting.PlotProperties import PlotProperties 
    1212 
    13 app = QtGui.QApplication(sys.argv) 
     13if not QtGui.QApplication.instance(): 
     14    app = QtGui.QApplication(sys.argv) 
    1415 
    1516class PlotPropertiesTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py

    rdc5ef15 r464cd07  
    1919import sas.qtgui.Plotting.Plotter2D as Plotter2D 
    2020 
    21 app = QtGui.QApplication(sys.argv) 
     21if not QtGui.QApplication.instance(): 
     22    app = QtGui.QApplication(sys.argv) 
    2223 
    2324class Plotter2DTest(unittest.TestCase): 
     
    159160        def done(): 
    160161            self.clipboard_called = True 
    161         QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
     162        QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
    162163        actions[2].trigger() 
    163164        QtGui.qApp.processEvents() 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py

    rdc5ef15 r464cd07  
    2020import sas.qtgui.Plotting.PlotterBase as PlotterBase 
    2121 
    22 app = QtGui.QApplication(sys.argv) 
     22if not QtGui.QApplication.instance(): 
     23    app = QtGui.QApplication(sys.argv) 
    2324 
    2425class PlotterBaseTest(unittest.TestCase): 
     
    149150        def done(): 
    150151            self.clipboard_called = True 
    151         QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
     152        QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
    152153        actions[2].trigger() 
    153154        QtGui.qApp.processEvents() 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    rdc5ef15 r464cd07  
    2020import sas.qtgui.Plotting.Plotter as Plotter 
    2121 
    22 app = QtGui.QApplication(sys.argv) 
     22if not QtGui.QApplication.instance(): 
     23    app = QtGui.QApplication(sys.argv) 
    2324 
    2425 
     
    9798        def done(): 
    9899            self.clipboard_called = True 
    99         QtCore.QObject.connect(app.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
     100        QtCore.QObject.connect(QtGui.qApp.clipboard(), QtCore.SIGNAL("dataChanged()"), done) 
    100101        actions[2].trigger() 
    101102        QtGui.qApp.processEvents() 
  • src/sas/qtgui/Plotting/UnitTesting/ScalePropertiesTest.py

    r83eb5208 r464cd07  
    1010from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 
    1111 
    12 app = QtGui.QApplication(sys.argv) 
     12if not QtGui.QApplication.instance(): 
     13    app = QtGui.QApplication(sys.argv) 
    1314 
    1415class ScalePropertiesTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/SetGraphRangeTest.py

    r83eb5208 r464cd07  
    1010from sas.qtgui.Plotting.SetGraphRange import SetGraphRange 
    1111 
    12 app = QtGui.QApplication(sys.argv) 
     12if not QtGui.QApplication.instance(): 
     13    app = QtGui.QApplication(sys.argv) 
    1314 
    1415class SetGraphRangeTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/SlicerModelTest.py

    r83eb5208 r464cd07  
    1212from sas.qtgui.Plotting.SlicerModel import SlicerModel 
    1313 
    14 app = QtGui.QApplication(sys.argv) 
     14if not QtGui.QApplication.instance(): 
     15    app = QtGui.QApplication(sys.argv) 
    1516 
    1617class SlicerModelTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/SlicerParametersTest.py

    • Property mode changed from 100755 to 100644
    r83eb5208 r464cd07  
    1818from sas.qtgui.Plotting.SlicerParameters import SlicerParameters 
    1919 
    20 app = QtGui.QApplication(sys.argv) 
     20if not QtGui.QApplication.instance(): 
     21    app = QtGui.QApplication(sys.argv) 
    2122 
    2223class SlicerParametersTest(unittest.TestCase): 
  • src/sas/qtgui/Plotting/UnitTesting/WindowTitleTest.py

    r83eb5208 r464cd07  
    1010from sas.qtgui.Plotting.WindowTitle import WindowTitle 
    1111 
    12 app = QtGui.QApplication(sys.argv) 
     12if not QtGui.QApplication.instance(): 
     13    app = QtGui.QApplication(sys.argv) 
    1314 
    1415class WindowTitleTest(unittest.TestCase): 
     
    3233        '''Modify the title''' 
    3334        self.widget.show() 
    34         app.processEvents() 
     35        QtGui.qApp.processEvents() 
    3536        # make sure we have the pre-set title 
    3637        self.assertEqual(self.widget.txtTitle.text(), "some title") 
     
    3839        self.widget.txtTitle.clear() 
    3940        self.widget.txtTitle.setText("5 elephants") 
    40         app.processEvents() 
     41        QtGui.qApp.processEvents() 
    4142        # Retrieve value 
    4243        new_title = self.widget.title() 
Note: See TracChangeset for help on using the changeset viewer.