[Cmake-commits] [cmake-commits] clinton committed QCMakeCacheView.cxx 1.41 1.42 QCMakeCacheView.h 1.23 1.24
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Aug 10 13:25:25 EDT 2009
Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv31905
Modified Files:
QCMakeCacheView.cxx QCMakeCacheView.h
Log Message:
ENH: Allow edit on single click. Fixes #9393. Also fix row heights to be consistent.
Index: QCMakeCacheView.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMakeCacheView.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -C 2 -d -r1.23 -r1.24
*** QCMakeCacheView.h 17 Jul 2009 18:38:36 -0000 1.23
--- QCMakeCacheView.h 10 Aug 2009 17:25:22 -0000 1.24
***************
*** 151,154 ****
--- 151,155 ----
bool eventFilter(QObject* object, QEvent* event);
void setModelData(QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const;
+ QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
QSet<QCMakeProperty> changes() const;
Index: QCMakeCacheView.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMakeCacheView.cxx,v
retrieving revision 1.41
retrieving revision 1.42
diff -C 2 -d -r1.41 -r1.42
*** QCMakeCacheView.cxx 17 Jul 2009 18:38:36 -0000 1.41
--- QCMakeCacheView.cxx 10 Aug 2009 17:25:22 -0000 1.42
***************
*** 25,28 ****
--- 25,29 ----
#include <QSortFilterProxyModel>
#include <QMetaProperty>
+ #include <QApplication>
#include "QCMakeWidgets.h"
***************
*** 140,147 ****
this->setItemDelegate(delegate);
! this->setEditTriggers(QAbstractItemView::DoubleClicked |
! QAbstractItemView::SelectedClicked |
! QAbstractItemView::EditKeyPressed |
! QAbstractItemView::AnyKeyPressed);
// tab, backtab doesn't step through items
--- 141,147 ----
this->setItemDelegate(delegate);
! this->setUniformRowHeights(true);
!
! this->setEditTriggers(QAbstractItemView::AllEditTriggers);
// tab, backtab doesn't step through items
***************
*** 665,668 ****
--- 665,681 ----
}
+ QSize QCMakeCacheModelDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
+ {
+ QSize sz = QItemDelegate::sizeHint(option, index);
+ QStyle *style = QApplication::style();
+
+ // increase to checkbox size
+ QStyleOptionButton opt;
+ opt.QStyleOption::operator=(option);
+ sz = sz.expandedTo(style->subElementRect(QStyle::SE_ViewItemCheckIndicator, &opt, NULL).size());
+
+ return sz;
+ }
+
QSet<QCMakeProperty> QCMakeCacheModelDelegate::changes() const
{
More information about the Cmake-commits
mailing list