E5Gui/E5ModelToolBar.py

changeset 635
ab9f99806cf8
parent 482
4650a72c307a
child 791
9ec2ac20e54e
equal deleted inserted replaced
634:7b84cbd2f752 635:ab9f99806cf8
99 99
100 self.clear() 100 self.clear()
101 101
102 for i in range(self.__model.rowCount(self.__root)): 102 for i in range(self.__model.rowCount(self.__root)):
103 idx = self.__model.index(i, 0, self.__root) 103 idx = self.__model.index(i, 0, self.__root)
104 v = idx
105 104
106 title = idx.data(Qt.DisplayRole) 105 title = idx.data(Qt.DisplayRole)
107 icon = idx.data(Qt.DecorationRole) 106 icon = idx.data(Qt.DecorationRole)
108 if icon == NotImplemented or icon is None: 107 if icon == NotImplemented or icon is None:
109 icon = QIcon() 108 icon = QIcon()
110 folder = self.__model.hasChildren(idx) 109 folder = self.__model.hasChildren(idx)
111 110
112 act = self.addAction(icon, title) 111 act = self.addAction(icon, title)
113 act.setData(v) 112 act.setData(idx)
114 113
115 button = self.widgetForAction(act) 114 button = self.widgetForAction(act)
116 button.installEventFilter(self) 115 button.installEventFilter(self)
117 116
118 if folder: 117 if folder:

eric ide

mercurial