Created attachment 53160 [details] Korganizer-SummaryTableWidget-Text-Align Version: unspecified (using Devel) OS: Linux See uploaded picture. Text Alignment for the Table Widget on the left Reproducible: Always
KDELIBS 4.5.3 ORganizer 4.4.7
commit e7a26ec0756ee5bdad9c040fc0aef9c6ee67e6f5 branch master Author: Sergio Martins <iamsergio@gmail.com> Date: Fri Dec 31 01:39:56 2010 +0000 Center these columns in to-do view: priority, recurs, percent and due date. They were already centered in the header. BUG: 256145 diff --git a/korganizer/views/todoview/kotodomodel.cpp b/korganizer/views/todoview/kotodomodel.cpp index 4d7b83f..64dafcb 100644 --- a/korganizer/views/todoview/kotodomodel.cpp +++ b/korganizer/views/todoview/kotodomodel.cpp @@ -776,6 +776,18 @@ QVariant KOTodoModel::data( const QModelIndex &index, int role ) const } } + if ( role == Qt::TextAlignmentRole ) { + switch ( index.column() ) { + // If you change this, change headerData() too. + case RecurColumn: + case PriorityColumn: + case PercentColumn: + case DueDateColumn: + return QVariant( Qt::AlignHCenter ); + } + return QVariant(); + } + return QVariant(); } @@ -812,9 +824,11 @@ QVariant KOTodoModel::headerData( int column, if ( role == Qt::TextAlignmentRole ) { switch ( column ) { + // If you change this, change data() too. case RecurColumn: case PriorityColumn: case PercentColumn: + case DueDateColumn: return QVariant( Qt::AlignHCenter ); } return QVariant();