Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Orange/widgets/data/owrank.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import numpy as np
from AnyQt.QtCore import (
QItemSelection, QItemSelectionModel, QItemSelectionRange, Qt
QItemSelection, QItemSelectionModel, QItemSelectionRange, Qt,
pyqtSignal as Signal
)
from AnyQt.QtGui import QFontMetrics
from AnyQt.QtWidgets import (
Expand Down Expand Up @@ -76,6 +77,8 @@ def from_variable(cls, variable):


class TableView(QTableView):
manualSelection = Signal()

def __init__(self, parent=None, **kwargs):
super().__init__(parent=parent,
selectionBehavior=QTableView.SelectRows,
Expand Down Expand Up @@ -105,6 +108,10 @@ def setVHeaderFixedWidthFromLabel(self, max_label):
width = QFontMetrics(header.font()).width(max_label)
header.setFixedWidth(min(width + 40, 400))

def mousePressEvent(self, event):
super().mousePressEvent(event)
self.manualSelection.emit()


class TableModel(PyTableModel):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -310,7 +317,7 @@ def __init__(self):
def _set_select_manual():
self.setSelectionMethod(OWRank.SelectManual)

view.pressed.connect(_set_select_manual)
view.manualSelection.connect(_set_select_manual)
view.verticalHeader().sectionClicked.connect(_set_select_manual)
view.horizontalHeader().sectionClicked.connect(self.headerClick)

Expand Down