~ubuntu-branches/ubuntu/lucid/qt4-x11/lucid

« back to all changes in this revision

Viewing changes to src/gui/itemviews/qtreeview.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Jonathan Riddell, Alessandro Ghersi
  • Date: 2010-02-25 02:23:43 UTC
  • mfrom: (1.1.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20100225022343-qy63knnsv86fi6tc
Tags: 4:4.6.2-0ubuntu1
[ Jonathan Riddell ]
* New upstream release
* Update kubuntu_07_phonon_4.3.80.diff
* Update 05_append_qt4_target.diff

[ Alessandro Ghersi ]
* Update patches:
  - 0180-window-role.diff
  - 15_fix_qmake_makefile_generation.diff
  - 18_enable_qt3support_qtwebkit_debug_info.diff
  - 81_hurd_architecture.diff
  - 82_hurd_SA_SIGINFO.diff
  - 96_powerpc_no_gc_sections.diff
* Sync 92_armel_gcc43_valist_compat.diff with Debian
* Add kubuntu_11_fix_main_window_without_central_widget.diff (LP: #515132)
  (backport from Qt 4.6.3)
* In libqt4-dbg add conflicts with qt-x11-free-dbg (LP: #517263)
* qt4-dev-tools replaces libqt4-core (<= 4.5.3really4.5.2-0ubuntu1)
  (LP: #527534)
* Sync manpages/qdbus.1 with Debian
  - Update libqt4-dev.manpages
* qt4-dev-tools conflicts with qt3-dev-tools-embedded
* qt4-dev-tools suggests qt4-doc-html
* Update all symbol files
* Bump build dependency of debhelper and pkg-kde-tools to version 0.6.4 as it
  is needed to handle symbol files and build with pkgkde symbolshelper and
  parallel addon
* Call dh_auto_build instead of $(MAKE) for parallel build
* In override_dh_makeshlibs: do not FTBS if there are lost symbols
* Drop rules to generating libphonon4 symbols, no longer need

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
4
** All rights reserved.
5
5
** Contact: Nokia Corporation (qt-info@nokia.com)
6
6
**
178
178
*/
179
179
 
180
180
/*!
181
 
    Constructs a table view with a \a parent to represent a model's
 
181
    Constructs a tree view with a \a parent to represent a model's
182
182
    data. Use setModel() to set the model.
183
183
 
184
184
    \sa QAbstractItemModel
1241
1241
                viewport()->update(newRect);
1242
1242
            }
1243
1243
        }
1244
 
        if (selectionBehavior() == QAbstractItemView::SelectRows) {
1245
 
            QModelIndex newHoverIndex = indexAt(he->pos());
1246
 
            if (d->hover != newHoverIndex) {
1247
 
                QRect oldHoverRect = visualRect(d->hover);
1248
 
                QRect newHoverRect = visualRect(newHoverIndex);
1249
 
                viewport()->update(QRect(0, newHoverRect.y(), viewport()->width(), newHoverRect.height()));
1250
 
                viewport()->update(QRect(0, oldHoverRect.y(), viewport()->width(), oldHoverRect.height()));
1251
 
            }
1252
 
        }
1253
1244
        break; }
1254
1245
    default:
1255
1246
        break;
2644
2635
        return;
2645
2636
    SelectionMode mode = d->selectionMode;
2646
2637
    d->executePostedLayout(); //make sure we lay out the items
2647
 
    if (mode != SingleSelection && !d->viewItems.isEmpty())
2648
 
        d->select(d->viewItems.first().index, d->viewItems.last().index,
 
2638
    if (mode != SingleSelection && !d->viewItems.isEmpty()) {
 
2639
        const QModelIndex &idx = d->viewItems.last().index;
 
2640
        QModelIndex lastItemIndex = idx.sibling(idx.row(), d->model->columnCount(idx.parent()) - 1);
 
2641
        d->select(d->viewItems.first().index, lastItemIndex,
2649
2642
                  QItemSelectionModel::ClearAndSelect
2650
2643
                  |QItemSelectionModel::Rows);
 
2644
    }
2651
2645
}
2652
2646
 
2653
2647
/*!
3064
3058
{
3065
3059
    Q_Q(const QTreeView);
3066
3060
    QPixmap pixmap(rect.size());
 
3061
    if (rect.size().isEmpty())
 
3062
        return pixmap;
3067
3063
    pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels.
3068
3064
    QPainter painter(&pixmap);
3069
3065
    painter.fillRect(QRect(QPoint(0,0), rect.size()), q->palette().base());