From kde-commits Wed Apr 30 22:29:30 2008 From: Thomas Thrainer Date: Wed, 30 Apr 2008 22:29:30 +0000 To: kde-commits Subject: KDE/kdepim/korganizer Message-Id: <1209594570.706591.18864.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120959457701657 SVN commit 802870 by thrainer: Make the todo view traversable using the Tab-Key (and Shift-Tab respectively) when editing items. M +1 -0 CMakeLists.txt M +0 -12 views/todoview/kotododelegates.cpp M +0 -3 views/todoview/kotododelegates.h M +6 -1 views/todoview/kotodomodel.cpp M +2 -2 views/todoview/kotodoview.cpp M +2 -2 views/todoview/kotodoview.h A views/todoview/kotodoviewview.cpp [License: GPL (v2+) (+Qt exception)] A views/todoview/kotodoviewview.h [License: GPL (v2+) (+Qt exception)] --- trunk/KDE/kdepim/korganizer/CMakeLists.txt #802869:802870 @@ -149,6 +149,7 @@ views/todoview/kotodomodel.cpp views/todoview/kotododelegates.cpp views/todoview/kotodoviewsortfilterproxymodel.cpp + views/todoview/kotodoviewview.cpp views/todoview/kotodoview.cpp views/todoview/kotodoviewquicksearch.cpp views/todoview/kcheckcombobox.cpp --- trunk/KDE/kdepim/korganizer/views/todoview/kotododelegates.cpp #802869:802870 @@ -434,16 +434,4 @@ return ret; } -QWidget *KOTodoDescriptionDelegate::createEditor( QWidget *parent, - const QStyleOptionViewItem &option, - const QModelIndex &index ) const -{ - if ( index.data( KOTodoModel::IsRichDescriptionRole ).toBool() ) { - // rich text can't be edited inline - return 0; - } else { - return QStyledItemDelegate::createEditor( parent, option, index ); - } -} - #include "kotododelegates.moc" --- trunk/KDE/kdepim/korganizer/views/todoview/kotododelegates.h #802869:802870 @@ -167,9 +167,6 @@ const QModelIndex &index ) const; QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const; - - QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index ) const; }; #endif --- trunk/KDE/kdepim/korganizer/views/todoview/kotodomodel.cpp #802869:802870 @@ -446,8 +446,13 @@ case PercentColumn: case DueDateColumn: case CategoriesColumn: + ret |= Qt::ItemIsEditable; + break; case DescriptionColumn: - ret |= Qt::ItemIsEditable; + if ( !todo->descriptionIsRich() ) { + ret |= Qt::ItemIsEditable; + } + break; } } --- trunk/KDE/kdepim/korganizer/views/todoview/kotodoview.cpp #802869:802870 @@ -29,6 +29,7 @@ #include "kotodoviewquicksearch.h" #include "kotodomodel.h" #include "kotodoviewsortfilterproxymodel.h" +#include "kotodoviewview.h" #include "kotododelegates.h" #include "koprefs.h" #include "koglobals.h" @@ -44,7 +45,6 @@ #include #include #include -#include #include #include @@ -69,7 +69,7 @@ connect( mQuickSearch, SIGNAL(searchCategoryChanged(const QStringList &)), mProxyModel, SLOT(setCategoryFilter(const QStringList &)) ); - mView = new QTreeView( this ); + mView = new KOTodoViewView( this ); mView->setModel( mProxyModel ); mView->setSortingEnabled( true ); --- trunk/KDE/kdepim/korganizer/views/todoview/kotodoview.h #802869:802870 @@ -45,11 +45,11 @@ class QMenu; class QContextMenuEvent; class QItemSelection; -class QTreeView; class QModelIndex; class QSortFilterProxyModel; class KOTodoModel; +class KOTodoViewView; class KOTodoCategoriesDelegate; class KOTodoViewQuickSearch; @@ -108,7 +108,7 @@ void unAllSubTodoSignal(); private: - QTreeView *mView; + KOTodoViewView *mView; KOTodoModel *mModel; QSortFilterProxyModel *mProxyModel; KOTodoCategoriesDelegate *mCategoriesDelegate;