PyQt - showing countdown timer
<p>I am trying to create a program, using PyQt, which currently consists of a stacked widget of 4 pages. A timer has been implemented, and after 3 seconds the page the user is currently on switches to the next page. I am currently trying to add a timer which shows the user how much time on that page they have left (ideally in seconds). However, I have no idea how to connect the timer to a counter, and have not been able to find anything which would be helpful. </p>

<p>Here is the current code, which is basically just the timer: </p>

<pre><code>import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from StackedWidget import *

app = QApplication(sys.argv)


window = QMainWindow()


ui = Ui_MainWindow()
ui.setupUi(window)


def NextTimer():
   ui.stackedWidget.setCurrentIndex((ui.stackedWidget.currentIndex() + 1))


myTimer = QTimer()
myTimer.timeout.connect(NextTimer)
myTimer.start(3000)
</code></pre>

<p>I am trying to connect the timer to a counter of the class QLCDNumber,labelled Counter. At the current point there is no code which involves this counter, it just exists. </p>

<p>Thank you for any help. </p>