File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 6969self .__modified__ = list () # Existing members modified in some way
7070
7171# Below members are set dynamically on import relative the original binding.
72- self .__version__ = "0.6.4 "
72+ self .__version__ = "0.6.5 "
7373self .__qt_version__ = "0.0.0"
7474self .__binding__ = "None"
7575self .__binding_version__ = "0.0.0"
@@ -189,6 +189,7 @@ def _pyqt4():
189189
190190 import PyQt4 .Qt
191191 from PyQt4 import QtCore , QtGui , uic
192+
192193
193194 _remap (PyQt4 , "QtWidgets" , QtGui )
194195 _remap (QtCore , "Signal" , QtCore .pyqtSignal )
@@ -403,7 +404,11 @@ def init():
403404 __name__ : binding ,
404405
405406 # Fix #133, `from Qt.QtWidgets import QPushButton`
406- __name__ + ".QtWidgets" : binding .QtWidgets
407+ __name__ + ".QtWidgets" : binding .QtWidgets ,
408+
409+ # Fix #158 `import Qt.QtCore;Qt.QtCore.Signal`
410+ __name__ + ".QtCore" : binding .QtCore ,
411+ __name__ + ".QtGui" : binding .QtGui ,
407412
408413 })
409414
Original file line number Diff line number Diff line change @@ -307,17 +307,28 @@ def test_import_from_qtwidgets():
307307 assert QPushButton .__name__ == "QPushButton" , QPushButton
308308
309309
310+ def test_i158_qtcore_direct_import ():
311+ """import Qt.QtCore works on all bindings
312+
313+ This addresses issue #158
314+
315+ """
316+
317+ import Qt .QtCore
318+ assert hasattr (Qt .QtCore , "Signal" )
319+
320+
310321def test_translate_arguments ():
311322 """Arguments of QtCompat.translate are correct
312-
323+
313324 QtCompat.translate is a shim over the PySide, PyQt4 and PyQt5
314325 equivalent with an interface like the one found in PySide2.
315-
326+
316327 Reference: https://doc.qt.io/qt-5/qcoreapplication.html#translate
317328 """
318-
329+
319330 import Qt
320-
331+
321332 # This will run on each binding
322333 result = Qt .QtCompat .translate ("CustomDialog" , # context
323334 "Status" , # sourceText
You can’t perform that action at this time.
0 commit comments