Source Code (Use browser search to find items of interest.)

Class Index

khelpcenter'KFindTextDialog (./kdebase/khelpcenter/libkhc/khc_finddlg.h:28)

class KFindTextDialog : public QDialog
{
    Q_OBJECT

 public:
    KFindTextDialog( QWidget *parent = 0, const char *name = 0 );

    const QRegExp ®Exp() const { return rExp; }

 signals:
    /*
     * connect to me to find out when the user has pressed the find button.
     */
    void find( const QRegExp &re );

 public slots:
    void slotTextChanged( const QString& t );
    void slotCase( bool c );
    void slotClose();
    void slotFind();

 protected:
    QRegExp rExp;
};

khelpcenter'KFindTextDialog::KFindTextDialog() (./kdebase/khelpcenter/libkhc/khc_finddlg.cc:33)

KFindTextDialog::KFindTextDialog( QWidget *parent, const char *name )
    : QDialog( parent, name )
{
    // mimimise initial size of dialog
    resize( 0, 0 );

    QVBoxLayout *vl = new QVBoxLayout( this, 10 );

    QHBoxLayout *hl = new QHBoxLayout;
    vl->addLayout( hl );

    QLabel *label = new QLabel( i18n( "Find:" ), this );
    label->setFixedSize( label->sizeHint() );
    hl->addWidget( label );

    QLineEdit *edit = new QLineEdit( this );
    edit->setFixedHeight( edit->sizeHint().height() );
    edit->setFocus();
    connect( edit, SIGNAL( textChanged( const QString & ) ),
	     SLOT( slotTextChanged( const QString & ) ) );
    hl->addWidget( edit );

    hl = new QHBoxLayout;
    vl->addLayout( hl );

    QCheckBox *cb = new QCheckBox( i18n( "Case &sensitive" ), this );
    connect( cb, SIGNAL( toggled( bool ) ), this, SLOT( slotCase( bool ) ) );
    cb->setFixedSize( cb->sizeHint() );
    hl->addWidget( cb );

    hl->addStretch();

    hl = new QHBoxLayout;
    vl->addLayout( hl );

    QPushButton *btn = new QPushButton( i18n( "&Find" ), this );
    btn->setFixedSize( btn->sizeHint() );
    btn->setDefault( true );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotFind() ) );
    hl->addWidget( btn );

    hl->addStretch();

    btn = new QPushButton( i18n( "&Close" ), this );
    btn->setFixedSize( btn->sizeHint() );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
    hl->addWidget( btn );

    vl->activate();
    
    setMinimumSize(sizeHint());

    rExp.setCaseSensitive( false );
}


khelpcenter'KFindTextDialog::slotTextChanged() (./kdebase/khelpcenter/libkhc/khc_finddlg.cc:88)

void KFindTextDialog::slotTextChanged( const QString &t )
{
    rExp = t;
}


khelpcenter'KFindTextDialog::slotCase() (./kdebase/khelpcenter/libkhc/khc_finddlg.cc:93)

void KFindTextDialog::slotCase( bool c )
{
    rExp.setCaseSensitive( c );
}


khelpcenter'KFindTextDialog::slotClose() (./kdebase/khelpcenter/libkhc/khc_finddlg.cc:98)

void KFindTextDialog::slotClose()
{
    hide();
}


khelpcenter'KFindTextDialog::slotFind() (./kdebase/khelpcenter/libkhc/khc_finddlg.cc:103)

void KFindTextDialog::slotFind()
{
    emit find( rExp );
}