Skip to content

Commit

Permalink
Merge pull request #129 from jenshnielsen/fix_qt_imports
Browse files Browse the repository at this point in the history
correctly use QApp from qtwidgets not qtgui
  • Loading branch information
jenshnielsen authored Aug 21, 2020
2 parents dee0a95 + ce844c0 commit 7ba3d0a
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions doc/examples/autonode_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import lmfit

from plottr import QtGui
from plottr import QtWidgets
from plottr.data.datadict import DataDictBase
from plottr.data.qcodes_dataset import QCodesDSLoader
from plottr.node.tools import linearFlowchart
Expand Down Expand Up @@ -61,7 +61,7 @@ def sinefit(self, dataIn: DataDictBase = None):


def main(pathAndId):
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])

# flowchart and window
fc = linearFlowchart(
Expand Down
4 changes: 2 additions & 2 deletions test/apps/custom_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np
import lmfit

from plottr import QtGui
from plottr import QtWidgets
from plottr.data.datadict import DataDictBase, MeshgridDataDict
from plottr.gui.widgets import makeFlowchartWithPlotWindow
from plottr.node.dim_reducer import XYSelector
Expand Down Expand Up @@ -68,7 +68,7 @@ def makeNodeList():


def main():
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])

# flowchart and window
nodes = makeNodeList()
Expand Down
6 changes: 3 additions & 3 deletions test/gui/correct_offset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import numpy as np

from plottr import QtGui
from plottr import QtWidgets
from plottr.data.datadict import MeshgridDataDict
from plottr.gui.widgets import makeFlowchartWithPlotWindow
from plottr.node.filter.correct_offset import SubtractAverage
Expand Down Expand Up @@ -30,8 +30,8 @@ def subtractAverage():
data2.validate()

# make app and gui, fc
app = QtGui.QApplication([])
win, fc = makeFlowchartWithAutoPlotWindow([
app = QtWidgets.QApplication([])
win, fc = makeFlowchartWithPlotWindow([
('sub', SubtractAverage)
])
win.show()
Expand Down
4 changes: 2 additions & 2 deletions test/gui/data_display_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Testing scripts for GUI elements for data display.
"""

from plottr import QtGui
from plottr import QtWidgets
from plottr.gui.tools import widgetDialog
from plottr.gui.data_display import DataSelectionWidget
from plottr.utils import testdata
Expand All @@ -13,7 +13,7 @@ def test_dataSelectionWidget(readonly: bool = False):
def selectionCb(selection):
print(selection)

# app = QtGui.QApplication([])
# app = QtWidgets.QApplication([])
widget = DataSelectionWidget(readonly=readonly)
widget.dataSelectionMade.connect(selectionCb)

Expand Down
4 changes: 2 additions & 2 deletions test/gui/ddh5_loader.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from plottr import QtGui
from plottr import QtWidgets
from plottr.data import datadict_storage as dds
from plottr.node.tools import linearFlowchart
from plottr.gui.tools import widgetDialog
Expand All @@ -9,7 +9,7 @@ def cb(*vals):
print(vals)

if not interactive:
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])

fc = linearFlowchart(('loader', dds.DDH5Loader))
loader = fc.nodes()['loader']
Expand Down
8 changes: 4 additions & 4 deletions test/gui/dimension_assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Testing for axis settings / dimension-reduction widgets.
"""

from plottr import QtGui
from plottr import QtWidgets
from plottr.data.datadict import datadict_to_meshgrid
from plottr.gui.tools import widgetDialog
from plottr.node.dim_reducer import XYSelectionWidget, DimensionReducer, XYSelector
Expand All @@ -15,7 +15,7 @@ def xySelectionWidget():
def selectionCb(selection):
print(selection)

app = QtGui.QApplication([])
app = QtWidgets.QApplication([])
widget = XYSelectionWidget()
widget.rolesChanged.connect(selectionCb)

Expand All @@ -32,7 +32,7 @@ def selectionCb(selection):

def dimReduction(interactive=False):
if not interactive:
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])

fc = linearFlowchart(('reducer', DimensionReducer))
reducer = fc.nodes()['reducer']
Expand All @@ -51,7 +51,7 @@ def dimReduction(interactive=False):

def xySelection(interactive=False):
if not interactive:
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])

fc = linearFlowchart(('xysel', XYSelector))
selector = fc.nodes()['xysel']
Expand Down
6 changes: 3 additions & 3 deletions test/gui/simple_2d_plot.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import time

from plottr import QtGui
from plottr import QtWidgets
from plottr import log
from plottr.data.datadict import DataDict, datadict_to_meshgrid
from plottr.utils import testdata
Expand All @@ -20,7 +20,7 @@ def setup_logging():


def simple_2d_plot():
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])
win = PlotWindow()
plot = AutoPlot(parent=win)
win.plot.setPlotWidget(plot)
Expand Down Expand Up @@ -72,4 +72,4 @@ def simple_2d_plot():
if __name__ == '__main__':
from plottr import plottrPath
print(plottrPath)
simple_2d_plot()
simple_2d_plot()
4 changes: 2 additions & 2 deletions test/run_gui_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import importlib
import inspect

from plottr import QtGui, plottrPath
from plottr import QtWidgets, plottrPath


def run(func, **kw):
app = QtGui.QApplication([])
app = QtWidgets.QApplication([])
_ = func(**kw)
return app.exec_()

Expand Down

0 comments on commit 7ba3d0a

Please sign in to comment.