eric6/Preferences/ShortcutsDialog.py

branch
maintenance
changeset 8176
31965986ecd1
parent 8043
0acf98cd089a
parent 8143
2c730d5fd177
child 8273
698ae46f40a4
equal deleted inserted replaced
8153:e01ae92db699 8176:31965986ecd1
31 @signal updateShortcuts() emitted when the user pressed the dialogs OK 31 @signal updateShortcuts() emitted when the user pressed the dialogs OK
32 button 32 button
33 """ 33 """
34 updateShortcuts = pyqtSignal() 34 updateShortcuts = pyqtSignal()
35 35
36 objectNameRole = Qt.UserRole 36 objectNameRole = Qt.ItemDataRole.UserRole
37 noCheckRole = Qt.UserRole + 1 37 noCheckRole = Qt.ItemDataRole.UserRole + 1
38 objectTypeRole = Qt.UserRole + 2 38 objectTypeRole = Qt.ItemDataRole.UserRole + 2
39 39
40 def __init__(self, parent=None): 40 def __init__(self, parent=None):
41 """ 41 """
42 Constructor 42 Constructor
43 43
44 @param parent parent widget of this dialog 44 @param parent parent widget of this dialog
45 @type QWidget 45 @type QWidget
46 """ 46 """
47 super(ShortcutsDialog, self).__init__(parent) 47 super(ShortcutsDialog, self).__init__(parent)
48 self.setupUi(self) 48 self.setupUi(self)
49 self.setWindowFlags(Qt.Window) 49 self.setWindowFlags(Qt.WindowType.Window)
50 50
51 self.__helpViewer = None 51 self.__helpViewer = None
52 52
53 self.shortcutsList.headerItem().setText( 53 self.shortcutsList.headerItem().setText(
54 self.shortcutsList.columnCount(), "") 54 self.shortcutsList.columnCount(), "")
55 self.shortcutsList.header().setSortIndicator(0, Qt.AscendingOrder) 55 self.shortcutsList.header().setSortIndicator(
56 0, Qt.SortOrder.AscendingOrder)
56 57
57 from .ShortcutDialog import ShortcutDialog 58 from .ShortcutDialog import ShortcutDialog
58 self.shortcutDialog = ShortcutDialog() 59 self.shortcutDialog = ShortcutDialog()
59 self.shortcutDialog.shortcutChanged.connect(self.__shortcutChanged) 60 self.shortcutDialog.shortcutChanged.connect(self.__shortcutChanged)
60 61
69 def __resizeColumns(self): 70 def __resizeColumns(self):
70 """ 71 """
71 Private method to resize the list columns. 72 Private method to resize the list columns.
72 """ 73 """
73 self.shortcutsList.header().resizeSections( 74 self.shortcutsList.header().resizeSections(
74 QHeaderView.ResizeToContents) 75 QHeaderView.ResizeMode.ResizeToContents)
75 self.shortcutsList.header().setStretchLastSection(True) 76 self.shortcutsList.header().setStretchLastSection(True)
76 77
77 def __generateCategoryItem(self, title): 78 def __generateCategoryItem(self, title):
78 """ 79 """
79 Private method to generate a category item. 80 Private method to generate a category item.

eric ide

mercurial