-rw-r--r-- | libkdepim/categoryeditdialog.h | 24 | ||||
-rw-r--r-- | libkdepim/categoryselectdialog.cpp | 6 |
2 files changed, 28 insertions, 2 deletions
diff --git a/libkdepim/categoryeditdialog.h b/libkdepim/categoryeditdialog.h index 4ebc802..3e8ab45 100644 --- a/libkdepim/categoryeditdialog.h +++ b/libkdepim/categoryeditdialog.h @@ -26,2 +26,3 @@ #include <categoryeditdialog_base.h> +#include <qlistview.h> @@ -31,2 +32,25 @@ namespace KPIM { + class CategorySelectItem :public QObject, public QCheckListItem +{ + + Q_OBJECT + public: + + CategorySelectItem(QListView * parent, const QString & text, Type tt) : + QCheckListItem (parent, text, tt ) , QObject( parent ) + {;} + + signals: + void stateChanged( QListViewItem*); + + protected: + + virtual void stateChange(bool b) + { + QCheckListItem::stateChange(b); + emit stateChanged( this ); + } +}; + + class CategoryEditDialog : public CategoryEditDialog_base diff --git a/libkdepim/categoryselectdialog.cpp b/libkdepim/categoryselectdialog.cpp index 8038934..4d80726 100644 --- a/libkdepim/categoryselectdialog.cpp +++ b/libkdepim/categoryselectdialog.cpp @@ -56,3 +56,3 @@ CategorySelectDialog::CategorySelectDialog( KPimPrefs *prefs, QWidget* parent, connect( mSetColorCat, SIGNAL( clicked() ), this, SLOT( setColorCat() ) ); - connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + // connect( mCategories, SIGNAL( clicked(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); } @@ -75,3 +75,5 @@ void CategorySelectDialog::setCategories() it != mPrefs->mCustomCategories.end(); ++it ) { - new QCheckListItem(mCategories,*it,QCheckListItem::CheckBox); + CategorySelectItem * item = new CategorySelectItem(mCategories,*it,QCheckListItem::CheckBox); + QObject::connect( item, SIGNAL( stateChanged(QListViewItem *) ), this, SLOT( clicked(QListViewItem *) ) ); + } |