X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=34266321261c1d12d764973ba16db21c11edc5c5;hp=e0f80ed12b6caec2448c0acc026c46def328552b;hb=c19a8e707391d74a80e9e7d4ef46f496284d9f49;hpb=f6e0e4c958187792081b397795eb2ee7de294c23 diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index e0f80ed1..34266321 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -70,3 +70,8 @@ void BufferModel::mapProperty(int column, int role, QObject *target, const QByte QModelIndex BufferModel::currentIndex() { return propertyMapper()->selectionModel()->currentIndex(); } + +void BufferModel::setCurrentIndex(const QModelIndex &newCurrent) { + standardSelectionModel()->setCurrentIndex(newCurrent, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + standardSelectionModel()->select(newCurrent, QItemSelectionModel::ClearAndSelect); +}