22import pyqtgraph as pg
33from kilosort .gui .logger import setup_logger
44from kilosort .gui .palettes import COLORMAP_COLORS
5- from PyQt5 import QtCore , QtWidgets
5+ from qtpy import QtCore , QtWidgets
66
77logger = setup_logger (__name__ )
88
99
1010class DataViewBox (QtWidgets .QGroupBox ):
11- channelChanged = QtCore .pyqtSignal (int , int )
12- modeChanged = QtCore .pyqtSignal (str , int )
13- updateContext = QtCore .pyqtSignal (object )
14- intervalUpdated = QtCore .pyqtSignal ()
11+ channelChanged = QtCore .Signal (int , int )
12+ modeChanged = QtCore .Signal (str , int )
13+ updateContext = QtCore .Signal (object )
14+ intervalUpdated = QtCore .Signal ()
1515
1616 def __init__ (self , parent ):
1717 QtWidgets .QGroupBox .__init__ (self , parent = parent )
@@ -191,7 +191,7 @@ def setup(self):
191191
192192 self .setLayout (layout )
193193
194- @QtCore .pyqtSlot ()
194+ @QtCore .Slot ()
195195 def on_tmin_edited (self ):
196196 try :
197197 self .tmin = float (self .tmin_input .text ())
@@ -201,7 +201,7 @@ def on_tmin_edited(self):
201201 except AssertionError :
202202 logger .exception ('Invalid tmin,tmax: must have 0 <= tmin < tmax' )
203203
204- @QtCore .pyqtSlot ()
204+ @QtCore .Slot ()
205205 def on_tmax_edited (self ):
206206 try :
207207 self .tmax = float (self .tmax_input .text ())
@@ -216,7 +216,7 @@ def check_time_interval(self):
216216 assert self .tmin >= 0
217217 assert self .tmin < self .tmax
218218
219- @QtCore .pyqtSlot ()
219+ @QtCore .Slot ()
220220 def on_views_clicked (self ):
221221 current_state = {key : self .view_buttons [key ].isChecked () for key in self ._keys }
222222
@@ -242,22 +242,22 @@ def on_views_clicked(self):
242242
243243 self .update_plot ()
244244
245- @QtCore .pyqtSlot (float )
245+ @QtCore .Slot (float )
246246 def on_wheel_scroll (self , direction ):
247247 if self .context_set ():
248248 self .shift_current_time (direction )
249249
250- @QtCore .pyqtSlot (float )
250+ @QtCore .Slot (float )
251251 def on_wheel_scroll_plus_control (self , direction ):
252252 if self .context_set ():
253253 self .change_displayed_channel_count (direction )
254254
255- @QtCore .pyqtSlot (float )
255+ @QtCore .Slot (float )
256256 def on_wheel_scroll_plus_shift (self , direction ):
257257 if self .context_set ():
258258 self .change_plot_range (direction )
259259
260- @QtCore .pyqtSlot (float )
260+ @QtCore .Slot (float )
261261 def on_wheel_scroll_plus_alt (self , direction ):
262262 if self .context_set ():
263263 self .change_plot_scaling (direction )
@@ -430,7 +430,7 @@ def change_sorting_status(self, status_dict):
430430 self .sorting_status = status_dict
431431 self .enable_view_buttons ()
432432
433- @QtCore .pyqtSlot ()
433+ @QtCore .Slot ()
434434 def enable_view_buttons (self ):
435435 self .raw_button .click ()
436436
@@ -474,11 +474,11 @@ def add_image_to_plot(self, raw_traces, level_min, level_max):
474474 self .colormap_image = image_item
475475 self .plot_item .addItem (image_item )
476476
477- @QtCore .pyqtSlot (object )
477+ @QtCore .Slot (object )
478478 def set_whitening_matrix (self , array ):
479479 self .whitening_matrix = array
480480
481- @QtCore .pyqtSlot (object )
481+ @QtCore .Slot (object )
482482 def set_highpass_filter (self , filter ):
483483 self .highpass_filter = filter
484484
@@ -579,10 +579,10 @@ def _update_colormap(
579579
580580
581581class KSPlotWidget (pg .PlotWidget ):
582- signalChangeTimePoint = QtCore .pyqtSignal (float )
583- signalChangeChannel = QtCore .pyqtSignal (float )
584- signalChangeTimeRange = QtCore .pyqtSignal (float )
585- signalChangeScaling = QtCore .pyqtSignal (float )
582+ signalChangeTimePoint = QtCore .Signal (float )
583+ signalChangeChannel = QtCore .Signal (float )
584+ signalChangeTimeRange = QtCore .Signal (float )
585+ signalChangeScaling = QtCore .Signal (float )
586586
587587 def __init__ (self , * args , ** kwargs ):
588588 super (KSPlotWidget , self ).__init__ (* args , ** kwargs )
0 commit comments