projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed the scrollbar issue in the NickView
[quassel.git]
/
src
/
uisupport
/
nickview.cpp
diff --git
a/src/uisupport/nickview.cpp
b/src/uisupport/nickview.cpp
index
7d9545c
..
b3efda4
100644
(file)
--- a/
src/uisupport/nickview.cpp
+++ b/
src/uisupport/nickview.cpp
@@
-1,11
+1,11
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-0
7 by the Quassel IRC Team
*
+ * Copyright (C) 2005-0
8 by the Quassel Project
*
* devel@quassel-irc.org *
* *
* 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 *
* devel@quassel-irc.org *
* *
* 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 *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
@@
-19,15
+19,41
@@
***************************************************************************/
#include "nickview.h"
***************************************************************************/
#include "nickview.h"
+#include "nickmodel.h"
+
+#include <QHeaderView>
+#include <QDebug>
+
+NickView::NickView(QWidget *parent)
+ : QTreeView(parent)
+{
+ setIndentation(10);
+ setAnimated(true);
+ header()->hide();
+ setSortingEnabled(true);
+ sortByColumn(0, Qt::AscendingOrder);
+}
-NickView::NickView(QWidget *parent) : QTreeView(parent) {
+NickView::~NickView() {
+}
+void NickView::init() {
+ if(!model())
+ return;
+ for(int i = 1; i < model()->columnCount(); i++)
+ setColumnHidden(i, true);
+ expandAll();
}
}
-NickView::~NickView() {
-
+void NickView::setModel(QAbstractItemModel *model) {
+ QTreeView::setModel(model);
+ init();
+}
+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?
}
}