and that provides access to the nicks in that channel. We also have a NickListWidget, that
encapsulates a stack of NickViews (which are not-yet-fancy QTreeViews).
There are still some things missing, nicks are not sorted yet and the output will be improved
as well. But we can see nicks again, yay ;-)
src/qtui/identities.h
src/qtui/mainwin.cpp
src/qtui/mainwin.h
+src/qtui/nicklistwidget.cpp
+src/qtui/nicklistwidget.h
src/qtui/qtui.cpp
src/qtui/qtui.h
src/qtui/qtui.pri
#include "client.h"
#include "ircchannel.h"
+#include "nickmodel.h"
#include "util.h"
: QObject(parent),
_bufferInfo(bufferid),
_active(false),
- _ircChannel(0)
+ _ircChannel(0), _nickModel(0)
{
if(bufferid.buffer().isEmpty())
_type = StatusType;
else
_type = QueryType;
+ _nickModel = new NickModel(0, this);
/*
QSettings s;
s.beginGroup(QString("GUI/BufferStates/%1/%2").arg(netname).arg(bufname));
emit userInput(_bufferInfo, msg);
}
+NickModel *Buffer::nickModel() const {
+ return _nickModel;
+}
+
IrcChannel *Buffer::ircChannel() const {
return _ircChannel;
}
void Buffer::setIrcChannel(IrcChannel *ircchan) {
if(_ircChannel) {
disconnect(_ircChannel, 0, this, 0);
- // TODO: remove model etc
}
_ircChannel = ircchan;
if(_ircChannel) {
connect(_ircChannel, SIGNAL(destroyed()), this, SLOT(setIrcChannel()));
}
+ _nickModel->setIrcChannel(ircChannel());
}
// no longer needed
class AbstractUiMsg;
class IrcChannel;
+class NickModel;
struct BufferState;
* \returns A pointer to the associated IrcChannel object, if the buffer is a channel and online; 0 else.
*/
IrcChannel *ircChannel() const;
+ NickModel *nickModel() const;
signals:
void userInput(const BufferInfo &, QString);
bool _active;
Type _type;
BufferState *state;
- IrcChannel *_ircChannel;
+ QPointer<IrcChannel> _ircChannel;
+ QPointer<NickModel> _nickModel;
QList<Message> layoutQueue;
QList<AbstractUiMsg *> layoutedMsgs;
#include "nickmodel.h"
#include "ircchannel.h"
+#include "ircuser.h"
+#include <QDebug>
-NickModel::NickModel(IrcChannel *channel) : QAbstractItemModel(channel) {
- //QStringList list; list << "test1" << "test2";
- //setStringList(list);
+NickModel::NickModel(IrcChannel *channel, QObject *parent) : QAbstractItemModel(parent) {
+ // we support 6 categories: q, a, o, h, v and standard
+ users = QVector<QList<IrcUser *> >(6);
+ if(channel) setIrcChannel(channel);
+ else _ircChannel = 0;
}
NickModel::~NickModel() {
}
+IrcChannel *NickModel::ircChannel() const {
+ return _ircChannel;
+}
+
+void NickModel::setIrcChannel(IrcChannel *channel) {
+ if(_ircChannel) {
+ disconnect(_ircChannel, 0, this, 0);
+ }
+ foreach(QList<IrcUser *> l, users) l.clear();
+ _ircChannel = channel;
+ reset();
+ if(_ircChannel) {
+ connect(channel, SIGNAL(ircUserJoined(IrcUser *)), this, SLOT(addUser(IrcUser *)));
+ connect(channel, SIGNAL(ircUserParted(IrcUser *)), this, SLOT(removeUser(IrcUser *)));
+ connect(channel, SIGNAL(ircUserNickSet(IrcUser *, QString)), this, SLOT(renameUser(IrcUser *)));
+ connect(channel, SIGNAL(ircUserModesSet(IrcUser *, QString)), this, SLOT(changeUserModes(IrcUser *)));
+
+ foreach(IrcUser *ircuser, channel->ircUsers()) {
+ // TODO: make this efficient by sorting after everything is appended instead!
+ addUser(ircuser);
+ }
+ }
+
+}
+
+QVariant NickModel::headerData(int section, Qt::Orientation orientation, int role) const {
+ if(section == 0 && role == Qt::DisplayRole) {
+ if(ircChannel()) return ircChannel()->name();
+ else return "No channel";
+ }
+ return QAbstractItemModel::headerData(section, orientation, role);
+}
+
+QModelIndex NickModel::index(int row, int column, const QModelIndex &parent) const {
+ if(!parent.isValid()) { // Top-level item, i.e. a nick category
+ if(column > 0) return QModelIndex();
+ //int r = 0;
+ //for(int i = 0; i < row; i++) { // we need to skip empty categories
+ if(row > users.count()) {
+ qDebug() << "invalid model index!";
+ return QModelIndex();
+ }
+ return createIndex(row, column, 0);
+ }
+ // Second-level item, i.e. a nick. internalId() contains the parent category (starting at 1).
+ int cat = parent.row() + 1;
+ if(row > users[cat-1].count()) {
+ qDebug() << "invalid model index!";
+ return QModelIndex();
+ }
+ return createIndex(row, column, cat);
+}
+
+QModelIndex NickModel::indexOfUser(IrcUser *user) const {
+ int idx = -1; int cat;
+ for(cat = users.count()-1; cat >= 0; cat--) {
+ // we count backwards, since most users will usually be in the last category
+ idx = users[cat].indexOf(user);
+ if(idx >=0) break;
+ }
+ if(idx < 0) {
+ qWarning("NickModel: Index of unknown user requested!");
+ return QModelIndex();
+ }
+ return createIndex(idx, 0, cat+1);
+}
+
+QModelIndex NickModel::parent(const QModelIndex &index) const {
+ if(!index.isValid()) return QModelIndex();
+ int cat = index.internalId();
+ if(cat) return createIndex(cat-1, 0, 0);
+ else return QModelIndex();
+}
+
+int NickModel::rowCount(const QModelIndex &parent) const {
+ if(!parent.isValid()) {
+ if(!ircChannel()) return 1; // informative text
+ return users.count();
+ }
+ int cat = parent.internalId();
+ if(!cat) { // top-level item (category)
+ return users[parent.row()].count();
+ }
+ return 0; // second-level items don't have children
+}
+
+int NickModel::columnCount(const QModelIndex &) const {
+ //if(!ircChannel()) return 0;
+ return 1; // all our items have exactly one column
+}
+
+QVariant NickModel::data(const QModelIndex &index, int role) const {
+ if(!index.isValid()) return QVariant();
+ if(!ircChannel()) {
+ // we show one item with informative text
+ switch(role) {
+ case Qt::DisplayRole: return tr("Not in channel");
+ default: return QVariant();
+ }
+ }
+ int cat = index.internalId();
+ if(!cat) { // top-level item (category)
+ if(role == Qt::DisplayRole) {
+ QString title;
+ switch(index.row()) {
+ case 0: title = tr("%n Owner(s)", "", users[index.row()].count()); break;
+ case 1: title = tr("%n Admin(s)", "", users[index.row()].count()); break;
+ case 2: title = tr("%n Operator(s)", "", users[index.row()].count()); break;
+ case 3: title = tr("%n Half-Op(s)", "", users[index.row()].count()); break;
+ case 4: title = tr("%n Voiced", "", users[index.row()].count()); break;
+ case 5: title = tr("%n User(s)", "", users[index.row()].count()); break;
+ default:
+ qDebug() << "invalid model index"; return QVariant();
+ }
+ return title;
+ } else return QVariant();
+ } else {
+ IrcUser *user = users[cat-1][index.row()];
+ switch(role) {
+ case Qt::DisplayRole:
+ return user->nick();
+ default:
+ return QVariant();
+ }
+ }
+}
+
+int NickModel::userCategory(IrcUser *user) const {
+ return categoryFromModes(ircChannel()->userModes(user));
+}
+
+int NickModel::categoryFromModes(const QString &modes) const {
+ int cat;
+ // we hardcode this even though we have PREFIX in networkinfo... but that wouldn't help with mapping modes to
+ // category strings anyway.
+ if(modes.contains('q')) cat = 1;
+ else if(modes.contains('a')) cat = 2;
+ else if(modes.contains('o')) cat = 3;
+ else if(modes.contains('h')) cat = 4;
+ else if(modes.contains('v')) cat = 5;
+ else cat = 6;
+ return cat;
+}
+
+int NickModel::categoryFromIndex(const QModelIndex &index) const {
+ if(!index.isValid()) return -1;
+ return index.internalId();
+}
+
+void NickModel::addUser(IrcUser *user) {
+ int cat = userCategory(user);
+ beginInsertRows(createIndex(cat-1, 0, 0), 0, 0);
+ users[cat-1].prepend(user);
+ endInsertRows();
+}
+
+void NickModel::removeUser(IrcUser *user) {
+ // we don't know for sure which category this user was in, so we have to search
+ QModelIndex index = indexOfUser(user);
+ removeUser(index);
+}
+
+void NickModel::removeUser(const QModelIndex &index) {
+ if(!index.isValid()) return;
+ beginRemoveRows(index.parent(), index.row(), index.row());
+ users[index.internalId()-1].removeAt(index.row());
+ endRemoveRows();
+}
+
+void NickModel::renameUser(IrcUser *user) {
+ QModelIndex index = indexOfUser(user);
+ emit dataChanged(index, index);
+}
+
+void NickModel::changeUserModes(IrcUser *user) {
+ QModelIndex oldindex = indexOfUser(user);
+ if(categoryFromIndex(oldindex) == categoryFromModes(ircChannel()->userModes(user))) {
+ // User is still in same category, no change necessary
+ emit dataChanged(oldindex, oldindex);
+ } else {
+ removeUser(oldindex);
+ addUser(user);
+ }
+}
+
+
#define _NICKMODEL_H_
#include <QAbstractItemModel>
+#include <QVector>
class IrcChannel;
+class IrcUser;
-/*
-//! Represents a single IrcUser within a NickTreeModel.
-class NickTreeItem : public TreeItem {
+//! Represents the IrcUsers in a given IrcChannel.
+/** This model is a wrapper around the nicks/IrcUsers stored in an IrcChannel. It provides a tree with two,
+ * levels, where the top-level items are the categories (such as Ops, Voiced etc), and the second-level items
+ * the actual nicks/users. Several roles are provided to access information about a nick.
+ *
+ * Note that the nicks are not sorted in any way. Use a QSortFilterProxyModel to do that instead.
+ */
+class NickModel : public QAbstractItemModel {
Q_OBJECT
public:
- NickTreeItem(IrcUser *ircuser, TreeItem *parent = 0);
-
- //virtual QVariant data(int column, int row) const;
-
- private:
+ NickModel(IrcChannel *channel = 0, QObject *parent = 0);
+ virtual ~NickModel();
-};
+ virtual QModelIndex index(int row, int col, const QModelIndex &parent) const;
+ virtual QModelIndex parent(const QModelIndex &index) const;
+ virtual int rowCount(const QModelIndex &) const;
+ virtual int columnCount(const QModelIndex &) const;
+ virtual QVariant data(const QModelIndex &, int role) const;
+ virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
-//! Represents a group of nicks, such as Ops, Voiced etc.
-class NickTreeGroupItem : public TreeItem {
- Q_OBJECT
+ IrcChannel *ircChannel() const;
- public:
- NickTreeGroupItem(const QString &title, TreeItem *parent = 0);
+ QModelIndex indexOfUser(IrcUser *) const;
+ int categoryFromModes(const QString &modes) const;
+ int categoryFromIndex(const QModelIndex &index) const;
+ int userCategory(IrcUser *) const;
- //virtual QVariant data(int column, int row) const;
+ public slots:
+ void setIrcChannel(IrcChannel *);
+ void addUser(IrcUser *);
+ void removeUser(IrcUser *);
+ void removeUser(const QModelIndex &);
+ void renameUser(IrcUser *);
+ void changeUserModes(IrcUser *);
private:
-};
-*/
-
-//! Represents the IrcUsers in a given IrcChannel.
-class NickModel : public QAbstractItemModel {
- Q_OBJECT
-
- public:
- NickModel(IrcChannel *);
- virtual ~NickModel();
-
- private:
-
+ IrcChannel *_ircChannel;
+ QVector<QList<IrcUser *> > users;
};
return _userModes.keys();
}
-QString IrcChannel::userMode(IrcUser *ircuser) const {
+QString IrcChannel::userModes(IrcUser *ircuser) const {
if(_userModes.contains(ircuser))
return _userModes[ircuser];
else
return QString();
}
-QString IrcChannel::userMode(const QString &nick) const {
- return userMode(networkInfo->ircUser(nick));
+QString IrcChannel::userModes(const QString &nick) const {
+ return userModes(networkInfo->ircUser(nick));
}
// ====================
if(isKnownUser(ircuser)) {
_userModes[ircuser] = modes;
emit userModesSet(ircuser->nick(), modes);
- emit userModesSet(ircuser, modes);
+ emit ircUserModesSet(ircuser, modes);
}
}
void IrcChannel::addUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
return;
-
+
if(!_userModes[ircuser].contains(mode)) {
_userModes[ircuser] += mode;
emit userModeAdded(ircuser->nick(), mode);
- emit userModeAdded(ircuser, mode);
+ emit ircUserModeAdded(ircuser, mode);
}
}
}
// REMOVE USER MODE
-void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) { qDebug() << "remove mode:" << ircuser->nick() << mode;
+void IrcChannel::removeUserMode(IrcUser *ircuser, const QString &mode) {
if(!isKnownUser(ircuser) || !isValidChannelUserMode(mode))
return;
if(_userModes[ircuser].contains(mode)) {
_userModes[ircuser].remove(mode);
emit userModeRemoved(ircuser->nick(), mode);
- emit userModeRemoved(ircuser, mode);
+ emit ircUserModeRemoved(ircuser, mode);
}
}
QList<IrcUser *> ircUsers() const;
- QString userMode(IrcUser *ircuser) const;
- QString userMode(const QString &nick) const;
+ QString userModes(IrcUser *ircuser) const;
+ QString userModes(const QString &nick) const;
public slots:
void setTopic(const QString &topic);
signals:
void topicSet(QString topic);
void userModesSet(QString nick, QString modes);
- void userModesSet(IrcUser *ircuser, QString modes);
+ //void userModesSet(IrcUser *ircuser, QString modes);
void userModeAdded(QString nick, QString mode);
- void userModeAdded(IrcUser *ircuser, QString mode);
+ //void userModeAdded(IrcUser *ircuser, QString mode);
void userModeRemoved(QString nick, QString mode);
- void userModeRemoved(IrcUser *ircuser, QString mode);
+ //void userModeRemoved(IrcUser *ircuser, QString mode);
void ircUserJoined(IrcUser *ircuser);
void ircUserParted(IrcUser *ircuser);
void ircUserNickSet(IrcUser *ircuser, QString nick);
+ void ircUserModeAdded(IrcUser *ircuser, QString mode);
+ void ircUserModeRemoved(IrcUser *ircuser, QString mode);
+ void ircUserModesSet(IrcUser *ircuser, QString modes);
void initDone();
#include "chatline-old.h"
#include "client.h"
#include "coreconnectdlg.h"
+#include "nicklistwidget.h"
#include "serverlist.h"
#include "settingsdlg.h"
//#include "settingspage.h"
setupMenus();
setupViews();
+ // create nick dock
+ nickDock = new QDockWidget("Nicks", this);
+ nickDock->setObjectName("NickDock");
+ nickDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+
+ nickListWidget = new NickListWidget(nickDock);
+ nickDock->setWidget(nickListWidget);
+
+ addDockWidget(Qt::RightDockWidgetArea, nickDock);
+ ui.menuViews->addAction(nickDock->toggleViewAction());
+
+ // restore mainwin state
QSettings s;
s.beginGroup("Geometry");
//resize(s.value("MainWinSize", QSize(500, 400)).toSize());
connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg()));
ui.actionSettingsDlg->setEnabled(false);
connect(ui.actionAboutQt, SIGNAL(triggered()), QApplication::instance(), SLOT(aboutQt()));
- // for debugging
- connect(ui.actionImportBacklog, SIGNAL(triggered()), this, SLOT(importBacklog()));
- Client::signalProxy()->attachSignal(this, SIGNAL(importOldBacklog()));
}
void MainWin::setupViews() {
currentBuffer = b->bufferInfo().groupId();
//emit bufferSelected(b);
//qApp->processEvents();
-
ui.bufferWidget->setBuffer(b);
+ nickListWidget->setBuffer(b);
+ //if(b->bufferType() == Buffer::ChannelType) nickDock->show();
+ //else nickDock->hide();
//emit bufferSelected(b);
}
-
-void MainWin::importBacklog() {
- if(QMessageBox::warning(this, "Import old backlog?", "Do you want to import your old file-based backlog into new the backlog database?<br>"
- "<b>This will permanently delete the contents of your database!</b>",
- QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes) {
- emit importOldBacklog();
- }
-}
class SettingsDlg;
class QtUi;
class Message;
+class NickListWidget;
//!\brief The main window of Quassel's QtUi.
class MainWin : public QMainWindow {
void showBuffer(BufferInfo);
void showBuffer(Buffer *);
- void importBacklog();
-
signals:
void connectToCore(const QVariantMap &connInfo);
void disconnectFromCore();
void requestBacklog(BufferInfo, QVariant, QVariant);
- void importOldBacklog();
private:
Ui::MainWin ui;
QString currentProfile;
QList<QDockWidget *> netViews;
+ QDockWidget *nickDock;
+ NickListWidget *nickListWidget;
friend class QtUi;
};
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by the Quassel IRC Team *
+ * 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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "nicklistwidget.h"
+
+#include "buffer.h"
+#include "nickview.h"
+
+NickListWidget::NickListWidget(QWidget *parent) : QWidget(parent) {
+ ui.setupUi(this);
+
+}
+
+void NickListWidget::setBuffer(Buffer *buf) {
+ if(buf->bufferType() != Buffer::ChannelType) {
+ ui.stackedWidget->setCurrentWidget(ui.emptyPage);
+ } else {
+ if(nickViews.contains(buf)) {
+ ui.stackedWidget->setCurrentWidget(nickViews.value(buf));
+ } else {
+ NickView *view = new NickView(this);
+ view->setModel(buf->nickModel());
+ nickViews[buf] = view;
+ ui.stackedWidget->addWidget(view);
+ ui.stackedWidget->setCurrentWidget(view);
+ }
+ }
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by the Quassel IRC Team *
+ * 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. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _NICKLISTWIDGET_H_
+#define _NICKLISTWIDGET_H_
+
+#include "ui_nicklistwidget.h"
+
+#include <QHash>
+
+class Buffer;
+class NickView;
+
+class NickListWidget : public QWidget {
+ Q_OBJECT
+
+ public:
+ NickListWidget(QWidget *parent = 0);
+
+ public slots:
+ void setBuffer(Buffer *);
+
+ private:
+ Ui::NickListWidget ui;
+ QHash<Buffer *, NickView *> nickViews;
+
+};
+
+#endif
SRCS += bufferwidget.cpp channelwidgetinput.cpp chatline-old.cpp \
chatwidget.cpp coreconnectdlg.cpp configwizard.cpp \
- guisettings.cpp identities.cpp mainwin.cpp qtui.cpp qtuistyle.cpp serverlist.cpp settingsdlg.cpp tabcompleter.cpp topicwidget.cpp
+ guisettings.cpp identities.cpp mainwin.cpp nicklistwidget.cpp qtui.cpp qtuistyle.cpp serverlist.cpp settingsdlg.cpp \
+ tabcompleter.cpp topicwidget.cpp
HDRS += bufferwidget.h channelwidgetinput.h chatline-old.h chatwidget.h configwizard.h \
- coreconnectdlg.h guisettings.h identities.h mainwin.h qtui.h qtuistyle.h serverlist.h settingsdlg.h settingspage.h tabcompleter.h topicwidget.h
+ coreconnectdlg.h guisettings.h identities.h mainwin.h nicklistwidget.h qtui.h qtuistyle.h serverlist.h settingsdlg.h \
+ settingspage.h tabcompleter.h topicwidget.h
FORMNAMES = identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui mainwin.ui nickeditdlg.ui serverlistdlg.ui \
- servereditdlg.ui coreconnectdlg.ui bufferviewwidget.ui bufferwidget.ui settingsdlg.ui \
+ servereditdlg.ui coreconnectdlg.ui bufferviewwidget.ui bufferwidget.ui nicklistwidget.ui settingsdlg.ui \
buffermgmtpage.ui connectionpage.ui usermgmtpage.ui topicwidget.ui
for(ui, FORMNAMES) {
<x>0</x>
<y>0</y>
<width>800</width>
- <height>22</height>
+ <height>28</height>
</rect>
</property>
<widget class="QMenu" name="menuConnection" >
<property name="title" >
<string>Debug</string>
</property>
- <addaction name="actionImportBacklog" />
</widget>
<widget class="QMenu" name="menuCore" >
<property name="title" >
--- /dev/null
+<ui version="4.0" >
+ <class>NickListWidget</class>
+ <widget class="QWidget" name="NickListWidget" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>94</width>
+ <height>223</height>
+ </rect>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
+ <item>
+ <widget class="QStackedWidget" name="stackedWidget" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="emptyPage" />
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
***************************************************************************/
#include "nickview.h"
+#include "nickmodel.h"
-NickView::NickView(QWidget *parent) : QTreeView(parent) {
+NickView::NickView(QWidget *parent) : QTreeView(parent) {
+ setGeometry(0, 0, 30, 30);
+ //setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
}
}
+void NickView::setModel(NickModel *model) {
+ QTreeView::setModel(model);
+}
#include <QTreeView>
+class NickModel;
+
class NickView : public QTreeView {
Q_OBJECT
NickView(QWidget *parent = 0);
virtual ~NickView();
+ public slots:
+ void setModel(NickModel *model);