26#include <kurlrequester.h>
34URLEdit::URLEdit( Property *property, TQWidget *parent, const char *name)
37 TQHBoxLayout *l = new TQHBoxLayout( this, 0, 0);
38 m_edit = new KURLRequester( this);
39 m_edit->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
40 m_edit->setMinimumHeight(5);
43 setProperty(property);
45 connect(m_edit, TQ_SIGNAL(textChanged( const TQString&)), this, TQ_SLOT(slotValueChanged( const TQString&)));
46 m_edit->setSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
59URLEdit::setValue( const TQVariant &value, bool emitChange)
61 m_edit->blockSignals( true);
62 m_edit->setURL(value.toString());
63 m_edit->blockSignals( false);
65 emit valueChanged( this);
69URLEdit::slotValueChanged( const TQString&)
71 emit valueChanged( this);
75URLEdit::setProperty( Property *property)
79 switch(property-> type()) {
80 case DirectoryURL: mode = KFile::Directory|KFile::ExistingOnly; break;
83 m_edit->setMode(mode);
90URLEdit::setReadOnlyInternal( bool readOnly)
92 m_edit->lineEdit()->setReadOnly(readOnly);
93 m_edit->button()->setEnabled(!readOnly);
The base class representing a single property.
const char * name(StdAction id)
Namespace for a set of classes implementing generic properties framework.
@ DirectoryURL url of a directory
@ PictureFileURL url of a pixmap
|