2424PYQT5 = False
2525PYSIDE = False
2626
27- # PyQt imports
2827if "pyqt4" in sys .argv :
2928 PYQT4 = True
29+ # noinspection PyUnresolvedReferences
3030 from PyQt4 .QtGui import *
31+ # noinspection PyUnresolvedReferences
3132 from PyQt4 .QtCore import *
3233elif "pyqt5" in sys .argv :
3334 PYQT5 = True
35+ # noinspection PyUnresolvedReferences
3436 from PyQt5 .QtGui import *
37+ # noinspection PyUnresolvedReferences
3538 from PyQt5 .QtCore import *
39+ # noinspection PyUnresolvedReferences
3640 from PyQt5 .QtWidgets import *
37- # PySide imports
3841elif "pyside" in sys .argv :
3942 PYSIDE = True
43+ # noinspection PyUnresolvedReferences
4044 import PySide
45+ # noinspection PyUnresolvedReferences
4146 from PySide import QtCore
47+ # noinspection PyUnresolvedReferences
4248 from PySide .QtGui import *
49+ # noinspection PyUnresolvedReferences
4350 from PySide .QtCore import *
4451else :
4552 print ("USAGE:" )
6370# OS differences
6471CefWidgetParent = QWidget
6572if LINUX and (PYQT4 or PYSIDE ):
73+ # noinspection PyUnresolvedReferences
6674 CefWidgetParent = QX11EmbedContainer
6775
6876
@@ -98,6 +106,7 @@ def check_versions():
98106
99107class MainWindow (QMainWindow ):
100108 def __init__ (self ):
109+ # noinspection PyArgumentList
101110 super (MainWindow , self ).__init__ (None )
102111 self .cef_widget = None
103112 self .navigation_bar = None
@@ -115,12 +124,15 @@ def setupLayout(self):
115124 self .cef_widget = CefWidget (self )
116125 self .navigation_bar = NavigationBar (self .cef_widget )
117126 layout = QGridLayout ()
127+ # noinspection PyArgumentList
118128 layout .addWidget (self .navigation_bar , 0 , 0 )
129+ # noinspection PyArgumentList
119130 layout .addWidget (self .cef_widget , 1 , 0 )
120131 layout .setContentsMargins (0 , 0 , 0 , 0 )
121132 layout .setSpacing (0 )
122133 layout .setRowStretch (0 , 0 )
123134 layout .setRowStretch (1 , 1 )
135+ # noinspection PyArgumentList
124136 frame = QFrame ()
125137 frame .setLayout (layout )
126138 self .setCentralWidget (frame )
@@ -140,8 +152,10 @@ def setupLayout(self):
140152 # a hidden window, embed CEF browser in it and then
141153 # create a container for that hidden window and replace
142154 # cef widget in the layout with the container.
155+ # noinspection PyUnresolvedReferences, PyArgumentList
143156 self .container = QWidget .createWindowContainer (
144157 self .cef_widget .hidden_window , parent = self )
158+ # noinspection PyArgumentList
145159 layout .addWidget (self .container , 1 , 0 )
146160
147161 def closeEvent (self , event ):
@@ -158,6 +172,7 @@ def clear_browser_references(self):
158172
159173class CefWidget (CefWidgetParent ):
160174 def __init__ (self , parent = None ):
175+ # noinspection PyArgumentList
161176 super (CefWidget , self ).__init__ (parent )
162177 self .parent = parent
163178 self .browser = None
@@ -180,6 +195,7 @@ def focusOutEvent(self, event):
180195
181196 def embedBrowser (self ):
182197 if PYQT5 and LINUX :
198+ # noinspection PyUnresolvedReferences
183199 self .hidden_window = QWindow ()
184200 window_info = cef .WindowInfo ()
185201 rect = [0 , 0 , self .width (), self .height ()]
@@ -246,6 +262,7 @@ def __init__(self, args):
246262
247263 def createTimer (self ):
248264 timer = QTimer ()
265+ # noinspection PyUnresolvedReferences
249266 timer .timeout .connect (self .onTimer )
250267 timer .start (10 )
251268 return timer
@@ -301,6 +318,7 @@ def OnGotFocus(self, browser, **_):
301318
302319class NavigationBar (QFrame ):
303320 def __init__ (self , cef_widget ):
321+ # noinspection PyArgumentList
304322 super (NavigationBar , self ).__init__ ()
305323 self .cef_widget = cef_widget
306324
@@ -311,22 +329,30 @@ def __init__(self, cef_widget):
311329
312330 # Back button
313331 self .back = self .createButton ("back" )
332+ # noinspection PyUnresolvedReferences
314333 self .back .clicked .connect (self .onBack )
334+ # noinspection PyArgumentList
315335 layout .addWidget (self .back , 0 , 0 )
316336
317337 # Forward button
318338 self .forward = self .createButton ("forward" )
339+ # noinspection PyUnresolvedReferences
319340 self .forward .clicked .connect (self .onForward )
341+ # noinspection PyArgumentList
320342 layout .addWidget (self .forward , 0 , 1 )
321343
322344 # Reload button
323345 self .reload = self .createButton ("reload" )
346+ # noinspection PyUnresolvedReferences
324347 self .reload .clicked .connect (self .onReload )
348+ # noinspection PyArgumentList
325349 layout .addWidget (self .reload , 0 , 2 )
326350
327351 # Url input
328352 self .url = QLineEdit ("" )
353+ # noinspection PyUnresolvedReferences
329354 self .url .returnPressed .connect (self .onGoUrl )
355+ # noinspection PyArgumentList
330356 layout .addWidget (self .url , 0 , 3 )
331357
332358 # Layout
0 commit comments