@@ -1042,7 +1042,7 @@ def findAncestor(self, ancestor, obj):
10421042 parent = obj .parent ()
10431043
10441044 def setCurrentSelector (self , obj , localCall = True ):
1045- if obj and not sip .isdeleted (obj ) and obj is not self .currentWidget and self .findAncestor (self .currentWindow ,obj ):
1045+ if obj and not sip .isdeleted (obj ) and obj is not self .currentWidget and self .findAncestor (self .currentWindow ,obj ) and self . selectorWidget :
10461046 self .selectorWidget .setVisible (True )
10471047
10481048 if self .useStyleSheet :
@@ -1085,20 +1085,22 @@ def __init__(self, caller, parent=None):
10851085 def eventFilter (self , obj , event ):
10861086 etype = event .type ()
10871087
1088- if etype == 129 or (etype == 6 and event .key () == self .caller .modKey [1 ]):
1089- if etype == 6 and event .key () == self .caller .modKey [1 ]:
1088+ if etype == QEvent . HoverMove or (etype == QEvent . KeyPress and event .key () == self .caller .modKey [1 ]):
1089+ if etype == QEvent . KeyPress and event .key () == self .caller .modKey [1 ]:
10901090 win = QtWidgets .qApp .activeWindow ()
10911091 self .caller .selectorWidget = win .findChild (QWidget , "DevToolsSelectorWidget" , Qt .FindDirectChildrenOnly )
10921092
10931093 if QApplication .keyboardModifiers () == self .caller .modKey [0 ]:
1094+ win = QtWidgets .qApp .activeWindow ()
1095+ if win .__class__ .__name__ == 'PluginDevToolsDialog' :
1096+ win .parentWidget ().activateWindow ()
10941097 pos = QCursor .pos ()
10951098 onWidget = QApplication .widgetAt (pos )
10961099 self .caller .setCurrentSelector (onWidget )
1097- elif etype == 7 and event .key () == self .caller .modKey [1 ] and self .caller .currentWidget :
1100+ elif etype == QEvent . KeyRelease and event .key () == self .caller .modKey [1 ] and self .caller .currentWidget :
10981101 self .caller .finishedSampling ()
10991102
11001103
1101- #print (obj, event.type())
11021104 return False
11031105
11041106
0 commit comments