_selectionModelSynchronizer(this)
{
setSourceModel(parent);
+ if(QCoreApplication::instance()->arguments().contains("--debugbufferswitches")) {
+ connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
+ this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &)));
+ }
}
bool BufferModel::filterAcceptsRow(int sourceRow, const QModelIndex &parent) const {
}
void BufferModel::debug_currentChanged(QModelIndex current, QModelIndex previous) {
- qDebug() << "New current:" << current << "(previous:" << previous << ")";
-}
-
-void BufferModel::debug_selectionChanged(QItemSelection current , QItemSelection previous) {
- qDebug() << "new selection:" << current << "(previoius:" << previous << ")";
+ Q_UNUSED(previous);
+ qDebug() << "Switched current Buffer: " << current << current.data().toString() << "Buffer:" << current.data(NetworkModel::BufferIdRole).value<BufferId>();
}
private slots:
void debug_currentChanged(QModelIndex current, QModelIndex previous);
- void debug_selectionChanged(QItemSelection current , QItemSelection previous);
private:
SelectionModelSynchronizer _selectionModelSynchronizer;
void setConfig(BufferViewConfig *config);
inline BufferViewConfig *config() { return _config; }
-
+
public slots:
void setRootIndexForNetworkId(const NetworkId &networkId);
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
virtual void wheelEvent(QWheelEvent *);
virtual QSize sizeHint() const;
+ virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); }
private slots:
void joinChannel(const QModelIndex &index);