I am attempting to add a "Play/Pause" QPushButton for a tile morphing app. My issue is that this button should have two functions in itself (play/pause).

How would I go about adding the pause functionality? My current code has the play function working:

GLWidget.cpp
Qt Code:
  1. void GLWidget::s_play()
  2. {
  3. m_flagScale = 1;
  4. m_flagCentroid = 1;
  5. m_flagRotate = 1;
  6. }
To copy to clipboard, switch view to plain text mode 

MainWindow.cpp
Qt Code:
  1. connect(m_load, SIGNAL(clicked()), this, SLOT(s_loadTiles()));
  2. connect(m_scale, SIGNAL(stateChanged(int)), m_glwidget, SLOT(s_setScale(int)));
  3. connect(m_rotate, SIGNAL(stateChanged(int)), m_glwidget, SLOT(s_setRotate(int)));
  4. connect(m_centroid, SIGNAL(stateChanged(int)), m_glwidget, SLOT(s_setCentroid(int)));
  5. connect(m_play, SIGNAL(clicked()), m_glwidget, SLOT(s_play()));
To copy to clipboard, switch view to plain text mode 

Thank for the help in advance!