9 |
9 |
10 import contextlib |
10 import contextlib |
11 |
11 |
12 from PyQt6.QtCore import Qt, QAbstractTableModel, QModelIndex, QUrl |
12 from PyQt6.QtCore import Qt, QAbstractTableModel, QModelIndex, QUrl |
13 |
13 |
14 import WebBrowser.WebBrowserWindow |
14 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
15 |
15 |
16 |
16 |
17 class HistoryModel(QAbstractTableModel): |
17 class HistoryModel(QAbstractTableModel): |
18 """ |
18 """ |
19 Class implementing the history model. |
19 Class implementing the history model. |
117 elif index.column() == 1: |
117 elif index.column() == 1: |
118 return itm.url |
118 return itm.url |
119 elif index.column() == 2: |
119 elif index.column() == 2: |
120 return itm.visitCount |
120 return itm.visitCount |
121 elif role == Qt.ItemDataRole.DecorationRole and index.column() == 0: |
121 elif role == Qt.ItemDataRole.DecorationRole and index.column() == 0: |
122 return WebBrowser.WebBrowserWindow.WebBrowserWindow.icon(QUrl(itm.url)) |
122 return WebBrowserWindow.icon(QUrl(itm.url)) |
123 |
123 |
124 return None |
124 return None |
125 |
125 |
126 def columnCount(self, parent=None): |
126 def columnCount(self, parent=None): |
127 """ |
127 """ |