Skip to content

Commit

Permalink
Add timer.
Browse files Browse the repository at this point in the history
  • Loading branch information
adetaylor committed Jul 9, 2024
1 parent d12edee commit ec05404
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/browser/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Simple demo python web browser. Lacks all sorts of important features.

from PyQt6.QtWidgets import QApplication, QWidget, QMainWindow, QVBoxLayout, QHBoxLayout, QPushButton, QLabel, QLineEdit, QSizePolicy
from PyQt6.QtCore import QSettings, Qt, QPoint, QSize, QSocketNotifier
from PyQt6.QtCore import QSettings, Qt, QPoint, QSize, QSocketNotifier, QTimer
from PyQt6.QtGui import QFont, QMouseEvent, QPainter, QFontMetrics
import requests
import os
Expand Down Expand Up @@ -433,6 +433,13 @@ def signal_received():
window = Browser(initial_url)
window.show()

# Every 100 msec, check if we've been asked to reload -
# this is only relevant for exercise 4b and works around a bug
# in the GUI toolkit.
timer = QTimer()
timer.timeout.connect(lambda: None)
timer.start(100)

# The "event loop". An event is something like a click or the user
# typing something. Keep handling those events from the user until
# Exit is clicked or the window is closed. All of this happens
Expand Down

0 comments on commit ec05404

Please sign in to comment.