Exemple #1
0
void KKeyChooser::capturedShortcut(const KShortcut &cut)
{
    if(cut.isNull())
        slotNoKey();
    else
        setShortcut(cut);
}
Exemple #2
0
bool KCompletionBase::setKeyBinding( KeyBindingType item, const KShortcut& cut )
{
    if ( m_delegate )
        return m_delegate->setKeyBinding( item, cut );


    if( !cut.isNull() )
    {
        for( KeyBindingMap::Iterator it = m_keyMap.begin(); it != m_keyMap.end(); ++it )
            if( it.data() == cut )  return false;
    }
    m_keyMap.replace( item, cut );
    return true;
}
Exemple #3
0
void KAction::initPrivate( const QString& text, const KShortcut& cut,
                  const QObject* receiver, const char* slot )
{
    d->m_cutDefault = cut;

    m_parentCollection = dynamic_cast<KActionCollection *>( parent() );
    kdDebug(129) << "KAction::initPrivate(): this = " << this << " name = \"" << name() << "\" cut = " << cut.toStringInternal() << " m_parentCollection = " << m_parentCollection << endl;
    if ( m_parentCollection )
        m_parentCollection->insert( this );

    if ( receiver && slot )
        connect( this, SIGNAL( activated() ), receiver, slot );

    if( !cut.isNull() && !qstrcmp( name(), "unnamed" ) )
        kdWarning(129) << "KAction::initPrivate(): trying to assign a shortcut (" << cut.toStringInternal() << ") to an unnamed action." << endl;
    d->setText( text );
    initShortcut( cut );
}