diff --git a/pyqtgraph/GraphicsScene/GraphicsScene.py b/pyqtgraph/GraphicsScene/GraphicsScene.py
index 3fdd5924..cce7ac4a 100644
--- a/pyqtgraph/GraphicsScene/GraphicsScene.py
+++ b/pyqtgraph/GraphicsScene/GraphicsScene.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Qt import QtCore, QtGui
-from pyqtgraph.python2_3 import sortList
+from ..python2_3 import sortList
#try:
#from PyQt4 import QtOpenGL
#HAVE_OPENGL = True
@@ -8,11 +8,11 @@ from pyqtgraph.python2_3 import sortList
#HAVE_OPENGL = False
import weakref
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
-import pyqtgraph.ptime as ptime
+from ..Point import Point
+from .. import functions as fn
+from .. import ptime as ptime
from .mouseEvents import *
-import pyqtgraph.debug as debug
+from .. import debug as debug
from . import exportDialog
if hasattr(QtCore, 'PYQT_VERSION'):
diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py
index 436d5e42..5efb7c44 100644
--- a/pyqtgraph/GraphicsScene/exportDialog.py
+++ b/pyqtgraph/GraphicsScene/exportDialog.py
@@ -1,6 +1,8 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
-import pyqtgraph as pg
-import pyqtgraph.exporters as exporters
+from ..Qt import QtCore, QtGui, USE_PYSIDE
+from .. import exporters as exporters
+from .. import functions as fn
+from ..graphicsItems.ViewBox import ViewBox
+from ..graphicsItems.PlotItem import PlotItem
if USE_PYSIDE:
from . import exportDialogTemplate_pyside as exportDialogTemplate
@@ -18,7 +20,7 @@ class ExportDialog(QtGui.QWidget):
self.scene = scene
self.selectBox = QtGui.QGraphicsRectItem()
- self.selectBox.setPen(pg.mkPen('y', width=3, style=QtCore.Qt.DashLine))
+ self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))
self.selectBox.hide()
self.scene.addItem(self.selectBox)
@@ -35,10 +37,10 @@ class ExportDialog(QtGui.QWidget):
def show(self, item=None):
if item is not None:
## Select next exportable parent of the item originally clicked on
- while not isinstance(item, pg.ViewBox) and not isinstance(item, pg.PlotItem) and item is not None:
+ while not isinstance(item, ViewBox) and not isinstance(item, PlotItem) and item is not None:
item = item.parentItem()
## if this is a ViewBox inside a PlotItem, select the parent instead.
- if isinstance(item, pg.ViewBox) and isinstance(item.parentItem(), pg.PlotItem):
+ if isinstance(item, ViewBox) and isinstance(item.parentItem(), PlotItem):
item = item.parentItem()
self.updateItemList(select=item)
self.setVisible(True)
@@ -64,9 +66,9 @@ class ExportDialog(QtGui.QWidget):
def updateItemTree(self, item, treeItem, select=None):
si = None
- if isinstance(item, pg.ViewBox):
+ if isinstance(item, ViewBox):
si = QtGui.QTreeWidgetItem(['ViewBox'])
- elif isinstance(item, pg.PlotItem):
+ elif isinstance(item, PlotItem):
si = QtGui.QTreeWidgetItem(['Plot'])
if si is not None:
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate.ui b/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
index c91fbc3f..eacacd88 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate.ui
@@ -92,7 +92,7 @@
ParameterTree
QTreeWidget
-
+
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
index c3056d1c..3bbab155 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyqt.py
@@ -65,4 +65,4 @@ class Ui_Form(object):
self.label_3.setText(QtGui.QApplication.translate("Form", "Export options", None, QtGui.QApplication.UnicodeUTF8))
self.copyBtn.setText(QtGui.QApplication.translate("Form", "Copy", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.parametertree import ParameterTree
+from ..parametertree import ParameterTree
diff --git a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
index cf27f60a..8c95e717 100644
--- a/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
+++ b/pyqtgraph/GraphicsScene/exportDialogTemplate_pyside.py
@@ -60,4 +60,4 @@ class Ui_Form(object):
self.label_3.setText(QtGui.QApplication.translate("Form", "Export options", None, QtGui.QApplication.UnicodeUTF8))
self.copyBtn.setText(QtGui.QApplication.translate("Form", "Copy", None, QtGui.QApplication.UnicodeUTF8))
-from pyqtgraph.parametertree import ParameterTree
+from ..parametertree import ParameterTree
diff --git a/pyqtgraph/GraphicsScene/mouseEvents.py b/pyqtgraph/GraphicsScene/mouseEvents.py
index 0b71ac6f..f337a657 100644
--- a/pyqtgraph/GraphicsScene/mouseEvents.py
+++ b/pyqtgraph/GraphicsScene/mouseEvents.py
@@ -1,7 +1,7 @@
-from pyqtgraph.Point import Point
-from pyqtgraph.Qt import QtCore, QtGui
+from ..Point import Point
+from ..Qt import QtCore, QtGui
import weakref
-import pyqtgraph.ptime as ptime
+from .. import ptime as ptime
class MouseDragEvent(object):
"""
diff --git a/pyqtgraph/console/CmdInput.py b/pyqtgraph/console/CmdInput.py
index 3e9730d6..24a01e89 100644
--- a/pyqtgraph/console/CmdInput.py
+++ b/pyqtgraph/console/CmdInput.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtCore, QtGui
+from ..python2_3 import asUnicode
class CmdInput(QtGui.QLineEdit):
diff --git a/pyqtgraph/console/Console.py b/pyqtgraph/console/Console.py
index 982c2424..0cbd2c3e 100644
--- a/pyqtgraph/console/Console.py
+++ b/pyqtgraph/console/Console.py
@@ -1,14 +1,14 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
+from ..Qt import QtCore, QtGui, USE_PYSIDE
import sys, re, os, time, traceback, subprocess
-import pyqtgraph as pg
if USE_PYSIDE:
from . import template_pyside as template
else:
from . import template_pyqt as template
-import pyqtgraph.exceptionHandling as exceptionHandling
+from .. import exceptionHandling as exceptionHandling
import pickle
+from .. import getConfigOption
class ConsoleWidget(QtGui.QWidget):
"""
@@ -281,7 +281,7 @@ class ConsoleWidget(QtGui.QWidget):
def stackItemDblClicked(self, item):
editor = self.editor
if editor is None:
- editor = pg.getConfigOption('editorCommand')
+ editor = getConfigOption('editorCommand')
if editor is None:
return
tb = self.currentFrame()
diff --git a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
index b99a3266..baff1aa9 100644
--- a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
+++ b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
@@ -16,16 +16,16 @@ This class is very heavily featured:
- Control panel with a huge feature set including averaging, decimation,
display, power spectrum, svg/png export, plot linking, and more.
"""
-from pyqtgraph.Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
-import pyqtgraph.pixmaps
+from ...Qt import QtGui, QtCore, QtSvg, USE_PYSIDE
+from ... import pixmaps
if USE_PYSIDE:
from .plotConfigTemplate_pyside import *
else:
from .plotConfigTemplate_pyqt import *
-import pyqtgraph.functions as fn
-from pyqtgraph.widgets.FileDialog import FileDialog
+from ... import functions as fn
+from ...widgets.FileDialog import FileDialog
import weakref
import numpy as np
import os
@@ -37,7 +37,7 @@ from .. LegendItem import LegendItem
from .. GraphicsWidget import GraphicsWidget
from .. ButtonItem import ButtonItem
from .. InfiniteLine import InfiniteLine
-from pyqtgraph.WidgetGroup import WidgetGroup
+from ...WidgetGroup import WidgetGroup
__all__ = ['PlotItem']
@@ -129,7 +129,7 @@ class PlotItem(GraphicsWidget):
path = os.path.dirname(__file__)
#self.autoImageFile = os.path.join(path, 'auto.png')
#self.lockImageFile = os.path.join(path, 'lock.png')
- self.autoBtn = ButtonItem(pyqtgraph.pixmaps.getPixmap('auto'), 14, self)
+ self.autoBtn = ButtonItem(pixmaps.getPixmap('auto'), 14, self)
self.autoBtn.mode = 'auto'
self.autoBtn.clicked.connect(self.autoBtnClicked)
#self.autoBtn.hide()
diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
index 17bd2207..70012ec4 100644
--- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
+++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
@@ -1,15 +1,15 @@
-from pyqtgraph.Qt import QtGui, QtCore
-from pyqtgraph.python2_3 import sortList
+from ...Qt import QtGui, QtCore
+from ...python2_3 import sortList
import numpy as np
-from pyqtgraph.Point import Point
-import pyqtgraph.functions as fn
+from ...Point import Point
+from ... import functions as fn
from .. ItemGroup import ItemGroup
from .. GraphicsWidget import GraphicsWidget
-from pyqtgraph.GraphicsScene import GraphicsScene
-import pyqtgraph
+from ...GraphicsScene import GraphicsScene
import weakref
from copy import deepcopy
-import pyqtgraph.debug as debug
+from ... import debug as debug
+from ... import getConfigOption
__all__ = ['ViewBox']
@@ -113,7 +113,7 @@ class ViewBox(GraphicsWidget):
## a name string indicates that the view *should* link to another, but no view with that name exists yet.
'mouseEnabled': [enableMouse, enableMouse],
- 'mouseMode': ViewBox.PanMode if pyqtgraph.getConfigOption('leftButtonPan') else ViewBox.RectMode,
+ 'mouseMode': ViewBox.PanMode if getConfigOption('leftButtonPan') else ViewBox.RectMode,
'enableMenu': enableMenu,
'wheelScaleFactor': -1.0 / 8.0,
diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py b/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
index 15d0be06..af142771 100644
--- a/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
+++ b/pyqtgraph/graphicsItems/ViewBox/ViewBoxMenu.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
-from pyqtgraph.python2_3 import asUnicode
-from pyqtgraph.WidgetGroup import WidgetGroup
+from ...Qt import QtCore, QtGui, USE_PYSIDE
+from ...python2_3 import asUnicode
+from ...WidgetGroup import WidgetGroup
if USE_PYSIDE:
from .axisCtrlTemplate_pyside import Ui_Form as AxisCtrlTemplate
diff --git a/pyqtgraph/parametertree/Parameter.py b/pyqtgraph/parametertree/Parameter.py
index 9a7ece25..45e46e55 100644
--- a/pyqtgraph/parametertree/Parameter.py
+++ b/pyqtgraph/parametertree/Parameter.py
@@ -1,6 +1,6 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import os, weakref, re
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
from .ParameterItem import ParameterItem
PARAM_TYPES = {}
diff --git a/pyqtgraph/parametertree/ParameterItem.py b/pyqtgraph/parametertree/ParameterItem.py
index 46499fd3..5a90becf 100644
--- a/pyqtgraph/parametertree/ParameterItem.py
+++ b/pyqtgraph/parametertree/ParameterItem.py
@@ -1,4 +1,4 @@
-from pyqtgraph.Qt import QtGui, QtCore
+from ..Qt import QtGui, QtCore
import os, weakref, re
class ParameterItem(QtGui.QTreeWidgetItem):
diff --git a/pyqtgraph/parametertree/ParameterTree.py b/pyqtgraph/parametertree/ParameterTree.py
index 866875e5..953f3bb7 100644
--- a/pyqtgraph/parametertree/ParameterTree.py
+++ b/pyqtgraph/parametertree/ParameterTree.py
@@ -1,5 +1,5 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.widgets.TreeWidget import TreeWidget
+from ..Qt import QtCore, QtGui
+from ..widgets.TreeWidget import TreeWidget
import os, weakref, re
from .ParameterItem import ParameterItem
#import functions as fn
diff --git a/pyqtgraph/parametertree/parameterTypes.py b/pyqtgraph/parametertree/parameterTypes.py
index 3300171f..f58145dd 100644
--- a/pyqtgraph/parametertree/parameterTypes.py
+++ b/pyqtgraph/parametertree/parameterTypes.py
@@ -1,14 +1,14 @@
-from pyqtgraph.Qt import QtCore, QtGui
-from pyqtgraph.python2_3 import asUnicode
+from ..Qt import QtCore, QtGui
+from ..python2_3 import asUnicode
from .Parameter import Parameter, registerParameterType
from .ParameterItem import ParameterItem
-from pyqtgraph.widgets.SpinBox import SpinBox
-from pyqtgraph.widgets.ColorButton import ColorButton
-#from pyqtgraph.widgets.GradientWidget import GradientWidget ## creates import loop
-import pyqtgraph as pg
-import pyqtgraph.pixmaps as pixmaps
+from ..widgets.SpinBox import SpinBox
+from ..widgets.ColorButton import ColorButton
+#from ..widgets.GradientWidget import GradientWidget ## creates import loop
+from .. import pixmaps as pixmaps
+from .. import functions as fn
import os
-from pyqtgraph.pgcollections import OrderedDict
+from ..pgcollections import OrderedDict
class WidgetParameterItem(ParameterItem):
"""
@@ -141,7 +141,7 @@ class WidgetParameterItem(ParameterItem):
self.hideWidget = False
w.setFlat(True)
elif t == 'colormap':
- from pyqtgraph.widgets.GradientWidget import GradientWidget ## need this here to avoid import loop
+ from ..widgets.GradientWidget import GradientWidget ## need this here to avoid import loop
w = GradientWidget(orientation='bottom')
w.sigChanged = w.sigGradientChangeFinished
w.sigChanging = w.sigGradientChanged
@@ -304,11 +304,11 @@ class SimpleParameter(Parameter):
self.saveState = self.saveColorState
def colorValue(self):
- return pg.mkColor(Parameter.value(self))
+ return fn.mkColor(Parameter.value(self))
def saveColorState(self):
state = Parameter.saveState(self)
- state['value'] = pg.colorTuple(self.value())
+ state['value'] = fn.colorTuple(self.value())
return state