119 return WebBrowser.WebBrowserWindow.WebBrowserWindow.icon( |
119 return WebBrowser.WebBrowserWindow.WebBrowserWindow.icon( |
120 QUrl(itm.url)) |
120 QUrl(itm.url)) |
121 |
121 |
122 return None |
122 return None |
123 |
123 |
124 def columnCount(self, parent=QModelIndex()): |
124 def columnCount(self, parent=None): |
125 """ |
125 """ |
126 Public method to get the number of columns. |
126 Public method to get the number of columns. |
127 |
127 |
128 @param parent index of parent (QModelIndex) |
128 @param parent index of parent (QModelIndex) |
129 @return number of columns (integer) |
129 @return number of columns (integer) |
130 """ |
130 """ |
|
131 if parent is None: |
|
132 parent = QModelIndex() |
|
133 |
131 if parent.isValid(): |
134 if parent.isValid(): |
132 return 0 |
135 return 0 |
133 else: |
136 else: |
134 return len(self.__headers) |
137 return len(self.__headers) |
135 |
138 |
136 def rowCount(self, parent=QModelIndex()): |
139 def rowCount(self, parent=None): |
137 """ |
140 """ |
138 Public method to determine the number of rows. |
141 Public method to determine the number of rows. |
139 |
142 |
140 @param parent index of parent (QModelIndex) |
143 @param parent index of parent (QModelIndex) |
141 @return number of rows (integer) |
144 @return number of rows (integer) |
142 """ |
145 """ |
|
146 if parent is None: |
|
147 parent = QModelIndex() |
|
148 |
143 if parent.isValid(): |
149 if parent.isValid(): |
144 return 0 |
150 return 0 |
145 else: |
151 else: |
146 return len(self.__historyManager.history()) |
152 return len(self.__historyManager.history()) |
147 |
153 |
148 def removeRows(self, row, count, parent=QModelIndex()): |
154 def removeRows(self, row, count, parent=None): |
149 """ |
155 """ |
150 Public method to remove history entries from the model. |
156 Public method to remove history entries from the model. |
151 |
157 |
152 @param row row of the first history entry to remove (integer) |
158 @param row row of the first history entry to remove (integer) |
153 @param count number of history entries to remove (integer) |
159 @param count number of history entries to remove (integer) |
154 @param parent index of the parent entry (QModelIndex) |
160 @param parent index of the parent entry (QModelIndex) |
155 @return flag indicating successful removal (boolean) |
161 @return flag indicating successful removal (boolean) |
156 """ |
162 """ |
|
163 if parent is None: |
|
164 parent = QModelIndex() |
|
165 |
157 if parent.isValid(): |
166 if parent.isValid(): |
158 return False |
167 return False |
159 |
168 |
160 lastRow = row + count - 1 |
169 lastRow = row + count - 1 |
161 self.beginRemoveRows(parent, row, lastRow) |
170 self.beginRemoveRows(parent, row, lastRow) |