Source Code (Use browser search to find items of interest.)
Class Index
kedit'UrlDlg (./kdeutils/kedit/urldlg.h:35)
class UrlDlg : public KDialogBase
{
Q_OBJECT
public:
UrlDlg( QWidget *parent = 0, const QString& caption = QString::null,
const QString& urltext = QString::null );
QString getText();
QLineEdit *lineedit;
private:
void focusInEvent(QFocusEvent *);
};
kedit'UrlDlg::UrlDlg() (./kdeutils/kedit/urldlg.cpp:39)
UrlDlg::UrlDlg( QWidget *parent, const QString& caption,
const QString& urltext)
: KDialogBase( parent, "urldialog", true, caption, Ok|Cancel, Ok, true )
{
QWidget *page = new QWidget( this );
setMainWidget(page);
QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );
QLabel *label = new QLabel( caption, page, "caption" );
topLayout->addWidget( label );
lineedit = new QLineEdit( urltext, page, "lineedit" );
lineedit->setMinimumWidth(fontMetrics().maxWidth()*20);
topLayout->addWidget( lineedit );
topLayout->addStretch(10);
topLayout->activate();
page->setMinimumSize( page->sizeHint() );
}
kedit'UrlDlg::focusInEvent() (./kdeutils/kedit/urldlg.cpp:60)
void UrlDlg::focusInEvent( QFocusEvent * )
{
lineedit->setFocus();
}
kedit'UrlDlg::getText() (./kdeutils/kedit/urldlg.cpp:65)
QString UrlDlg::getText()
{
return lineedit->text();
}
#if 0
#include <qframe.h>
#include <qlabel.h>
#include <qlayout.h>
#include <kbuttonbox.h>
#include <klocale.h>
#include "urldlg.h"
#include "urldlg.moc"
//#define klocale KApplication::kApplication()->getLocale()
kedit'UrlDlg::UrlDlg() (./kdeutils/kedit/urldlg.cpp:93)
UrlDlg::UrlDlg( QWidget *parent, const QString& caption,
const QString& urltext)
: QDialog( parent, "urldialog", TRUE )
{
const int OUTER_SEP = 6;
const int INNER_SEP = 6;
QVBoxLayout *topLayout = new QVBoxLayout(this,OUTER_SEP,INNER_SEP);
QLabel *label = new QLabel( caption, this, "caption" );
topLayout->addWidget( label );
lineedit = new QLineEdit( urltext, this, "lineedit" );
lineedit->setMinimumWidth(fontMetrics().maxWidth()*20);
topLayout->addWidget( lineedit );
topLayout->addStretch(10);
QFrame *hline = new QFrame( this );
hline->setFrameStyle( QFrame::Sunken | QFrame::HLine );
topLayout->addWidget( hline );
KButtonBox *buttonBox = new KButtonBox( this, KButtonBox::HORIZONTAL, 0,
INNER_SEP );
buttonBox->addStretch();
ok = buttonBox->addButton( i18n("&OK"), false );
cancel = buttonBox->addButton( i18n("&Cancel"), false );
buttonBox->layout();
ok ->setDefault( true );
connect( ok , SIGNAL(clicked()), SLOT(accept()) );
connect( cancel , SIGNAL(clicked()), SLOT(reject()) );
topLayout->addWidget( buttonBox );
topLayout->activate();
}
//
// This can be removed
//
kedit'UrlDlg::resizeEvent() (./kdeutils/kedit/urldlg.cpp:132)
void UrlDlg::resizeEvent(QResizeEvent *)
{
}
#if 0
UrlDlg::UrlDlg( QWidget *parent, const QString& caption, const QString& urltext)
: QDialog( parent, "urldialog", TRUE )
{
frame = new QGroupBox( caption, this );
lineedit = new QLineEdit( this );
lineedit->setText(urltext);
this->setFocusPolicy( QWidget::StrongFocus );
connect(lineedit, SIGNAL(returnPressed()), this, SLOT(accept()));
ok = new QPushButton(i18n("OK"), this );
cancel = new QPushButton(i18n("Cancel"), this );
connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
resize(375, 120);
}
void UrlDlg::resizeEvent(QResizeEvent *)
{
frame->setGeometry(5, 5, width() - 10, 80);
cancel->setGeometry(width() - 80, height() - 30, 70, 25);
ok->setGeometry(10, height() - 30, 70, 25);
lineedit->setGeometry(20, 35, width() - 40, 25);
}
#endif
void UrlDlg::focusInEvent( QFocusEvent *)
{
lineedit->setFocus();
}
QString UrlDlg::getText()
{
return lineedit->text();
}