Back to index

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

#include <kxscontrol.h>

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

List of all members.

Signals

void changed ()

Public Member Functions

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

Protected Slots

void slotActivated (int)

Protected Attributes

QComboBox * mCombo
QStringList mOptions
QStringList mSwitches
int mValue
QString mName
QString mLabel

Detailed Description

Definition at line 98 of file kxscontrol.h.


Constructor & Destructor Documentation

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

Definition at line 210 of file kxscontrol.cpp.

  : QWidget(parent), KXSSelectItem(name, config)
{
  QVBoxLayout *l = new QVBoxLayout(this);
  QLabel *label = new QLabel(mLabel, this);
  l->addWidget(label);
  mCombo = new QComboBox(this);
  for(int i=0; i < mOptions.count(); i++)
      mCombo->addItem( i18n(mOptions[i].toUtf8()) );
  mCombo->setCurrentIndex(mValue);
  connect(mCombo, SIGNAL(activated(int)), SLOT(slotActivated(int)));
  l->addWidget(mCombo);
}

Here is the call graph for this function:

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

Definition at line 225 of file kxscontrol.cpp.

  : QWidget(parent), KXSSelectItem(name, attr)
{
  QVBoxLayout *l = new QVBoxLayout(this);
  QString labelText = mLabel.isEmpty() ? QString():i18n(mLabel.toUtf8());
  QLabel *label = new QLabel(labelText, this);
  l->addWidget(label);
  mCombo = new QComboBox(this);
  connect(mCombo, SIGNAL(activated(int)), SLOT(slotActivated(int)));
  l->addWidget(mCombo);
}

Here is the call graph for this function:


Member Function Documentation

void KXSDropListControl::addOption ( const QXmlAttributes &  attr) [virtual]

Reimplemented from KXSSelectItem.

Definition at line 238 of file kxscontrol.cpp.

{
    KXSSelectItem::addOption( attr );
    mCombo->addItem( i18n(mOptions[mOptions.count()-1].toUtf8()) );
    if ( mValue == mOptions.count()-1 )
       mCombo->setCurrentIndex(mOptions.count()-1);
}
void KXSDropListControl::changed ( ) [signal]

Here is the caller graph for this function:

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

Implements KXSConfigItem.

Definition at line 192 of file kxsitem.cpp.

{
  QString tmp = mSwitches.at(mValue);
  return tmp;
}
void KXSDropListControl::read ( KConfig &  config) [virtual]

Reimplemented from KXSSelectItem.

Definition at line 252 of file kxscontrol.cpp.

{
    KXSSelectItem::read(config);
    mCombo->setCurrentIndex(mValue);
}
void KXSSelectItem::save ( KConfig &  config) [virtual, inherited]

Implements KXSConfigItem.

Definition at line 205 of file kxsitem.cpp.

{
  KConfigGroup grp = config.group(mName);
  grp.writeEntry("Value", mValue);
}
void KXSDropListControl::slotActivated ( int  indx) [protected, slot]

Definition at line 246 of file kxscontrol.cpp.

{
  mValue = indx;
  emit changed();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

QComboBox* KXSDropListControl::mCombo [protected]

Definition at line 116 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.

QStringList KXSSelectItem::mOptions [protected, inherited]

Definition at line 112 of file kxsitem.h.

QStringList KXSSelectItem::mSwitches [protected, inherited]

Definition at line 113 of file kxsitem.h.

int KXSSelectItem::mValue [protected, inherited]

Definition at line 114 of file kxsitem.h.


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