mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-03-20 06:11:39 +00:00
Modernized signal handling/emitting in result_window and results_model.
This commit is contained in:
@@ -6,13 +6,11 @@
|
||||
# which should be included with this package. The terms are also available at
|
||||
# http://www.hardcoded.net/licenses/bsd_license
|
||||
|
||||
from PyQt4.QtCore import SIGNAL, Qt, QSize
|
||||
from PyQt4.QtCore import Qt, pyqtSignal
|
||||
from PyQt4.QtGui import QBrush, QFont, QFontMetrics, QTableView, QColor
|
||||
|
||||
from qtlib.table import Table
|
||||
|
||||
from core.gui.result_table import ResultTable as ResultTableModel
|
||||
|
||||
class ResultsModel(Table):
|
||||
def __init__(self, app, view):
|
||||
model = app.model.result_table
|
||||
@@ -126,11 +124,13 @@ class ResultsView(QTableView):
|
||||
#--- Override
|
||||
def keyPressEvent(self, event):
|
||||
if event.text() == ' ':
|
||||
self.emit(SIGNAL('spacePressed()'))
|
||||
self.spacePressed.emit()
|
||||
return
|
||||
QTableView.keyPressEvent(self, event)
|
||||
|
||||
def mouseDoubleClickEvent(self, event):
|
||||
self.emit(SIGNAL('doubleClicked()'))
|
||||
self.doubleClicked.emit(None)
|
||||
# We don't call the superclass' method because the default behavior is to rename the cell.
|
||||
|
||||
#--- Signals
|
||||
spacePressed = pyqtSignal()
|
||||
|
||||
Reference in New Issue
Block a user