コード例 #1
0
void DrillDownView::currentChanged(const QModelIndex &current, const QModelIndex &previous) {
    if ((current.isValid() && previous.isValid())
        && (current.parent() == previous || previous.parent() == current)) {
        setUpdatesEnabled(false);
        setRootIndex(currentIndex().parent());
        setCurrentIndex(currentIndex());
        executeDelayedItemsLayout();
        // Force the hiding/showing of scrollbars
        setVerticalScrollBarPolicy(verticalScrollBarPolicy());
        newView = QPixmap::grabWidget(viewport());
        setUpdatesEnabled(true);

        int length = qMax(oldView.width(), newView.width());
        lastPosition = (previous.parent() == current) ? length : 0;
        animation.setFrameRange(0, length);
        animation.stop();
        animation.setDirection(previous.parent() == current ? QTimeLine::Backward : QTimeLine::Forward);
        animation.start();
    } else {
        QListView::currentChanged(current, previous);
    }
}
コード例 #2
0
ファイル: qtscrollerfilter.cpp プロジェクト: nhinze/rhodes
 void hackedExecuteDelayedItemsLayout()
 {
     executeDelayedItemsLayout();
 }