console, graphicsscene, and 2nd-level graphicsitems
This commit is contained in:
parent
cf312e7bac
commit
a2e8290d8e
@ -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'):
|
||||
|
@ -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:
|
||||
|
@ -92,7 +92,7 @@
|
||||
<customwidget>
|
||||
<class>ParameterTree</class>
|
||||
<extends>QTreeWidget</extends>
|
||||
<header>pyqtgraph.parametertree</header>
|
||||
<header>..parametertree</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
"""
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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,
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 = {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
from pyqtgraph.Qt import QtGui, QtCore
|
||||
from ..Qt import QtGui, QtCore
|
||||
import os, weakref, re
|
||||
|
||||
class ParameterItem(QtGui.QTreeWidgetItem):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user