105 userAgent = self.__manager.userAgent(host) |
105 userAgent = self.__manager.userAgent(host) |
106 |
106 |
107 if userAgent is None: |
107 if userAgent is None: |
108 return None |
108 return None |
109 |
109 |
110 if role == Qt.DisplayRole: |
110 if role == Qt.ItemDataRole.DisplayRole: |
111 if index.column() == 0: |
111 if index.column() == 0: |
112 return host |
112 return host |
113 elif index.column() == 1: |
113 elif index.column() == 1: |
114 return userAgent |
114 return userAgent |
115 |
115 |
116 return None |
116 return None |
117 |
117 |
118 def headerData(self, section, orientation, role=Qt.DisplayRole): |
118 def headerData(self, section, orientation, |
|
119 role=Qt.ItemDataRole.DisplayRole): |
119 """ |
120 """ |
120 Public method to get the header data. |
121 Public method to get the header data. |
121 |
122 |
122 @param section section number (integer) |
123 @param section section number (integer) |
123 @param orientation header orientation (Qt.Orientation) |
124 @param orientation header orientation (Qt.Orientation) |
124 @param role data role (integer) |
125 @param role data role (Qt.ItemDataRole) |
125 @return header data |
126 @return header data |
126 """ |
127 """ |
127 if orientation == Qt.Horizontal and role == Qt.DisplayRole: |
128 if ( |
|
129 orientation == Qt.Orientation.Horizontal and |
|
130 role == Qt.ItemDataRole.DisplayRole |
|
131 ): |
128 try: |
132 try: |
129 return self.__headers[section] |
133 return self.__headers[section] |
130 except IndexError: |
134 except IndexError: |
131 pass |
135 pass |
132 |
136 |