3333from Orange .widgets .utils .sql import check_sql_input
3434from Orange .widgets .utils .state_summary import format_summary_details
3535from Orange .widgets .utils .colorpalettes import LimitedDiscretePalette
36- from Orange .widgets .utils .itemdelegates import DataDelegate
37-
36+ from Orange .widgets .utils .itemdelegates import DataDelegate , TableDataDelegate
3837
3938# Input slot for the Predictors channel
4039PredictorSlot = namedtuple (
@@ -708,14 +707,7 @@ def showEvent(self, event):
708707 QTimer .singleShot (0 , self ._update_splitter )
709708
710709
711- class DataItemDelegate (DataDelegate ):
712- def __init__ (
713- self , * args ,
714- roles = (Qt .DisplayRole , Qt .TextAlignmentRole , Qt .BackgroundRole ),
715- ** kwargs
716- ):
717- super ().__init__ (* args , roles = roles , ** kwargs )
718-
710+ class DataItemDelegate (TableDataDelegate ):
719711 def initStyleOption (self , option , index ):
720712 super ().initStyleOption (option , index )
721713 if self .parent ().selectionModel ().isSelected (index ):
@@ -728,6 +720,9 @@ class PredictionsItemDelegate(DataDelegate):
728720 """
729721 A Item Delegate for custom formatting of predictions/probabilities
730722 """
723+ #: Roles supplied by the `PredictionsModel`
724+ DefaultRoles = (Qt .DisplayRole , )
725+
731726 def __init__ (
732727 self , class_values , colors , shown_probabilities = (),
733728 target_format = None , parent = None ,
0 commit comments