X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnickview.cpp;h=5db46c80a8d059c6aa20b00eb7255b31c0bb6000;hp=26a345dfdfe3aa8b0a90113fb16f79f2f888cb5d;hb=d6b056e936ec441258d291b7a8af7b83f9f53016;hpb=e671e9da1edaab37ec403f575979f9a92a766e9a diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index 26a345df..5db46c80 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -5,7 +5,7 @@ * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -21,12 +21,22 @@ #include "nickview.h" #include "nickmodel.h" +#include +#include NickView::NickView(QWidget *parent) : QTreeView(parent) { setGeometry(0, 0, 30, 30); //setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setIndentation(10); + header()->hide(); + header()->hideSection(1); + setAnimated(true); + setSortingEnabled(true); + sortByColumn(0, Qt::AscendingOrder); + filteredModel = new FilteredNickModel(this); + QTreeView::setModel(filteredModel); } NickView::~NickView() { @@ -35,5 +45,12 @@ NickView::~NickView() { } void NickView::setModel(NickModel *model) { - QTreeView::setModel(model); + filteredModel->setSourceModel(model); + expandAll(); } + +void NickView::rowsInserted(const QModelIndex &index, int start, int end) { + QTreeView::rowsInserted(index, start, end); + expandAll(); // FIXME We need to do this more intelligently. Maybe a pimped TreeView? +} +