Пример #1
0
QString SGraphicStack::pop()
{
    SGraphicStackItem *item = p->list.last();
    QString str = item->text();

    p->list.removeLast();
    p->current_index = p->list.count()-1;
    p->layout->removeWidget( item );

    recheck();

    delete item;
    return str;
}
void TelegramDialogsModel::setTelegram(TelegramQml *tgo)
{
    if( p->telegram == tgo )
        return;

    if( p->telegram )
    {
        disconnect( p->telegram, SIGNAL(dialogsChanged(bool)), this, SLOT(dialogsChanged(bool)) );
        disconnect( p->telegram, SIGNAL(phoneNumberChanged()), this, SLOT(refreshDatabase()) );

        disconnect( p->telegram->userData(), SIGNAL(favoriteChanged(int)) , this, SLOT(userDataChanged()) );
        disconnect( p->telegram->userData(), SIGNAL(valueChanged(QString)), this, SLOT(userDataChanged()) );

        disconnect(p->telegram, SIGNAL(authLoggedInChanged()), this, SLOT(recheck()));
    }
Пример #3
0
void SGraphicStack::setCurrentIndex( int index , bool signal_on )
{
    if( p->current_index != -1 )
        p->list[ p->current_index ]->setChecked( false );

    p->current_index = index;
    recheck();

    if( !signal_on )
        return ;

    emit currentIndexChanged( p->current_index );
    if( p->current_index != -1 )
        emit currentChanged( p->list.at( p->current_index )->text() );
}
Пример #4
0
void SGraphicStack::push( const QIcon & icon , const QString & str )
{
    SGraphicStackItem *item = new SGraphicStackItem( str );
        item->setIcon( icon );

    p->layout->addWidget( item );
    p->list << item;

    if( p->current_index != -1 )
        p->list[ p->current_index ]->setChecked( false );

    p->current_index = p->list.count()-1;
    recheck();

    connect( item , SIGNAL(clicked(SGraphicStackItem*)) , SLOT(clicked(SGraphicStackItem*)) );
}