void PVImageListViewer::selectListViewItem(QModelIndex index) { if(index.isValid()) { QString path = index.data(IMAGEPATHROLE).toString(); if(m_curPicturePath != path) { m_curPicturePath = path; m_imagePathLabel->setText(m_curPicturePath); notifyAllObservers(); } } }
/* * This function sets the state and notify all observers * that state of subject had been changed * */ void GameModel::setState(GameState state) { m_state = state; notifyAllObservers(); }
/* * This function will initialize the Game Model by setting the * state to MAIN_MENU and also notifies all observers that * state has changed. * */ void GameModel::initGame() { m_state = MAIN_MENU; notifyAllObservers(); }