Reputation: 11
i try reload an html file that i created with plotly with opening the app its loading but when i try to reload with a button my app stop working
class Window1(QWidget):
def __init__(self):
super().__init__()
self.setGeometry(700, 350, 400, 400)
self.setWindowTitle("Data Downloader")
self.UI()
# self.setWindowIcon(QtGui.QIcon("bs.jpg"))
def UI(self):
#self.plot_widget = QWebEngineView()
self.dldata = QPushButton("Start", self)
self.dldata.move(250, 25)
self.dldata.clicked.connect(self.chartshow)
self.browser = QWebEngineView(self)
self.browser.move(1, 100)
self.browser.setFixedWidth(400)
self.browser.setFixedHeight(400)
url = QUrl.fromLocalFile(r"\ht.html")
self.browser.load(url)
def chartshow(self):
while 1 :
self.browser.reload()
time.sleep(10)
def main():
app = QtWidgets.QApplication(sys.argv)
window = Window1()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
I think there is something about qwidget or qmain window but I don't know how to fix that!
Upvotes: 0
Views: 204