Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/itemviews/qtreeview_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5656#include "private/qabstractitemview_p.h"
    5757#include <QtCore/qvariantanimation.h>
     58#include <QtCore/qabstractitemmodel.h>
    5859
    5960#ifndef QT_NO_TREEVIEW
     
    6364struct QTreeViewItem
    6465{
    65     QTreeViewItem() : expanded(false), spanning(false), hasChildren(false),
     66    QTreeViewItem() : parentItem(-1), expanded(false), spanning(false), hasChildren(false),
    6667                      hasMoreSiblings(false), total(0), level(0), height(0) {}
    6768    QModelIndex index; // we remove items whenever the indexes are invalidated
     69    int parentItem; // parent item index in viewItems
    6870    uint expanded : 1;
    6971    uint spanning : 1;
     
    7577};
    7678
     79Q_DECLARE_TYPEINFO(QTreeViewItem, Q_MOVABLE_TYPE);
     80
    7781class QTreeViewPrivate : public QAbstractItemViewPrivate
    7882{
     
    8892          allColumnsShowFocus(false), current(0), spanning(false),
    8993          animationsEnabled(false), columnResizeTimerID(0),
    90           autoExpandDelay(-1), hoverBranch(-1), geometryRecursionBlock(false) {}
     94          autoExpandDelay(-1), hoverBranch(-1), geometryRecursionBlock(false), hasRemovedItems(false) {}
    9195
    9296    ~QTreeViewPrivate() {}
     
    124128    void _q_modelDestroyed();
    125129
    126     void layout(int item);
     130    void layout(int item, bool recusiveExpanding = false, bool afterIsUninitialized = false);
    127131
    128132    int pageUp(int item) const;
     
    137141    QModelIndex modelIndex(int i, int column = 0) const;
    138142
     143    void insertViewItems(int pos, int count, const QTreeViewItem &viewItem);
     144    void removeViewItems(int pos, int count);
     145#if 0
     146    bool checkViewItems() const;
     147#endif
     148
    139149    int firstVisibleItem(int *offset = 0) const;
    140150    int columnAt(int x) const;
    141151    bool hasVisibleChildren( const QModelIndex& parent) const;
    142152
    143     void relayout(const QModelIndex &parent);
    144153    bool expandOrCollapseItemAtPos(const QPoint &pos);
    145154
     
    156165
    157166    void updateChildCount(const int parentItem, const int delta);
    158     void rowsRemoved(const QModelIndex &parent,
    159                      int start, int end, bool before);
    160167
    161168    void paintAlternatingRowColors(QPainter *painter, QStyleOptionViewItemV4 *option, int y, int bottom) const;
     
    233240    // used for blocking recursion when calling setViewportMargins from updateGeometries
    234241    bool geometryRecursionBlock;
     242
     243    // If we should clean the set
     244    bool hasRemovedItems;
    235245};
    236246
Note: See TracChangeset for help on using the changeset viewer.