Reload specific tab PYQT5
Unsolved
General and Desktop
-
I've created a web browser with tabs on pyqt, i have a json with urls inside and the tabs are create dynamically, it work perfectly but i want to each tab reload it own url by itself every 10 seconds
here's my code
with open('impresores.json') as data_file: data = json.load(data_file) for value in data.values(): self.add_new_tab_with_reload(QUrl(value['URL']), label=value['TITULO']) def add_new_tab_with_reload(self, qurl=QtCore.QUrl(), label='Blank'): view = WebView() view.setUrl(qurl) index = self.tab_widget.addTab(view, label) self.tab_widget.setTabIcon(index, view.icon()) view.iconChanged.connect(lambda icon, view=view: self.tab_widget.update_icon(view, icon)) self.tab_widget.setCurrentWidget(view) self.tab_widget.tabCloseRequested.connect(self.close_current_tab)
-
Hi and welcome to devnet,
You can use a QTimer to reload all your tabs or if you want them to be independent, create one QTimer per tab.
-
Which approach do you want to use ?