20 #include "qdirlineedit.h"
22 #include <tqlineedit.h>
24 #include <kpushbutton.h>
25 #include <tdefiledialog.h>
26 #include <kiconloader.h>
28 QDirLineEdit::QDirLineEdit(
bool file, TQWidget *parent,
const char *name)
29 : TQWidget(parent, name)
31 edit_ =
new TQLineEdit(
this);
32 button_ =
new KPushButton(
this);
33 button_->setPixmap(SmallIcon(
"document-open"));
34 connect(button_,TQ_SIGNAL(clicked()),TQ_SLOT(buttonClicked()));
36 TQHBoxLayout *main_ =
new TQHBoxLayout(
this, 0, 3);
37 main_->addWidget(edit_);
38 main_->addWidget(button_);
43 QDirLineEdit::~QDirLineEdit()
47 void QDirLineEdit::setURL(
const TQString& txt)
52 TQString QDirLineEdit::url()
57 void QDirLineEdit::buttonClicked()
61 dirname = KFileDialog::getExistingDirectory(edit_->text(),
this);
63 dirname = KFileDialog::getOpenFileName(edit_->text(), TQString::null,
this);
64 if (!dirname.isEmpty())
65 edit_->setText(dirname);
68 void QDirLineEdit::setFileEdit(
bool on)
73 #include "qdirlineedit.moc"