X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fclient%2Fbuffermodel.cpp;h=34266321261c1d12d764973ba16db21c11edc5c5;hb=236e70030428e5b85309d6ddb97b772fa3efe61a;hp=e0f80ed12b6caec2448c0acc026c46def328552b;hpb=8010224cf5bfe5685dc2cf535e8dc1ec19c4c364;p=quassel.git 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); +}