WebBrowser/WebInspector.py

branch
QtWebEngine
changeset 4782
4ad656e4ebec
parent 4781
15d416f1eca5
child 4886
b56735d36159
equal deleted inserted replaced
4781:15d416f1eca5 4782:4ad656e4ebec
45 registerView(self) 45 registerView(self)
46 46
47 self.page().windowCloseRequested.connect(self.close) 47 self.page().windowCloseRequested.connect(self.close)
48 self.page().loadFinished.connect(self.__loadFinished) 48 self.page().loadFinished.connect(self.__loadFinished)
49 49
50 def __del__(self):
51 """
52 Special method doing some cleanup stuff.
53 """
54 unregisterView(self)
55
56 def closeEvent(self, evt): 50 def closeEvent(self, evt):
57 """ 51 """
58 Protected method to save the geometry when closed. 52 Protected method to save the geometry when closed.
59 53
60 @param evt event object 54 @param evt event object
153 Function to register a view. 147 Function to register a view.
154 148
155 @param view reference to the view 149 @param view reference to the view
156 @type WebBrowserView 150 @type WebBrowserView
157 """ 151 """
152 if _VIEWS is None:
153 return
154
158 _VIEWS.insert(0, view) 155 _VIEWS.insert(0, view)
159 156
160 157
161 def unregisterView(view): 158 def unregisterView(view):
162 """ 159 """
163 Function to unregister a view. 160 Function to unregister a view.
164 161
165 @param view reference to the view 162 @param view reference to the view
166 @type WebBrowserView 163 @type WebBrowserView
167 """ 164 """
165 if _VIEWS is None:
166 return
167
168 if view in _VIEWS: 168 if view in _VIEWS:
169 _VIEWS.remove(view) 169 _VIEWS.remove(view)
170 170
171 171
172 def pushView(view): 172 def pushView(view):
174 Function to push a view to the front of the list. 174 Function to push a view to the front of the list.
175 175
176 @param view reference to the view 176 @param view reference to the view
177 @type WebBrowserView 177 @type WebBrowserView
178 """ 178 """
179 if _VIEWS is None:
180 return
181
179 if view in _VIEWS: 182 if view in _VIEWS:
180 _VIEWS.remove(view) 183 _VIEWS.remove(view)
181 _VIEWS.insert(0, view) 184 _VIEWS.insert(0, view)

eric ide

mercurial