void TipDlg::showTipText() { ui_tip->setText( s_tipText[m_curTip] ); emit currentTip( m_curTip ); }
/*! * This slot changes the current tip to the previous one. In case the currently * displayed tip is the first one, function will make the last tip current. */ void QwwTipWidget::prevTip() { Q_D(QwwTipWidget); int r = currentTip(); int c = d->m_model->rowCount(); r = r==0 ? c-1 : r-1; setCurrentTip(r); }
/*! * This slot changes the current tip to the next one. In case the currently * displayed tip is the last one, function will make the first tip current. */ void QwwTipWidget::nextTip() { Q_D(QwwTipWidget); int r = currentTip(); int c = d->m_model->rowCount(); r = r==c-1 ? 0 : r+1; setCurrentTip(r); }
/*! * */ void QwwTipWidget::setCurrentTip(int v){ Q_D(QwwTipWidget); if(v>=d->m_model->rowCount()) v= d->m_model->rowCount()-1; if(v<0) v = 0; if(v==currentTip()) return; d->m_currentTip = d->m_model->index(v,0); d->showTip(); emit tipChanged(v); }