コード例 #1
0
int QAbstractItemModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: dataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 1: headerDataChanged((*reinterpret_cast< Qt::Orientation(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 2: layoutChanged(); break;
        case 3: layoutAboutToBeChanged(); break;
        case 4: rowsAboutToBeInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 5: rowsInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 6: rowsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 7: rowsRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 8: columnsAboutToBeInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 9: columnsInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 10: columnsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 11: columnsRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 12: modelAboutToBeReset(); break;
        case 13: modelReset(); break;
        case 14: rowsAboutToBeMoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QModelIndex(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break;
        case 15: rowsMoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QModelIndex(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break;
        case 16: columnsAboutToBeMoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QModelIndex(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break;
        case 17: columnsMoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< const QModelIndex(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break;
        case 18: { bool _r = submit();
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 19: revert(); break;
        default: ;
        }
        _id -= 20;
    }
    return _id;
}
コード例 #2
0
ファイル: mediatablemodel.cpp プロジェクト: renegarcia/musik
MediaTableModel::MediaTableModel( QObject *parent, CorePlaylist *core )
        : QAbstractItemModel( parent )
{
    this->core = core;
    keys << "tracknr" << "title" << "album" << "artist" << "duration"
            << "timesplayed";
    headers << "Track" << "Title" << "Album" << "Artist" << "Duration"
            << "Times played";

    connect ( core, SIGNAL(positionChanged(int)), this,
              SLOT( updatePosition( int ) ) );

    connect ( core, SIGNAL(dataChanged(int,QString)), this,
              SLOT( updateData( int, QString )) );

    connect ( core, SIGNAL(rowsAboutToBeInserted(int,int)),
              this, SLOT(plRowsAboutToBeInserted(int,int)));

    connect ( core, SIGNAL(rowsInserted()),
              this, SLOT( plRowsInserted() ));

    connect ( core, SIGNAL(rowsAboutToBeRemoved(int,int)),
              this, SLOT(plRowsAboutToBeRemoved(int,int)));

    connect ( core, SIGNAL(rowsRemoved()),
              this, SLOT(plRowsRemoved())) ;

    QList < QString > coreKeys( keys );
    coreKeys << "picture_front" << "id";
    core->setKeys( coreKeys );
}
コード例 #3
0
ファイル: entity-view.cpp プロジェクト: KDE/ktp-text-ui
void EntityView::setModel(QAbstractItemModel *model)
{
    QTreeView::setModel(model);

    //check if any existing items contain the selected contact
    if (model->rowCount() > 0) {
        rowsInserted(QModelIndex(), 0, model->rowCount() -1);
    }
}
コード例 #4
0
ファイル: baskettree.cpp プロジェクト: Johjo/Noterex
void BasketTree::s_addBasket() {
    QModelIndex index = selectionModel()->currentIndex();

    Basket basket(database);
    basket.setTitle("new");
    basket.setParentId(index.internalId());
    basket.save();

    emit rowsInserted(index, index.row(), index.row());

}
コード例 #5
0
void
RecentStationsWidget::setModel(QAbstractItemModel* model)
{
    if (m_list->model()) {
        disconnect(m_list->model(), 0, this, 0);
    }
    m_list->setModel(model);
    connect(model, SIGNAL(modelReset()), SLOT(recalcMoreButton()));
    connect(model, SIGNAL(rowsRemoved()), SLOT(recalcMoreButton()));
    connect(model, SIGNAL(rowsInserted()), SLOT(recalcMoreButton()));
}
コード例 #6
0
ファイル: dlistviewex_moc.cpp プロジェクト: vasyaod/dChat
int dListViewEx::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QListView::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: rowsAboutToBeRemoved(*(QModelIndex*)_a[1],*(int*)_a[2],*(int*)_a[3]); break;
        case 1: rowsInserted(*(QModelIndex*)_a[1],*(int*)_a[2],*(int*)_a[3]); break;
        case 2: dataChanged(*(QModelIndex*)_a[1],*(QModelIndex*)_a[2]); break;
        case 3: currentChanged(*(QModelIndex*)_a[1],*(QModelIndex*)_a[2]); break;
        }
        _id -= 4;
    }
    return _id;
}
コード例 #7
0
void ModelSelector::setWatch(bool watch)
{
    if (!m_model) {
        return;
    }

    disconnect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
               this, SLOT(rowsInserted(QModelIndex,int,int)));
    if (watch) {
        Q_ASSERT(m_model);
        connect(m_model, SIGNAL(rowsInserted(QModelIndex,int,int)),
                SLOT(rowsInserted(QModelIndex,int,int)));
        if (m_model->hasChildren()) {
            rowsInserted(QModelIndex(), 0, m_model->rowCount() - 1);
        }
    }
}
コード例 #8
0
int QtTableModelInterface::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: cellsChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< int(*)>(_a[4])),(*reinterpret_cast< const QList<QByteArray>(*)>(_a[5]))); break;
        case 1: rowsInserted((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 2: rowsRemoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 3: rowsMoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 4: columnsInserted((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 5: columnsRemoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break;
        case 6: columnsMoved((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
コード例 #9
0
ファイル: referenceddata.cpp プロジェクト: winterz/FatCRM
void ReferencedData::setReferencedData(const QString &id, const QString &data)
{
    if (id.isEmpty()) {
        return;
    }

    KeyValueVector::iterator findIt = d->mVector.binaryFind(id);
    if (findIt != d->mVector.end()) {
        if (data != findIt->value) {
            findIt->value = data;
            emit dataChanged(findIt - d->mVector.begin());
        }
    } else {
        findIt = qLowerBound(d->mVector.begin(), d->mVector.end(), KeyValue(id), KeyValue::lessThan);
        const int row = findIt - d->mVector.begin();
        emit rowsAboutToBeInserted(row, row);
        d->mVector.insert(findIt, KeyValue(id, data));
        emit rowsInserted();
    }
}
コード例 #10
0
void ModelSelector::rowsInserted(const QModelIndex &parent, int start, int end)
{
    Q_ASSERT(end >= start);
    Q_ASSERT(m_selectionModel);

    int row = start;
    static const int column = 0;
    QModelIndex idx = m_model->index(row, column, parent);

    while (idx.isValid() && row <= end) {
        int item = idx.data().toInt();
        if (m_selectedRows.contains(item)) {
            m_selectionModel->select(idx, QItemSelectionModel::SelectCurrent);
        }
        if (m_model->hasChildren(idx)) {
            rowsInserted(idx, 0, m_model->rowCount(idx) - 1);
        }
        idx = idx.sibling(++row, column);
    }
}
コード例 #11
0
void McaPanelManager::initialize(const QString& managerData)
{
    m_panelName = managerData;

    // proxy model should be empty, but seem to need to call rowCount to wake it up
    rowsInserted(QModelIndex(), 0, m_serviceProxy->rowCount() - 1);
    feedRowsChanged();

    connect(m_serviceProxy, SIGNAL(rowsInserted(QModelIndex,int,int)),
            this, SLOT(rowsInserted(QModelIndex,int,int)));
    connect(m_serviceProxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
            this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
    connect(m_serviceProxy, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
            this, SLOT(dataChanged(QModelIndex,QModelIndex)));
    connect(m_serviceProxy, SIGNAL(categoriesChanged(QStringList)),
            this, SIGNAL(categoriesChanged(QStringList)));
    connect(m_feedProxy, SIGNAL(rowsInserted(QModelIndex,int,int)),
            this, SLOT(feedRowsChanged()));
    connect(m_feedProxy, SIGNAL(rowsRemoved(QModelIndex,int,int)),
            this, SLOT(feedRowsChanged()));
}
コード例 #12
0
ファイル: referenceddata.cpp プロジェクト: winterz/FatCRM
void ReferencedData::addMap(const QMap<QString, QString> &idDataMap)
{
    QMap<QString, QString>::const_iterator it = idDataMap.constBegin();
    const QMap<QString, QString>::const_iterator end = idDataMap.constEnd();
    if (d->mVector.isEmpty()) {
        d->mVector.reserve(idDataMap.count());
        // The vector is currently empty -> fast path
        // The map is already sorted, we can just copy right away
        // and emit the signals only once, which is the whole point of this method.
        emit rowsAboutToBeInserted(0, idDataMap.count() - 1);
        for ( ; it != end ; ++it) {
            d->mVector.append(KeyValue(it.key(), it.value()));
        }
        emit rowsInserted();
    } else {
        // Append to existing data -> slower code path
        for ( ; it != end ; ++it) {
            setReferencedData(it.key(), it.value());
        }
    }
}
コード例 #13
0
int QAbstractItemView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QAbstractScrollArea::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: pressed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 1: clicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 2: doubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 3: activated((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 4: entered((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 5: viewportEntered(); break;
        case 6: reset(); break;
        case 7: setRootIndex((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 8: doItemsLayout(); break;
        case 9: selectAll(); break;
        case 10: edit((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 11: clearSelection(); break;
        case 12: setCurrentIndex((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 13: scrollToTop(); break;
        case 14: scrollToBottom(); break;
        case 15: update((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 16: dataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 17: rowsInserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 18: rowsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 19: selectionChanged((*reinterpret_cast< const QItemSelection(*)>(_a[1])),(*reinterpret_cast< const QItemSelection(*)>(_a[2]))); break;
        case 20: currentChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break;
        case 21: updateEditorData(); break;
        case 22: updateEditorGeometries(); break;
        case 23: updateGeometries(); break;
        case 24: verticalScrollbarAction((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 25: horizontalScrollbarAction((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 26: verticalScrollbarValueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 27: horizontalScrollbarValueChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 28: closeEditor((*reinterpret_cast< QWidget*(*)>(_a[1])),(*reinterpret_cast< QAbstractItemDelegate::EndEditHint(*)>(_a[2]))); break;
        case 29: commitData((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
        case 30: editorDestroyed((*reinterpret_cast< QObject*(*)>(_a[1]))); break;
        case 31: d_func()->_q_columnsAboutToBeRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 32: d_func()->_q_columnsRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 33: d_func()->_q_rowsRemoved((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break;
        case 34: d_func()->_q_modelDestroyed(); break;
        case 35: d_func()->_q_layoutChanged(); break;
        case 36: d_func()->_q_fetchMore(); break;
        }
        _id -= 37;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< bool*>(_v) = hasAutoScroll(); break;
        case 1: *reinterpret_cast< int*>(_v) = autoScrollMargin(); break;
        case 2: *reinterpret_cast<int*>(_v) = QFlag(editTriggers()); break;
        case 3: *reinterpret_cast< bool*>(_v) = tabKeyNavigation(); break;
        case 4: *reinterpret_cast< bool*>(_v) = showDropIndicator(); break;
        case 5: *reinterpret_cast< bool*>(_v) = dragEnabled(); break;
        case 6: *reinterpret_cast< bool*>(_v) = dragDropOverwriteMode(); break;
        case 7: *reinterpret_cast< DragDropMode*>(_v) = dragDropMode(); break;
        case 8: *reinterpret_cast< bool*>(_v) = alternatingRowColors(); break;
        case 9: *reinterpret_cast< SelectionMode*>(_v) = selectionMode(); break;
        case 10: *reinterpret_cast< SelectionBehavior*>(_v) = selectionBehavior(); break;
        case 11: *reinterpret_cast< QSize*>(_v) = iconSize(); break;
        case 12: *reinterpret_cast< Qt::TextElideMode*>(_v) = textElideMode(); break;
        case 13: *reinterpret_cast< ScrollMode*>(_v) = verticalScrollMode(); break;
        case 14: *reinterpret_cast< ScrollMode*>(_v) = horizontalScrollMode(); break;
        }
        _id -= 15;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setAutoScroll(*reinterpret_cast< bool*>(_v)); break;
        case 1: setAutoScrollMargin(*reinterpret_cast< int*>(_v)); break;
        case 2: setEditTriggers(QFlag(*reinterpret_cast<int*>(_v))); break;
        case 3: setTabKeyNavigation(*reinterpret_cast< bool*>(_v)); break;
        case 4: setDropIndicatorShown(*reinterpret_cast< bool*>(_v)); break;
        case 5: setDragEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 6: setDragDropOverwriteMode(*reinterpret_cast< bool*>(_v)); break;
        case 7: setDragDropMode(*reinterpret_cast< DragDropMode*>(_v)); break;
        case 8: setAlternatingRowColors(*reinterpret_cast< bool*>(_v)); break;
        case 9: setSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break;
        case 10: setSelectionBehavior(*reinterpret_cast< SelectionBehavior*>(_v)); break;
        case 11: setIconSize(*reinterpret_cast< QSize*>(_v)); break;
        case 12: setTextElideMode(*reinterpret_cast< Qt::TextElideMode*>(_v)); break;
        case 13: setVerticalScrollMode(*reinterpret_cast< ScrollMode*>(_v)); break;
        case 14: setHorizontalScrollMode(*reinterpret_cast< ScrollMode*>(_v)); break;
        }
        _id -= 15;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 15;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 15;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 15;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 15;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 15;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 15;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
コード例 #14
0
ファイル: WAbstractItemModel.C プロジェクト: bvanhauwaert/wt
void WAbstractItemModel::endInsertRows()
{
  rowsInserted().emit(parent_, first_, last_);
}
コード例 #15
0
 inline void tst_rowsInserted(const QModelIndex &parent, int start, int end)
     { rowsInserted(parent, start, end); }
コード例 #16
0
ファイル: chatscene.cpp プロジェクト: ginggs/quassel2go
ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal width, ChatView *parent)
  : QGraphicsScene(0, 0, width, 0, (QObject *)parent),
    _chatView(parent),
    _idString(idString),
    _model(model),
    _singleBufferId(BufferId()),
    _sceneRect(0, 0, width, 0),
    _firstLineRow(-1),
    _viewportHeight(0),
    _markerLine(new MarkerLineItem(width)),
    _markerLineVisible(false),
    _markerLineValid(false),
    _markerLineJumpPending(false),
    _cutoffMode(CutoffRight),
    _selectingItem(0),
    _selectionStart(-1),
    _isSelecting(false),
    _clickMode(NoClick),
    _clickHandled(true),
    _leftButtonPressed(false)
{
  MessageFilter *filter = qobject_cast<MessageFilter*>(model);
  if(filter && filter->isSingleBufferFilter()) {
    _singleBufferId = filter->singleBufferId();
  }

  addItem(_markerLine);
  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _markerLine, SLOT(sceneRectChanged(const QRectF &)));

  ChatViewSettings defaultSettings;
  int defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
  int defaultSecondColHandlePos = defaultSettings.value("SecondColumnHandlePos", 200).toInt();

  ChatViewSettings viewSettings(this);
  _firstColHandlePos = viewSettings.value("FirstColumnHandlePos", defaultFirstColHandlePos).toInt();
  _secondColHandlePos = viewSettings.value("SecondColumnHandlePos", defaultSecondColHandlePos).toInt();

  _firstColHandle = new ColumnHandleItem(QtUi::style()->firstColumnSeparator());
  addItem(_firstColHandle);
  _firstColHandle->setXPos(_firstColHandlePos);
  connect(_firstColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(firstHandlePositionChanged(qreal)));
  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _firstColHandle, SLOT(sceneRectChanged(const QRectF &)));

  _secondColHandle = new ColumnHandleItem(QtUi::style()->secondColumnSeparator());
  addItem(_secondColHandle);
  _secondColHandle->setXPos(_secondColHandlePos);
  connect(_secondColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(secondHandlePositionChanged(qreal)));

  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _secondColHandle, SLOT(sceneRectChanged(const QRectF &)));

  setHandleXLimits();

  if(model->rowCount() > 0)
    rowsInserted(QModelIndex(), 0, model->rowCount() - 1);

  connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
          this, SLOT(rowsInserted(const QModelIndex &, int, int)));
  connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
          this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int)));
  connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
          this, SLOT(rowsRemoved()));
  connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(dataChanged(QModelIndex, QModelIndex)));

#ifdef HAVE_WEBKIT
  webPreview.timer.setSingleShot(true);
  connect(&webPreview.timer, SIGNAL(timeout()), this, SLOT(webPreviewNextStep()));
#endif
  _showWebPreview = defaultSettings.showWebPreview();
  defaultSettings.notify("ShowWebPreview", this, SLOT(showWebPreviewChanged()));

  _clickTimer.setInterval(QApplication::doubleClickInterval());
  _clickTimer.setSingleShot(true);
  connect(&_clickTimer, SIGNAL(timeout()), SLOT(clickTimeout()));

  setItemIndexMethod(QGraphicsScene::NoIndex);
}
コード例 #17
0
void cMaterialItemView::setModel(QAbstractItemModel *model)
{
	QAbstractItemView::setModel(model);
	rowsInserted(QModelIndex(), 0, model->rowCount() - 1);
}