src/gui/itemviews/qtableview.cpp
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 19 fcece45ef507
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   112                 break;
   112                 break;
   113             --it_y;
   113             --it_y;
   114         }
   114         }
   115     } else if (old_height > span->height()) {
   115     } else if (old_height > span->height()) {
   116         //remove the span from all the subspans lists that intersect the columns not covered anymore
   116         //remove the span from all the subspans lists that intersect the columns not covered anymore
   117         Index::iterator it_y = index.lowerBound(qMin(-span->bottom(), 0));
   117         Index::iterator it_y = index.lowerBound(-span->bottom());
       
   118         if (it_y == index.end())
       
   119             it_y = index.find(-span->top());    // This is the only span remaining and we are deleting it.
   118         Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
   120         Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
   119         while (-it_y.key() <= span->top() + old_height -1) {
   121         while (-it_y.key() <= span->top() + old_height -1) {
   120             if (-it_y.key() > span->bottom()) {
   122             if (-it_y.key() > span->bottom()) {
   121                 (*it_y).remove(-span->left());
   123                 (*it_y).remove(-span->left());
   122                 if (it_y->isEmpty()) {
   124                 if (it_y->isEmpty()) {
  2357 /*!
  2359 /*!
  2358     \since 4.2
  2360     \since 4.2
  2359     \property QTableView::sortingEnabled
  2361     \property QTableView::sortingEnabled
  2360     \brief whether sorting is enabled
  2362     \brief whether sorting is enabled
  2361 
  2363 
  2362     If this property is true, sorting is enabled for the table; if the
  2364     If this property is true, sorting is enabled for the table.  If
  2363     property is false, sorting is not enabled. The default value is false.
  2365     this property is false, sorting is not enabled. The default value
       
  2366     is false.
       
  2367 
       
  2368     \note. Setting the property to true with setSortingEnabled()
       
  2369     immediately triggers a call to sortByColumn() with the current
       
  2370     sort section and order.
  2364 
  2371 
  2365     \sa sortByColumn()
  2372     \sa sortByColumn()
  2366 */
  2373 */
  2367 
  2374 
       
  2375 /*!
       
  2376   If \a enabled true enables sorting for the table and immediately
       
  2377   trigger a call to sortByColumn() with the current sort section and
       
  2378   order
       
  2379  */
  2368 void QTableView::setSortingEnabled(bool enable)
  2380 void QTableView::setSortingEnabled(bool enable)
  2369 {
  2381 {
  2370     Q_D(QTableView);
  2382     Q_D(QTableView);
  2371     d->sortingEnabled = enable;
  2383     d->sortingEnabled = enable;
  2372     horizontalHeader()->setSortIndicatorShown(enable);
  2384     horizontalHeader()->setSortIndicatorShown(enable);