What about something like this
Qt Code:
  1. void GLWidget::switch_play_state()
  2. {
  3. if (m_isPaused == false )
  4. this->s_pause(); // sets m_isPaused=true;
  5. else
  6. this->s_play(); // sets m_isPaused=false;
  7. }
  8.  
  9. //
  10.  
  11. connect(m_play, SIGNAL(clicked()), m_glwidget, SLOT(switch_play_state()));
To copy to clipboard, switch view to plain text mode