def __init__(self, parent, **kwargs): """Creates a new instance of CadenceToolViewerWidget.""" super(CadenceToolViewerWidget, self).__init__(parent, widgetFile=False, **kwargs) self._hasHelp = False self._definition = None mainLayout = self._getLayout(self, QtGui.QVBoxLayout) mainLayout.setContentsMargins(0, 0, 0, 0) self._header = ToolViewerHeaderElement(self) mainLayout.addWidget(self._header) focalBox, focalLayout = self._createElementWidget(self, QtGui.QHBoxLayout, True) self._toolScroller = SimpleScrollArea(focalBox) focalLayout.addWidget(self._toolScroller) self._toolBox = self._toolScroller.containerWidget self._getLayout(self._toolBox, QtGui.QVBoxLayout) self._containerWidget = self._toolBox w, l = self._createWidget(focalBox, QtGui.QHBoxLayout, True) self._helpBox = w sep = LineSeparatorWidget(w, False) l.addWidget(sep) self._helpComm = ToolsHelpCommunicator() web = PyGlassWebView(w, communicator=self._helpComm, debug=True) web.openUrl('http://web.localhost.com/help/toolHelpContainer.html') web.setFixedWidth(360) self._helpWebView = web l.addWidget(self._helpWebView)
class PyGlassWebKitWidget(PyGlassWidget): """A class for...""" # =================================================================================================== # C L A S S # ___________________________________________________________________________________________________ __init__ def __init__(self, parent=None, **kwargs): """Creates a new instance of PyGlassWebKitWidget.""" self._communicator = ArgsUtils.extract("communicator", None, kwargs) self._debug = ArgsUtils.extract("debug", False, kwargs) url = ArgsUtils.extract("url", None, kwargs) localUrl = ArgsUtils.extract("localUrl", None, kwargs) PyGlassWidget.__init__(self, parent, widgetFile=False, **kwargs) layout = self._getLayout(self, QtGui.QVBoxLayout) layout.setContentsMargins(0, 0, 0, 0) self._webView = PyGlassWebView(self, communicator=self._communicator, debug=self._debug) layout.addWidget(self._webView) self.setLayout(layout) if url: self._webView.openUrl(url) elif localUrl: self._webView.openLocalWebUrl(url) # =================================================================================================== # G E T / S E T # ___________________________________________________________________________________________________ GS: webView @property def webView(self): return self._webView