Back to index

kdeartwork  4.3.2
Signals | Public Member Functions | Protected Slots | Protected Attributes
KXSFileControl Class Reference

#include <kxscontrol.h>

Inheritance diagram for KXSFileControl:
Inheritance graph
[legend]
Collaboration diagram for KXSFileControl:
Collaboration graph
[legend]

List of all members.

Signals

void changed ()

Public Member Functions

 KXSFileControl (QWidget *parent, const QString &name, KConfig &config)
 KXSFileControl (QWidget *parent, const QString &name, const QXmlAttributes &attr)
virtual void read (KConfig &config)
virtual QString command ()
virtual void save (KConfig &config)

Protected Slots

void textChanged (const QString &)
void selectFile ()

Protected Attributes

QLineEdit * mEdit
QString mSwitch
QString mValue
QString mName
QString mLabel

Detailed Description

Definition at line 140 of file kxscontrol.h.


Constructor & Destructor Documentation

KXSFileControl::KXSFileControl ( QWidget *  parent,
const QString &  name,
KConfig &  config 
)

Definition at line 296 of file kxscontrol.cpp.

  : QWidget(parent), KXSStringItem(name, config)
{
  QVBoxLayout *l = new QVBoxLayout(this);
  QLabel *label = new QLabel(mLabel, this);
  l->addWidget(label);
  mEdit = new QLineEdit(this);
  connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &)));
  l->addWidget(mEdit);
}

Here is the call graph for this function:

KXSFileControl::KXSFileControl ( QWidget *  parent,
const QString &  name,
const QXmlAttributes &  attr 
)

Definition at line 308 of file kxscontrol.cpp.

  : QWidget(parent), KXSStringItem(name, attr)
{
  QVBoxLayout *l = new QVBoxLayout(this);
  QLabel *label = new QLabel(i18n(mLabel.toUtf8()), this);
  l->addWidget(label);
  QHBoxLayout *hb = new QHBoxLayout();
  l->addLayout(hb);
  mEdit = new QLineEdit(this);
  connect(mEdit, SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &)));
  hb->addWidget(mEdit);
  QPushButton *pb = new QPushButton( "...", this );
  connect( pb, SIGNAL(clicked()), this, SLOT(selectFile()) );
  hb->addWidget(pb);
}

Here is the call graph for this function:


Member Function Documentation

void KXSFileControl::changed ( ) [signal]

Here is the caller graph for this function:

QString KXSStringItem::command ( ) [virtual, inherited]

Implements KXSConfigItem.

Definition at line 237 of file kxsitem.cpp.

{
  if (!mValue.isEmpty())
      return mSwitch.arg(mValue);
  return "";
}
void KXSFileControl::read ( KConfig &  config) [virtual]

Reimplemented from KXSStringItem.

Definition at line 341 of file kxscontrol.cpp.

{
    KXSStringItem::read(config);
    mEdit->setText(mValue);
}
void KXSStringItem::save ( KConfig &  config) [virtual, inherited]

Implements KXSConfigItem.

Definition at line 251 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  grp.writeEntry("Value", mValue);
}
void KXSFileControl::selectFile ( ) [protected, slot]

Definition at line 331 of file kxscontrol.cpp.

{
    QString f = KFileDialog::getOpenFileName();
    if ( !f.isEmpty() ) {
       mValue = f;
       mEdit->setText(mValue);
       emit changed();
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void KXSFileControl::textChanged ( const QString &  text) [protected, slot]

Definition at line 325 of file kxscontrol.cpp.

{
    mValue = text;
    emit changed();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

QLineEdit* KXSFileControl::mEdit [protected]

Definition at line 157 of file kxscontrol.h.

QString KXSConfigItem::mLabel [protected, inherited]

Definition at line 43 of file kxsitem.h.

QString KXSConfigItem::mName [protected, inherited]

Definition at line 42 of file kxsitem.h.

QString KXSStringItem::mSwitch [protected, inherited]

Definition at line 128 of file kxsitem.h.

QString KXSStringItem::mValue [protected, inherited]

Definition at line 129 of file kxsitem.h.


The documentation for this class was generated from the following files: