File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -76,19 +76,6 @@ def mousePressEvent(self, event):
7676 self .parent .set_large_image (self .index )
7777
7878
79- class ListWidget (QtWidgets .QListWidget ):
80- """
81- The list of files on the left-hand side
82- """
83- def __init__ (self , parent ):
84- super ().__init__ ()
85- self .parent = parent
86- self .currentRowChanged .connect (self .change_row )
87-
88- def change_row (self , i ):
89- self .parent .set_entry (i )
90-
91-
9279class EventFilter (QtCore .QObject ):
9380 # A hack keypresses can be handled globally and aren't swallowed
9481 # by the individual widgets
@@ -119,10 +106,12 @@ def __init__(self, entries):
119106 event_filter = EventFilter (self )
120107 self .installEventFilter (event_filter )
121108
122- self .filelist = ListWidget (self )
109+ # The list of files on the left-hand side.
110+ self .filelist = QtWidgets .QListWidget ()
123111 self .filelist .setMinimumWidth (400 )
124112 for entry in entries :
125113 self .filelist .addItem (entry .display )
114+ self .filelist .currentRowChanged .connect (self .set_entry )
126115
127116 thumbnails_box = QtWidgets .QWidget ()
128117 thumbnails_layout = QtWidgets .QVBoxLayout ()
You can’t perform that action at this time.
0 commit comments