diff options
Diffstat (limited to 'examples/GuiClient/customListView.cpp')
| -rw-r--r-- | examples/GuiClient/customListView.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/GuiClient/customListView.cpp b/examples/GuiClient/customListView.cpp index a071722f..37c6e056 100644 --- a/examples/GuiClient/customListView.cpp +++ b/examples/GuiClient/customListView.cpp @@ -28,7 +28,8 @@ #include <QMenu> #include <QKeyEvent> -customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat", this), m_profile("View Profile", this) +customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat", this), +m_profile("View Profile", this), m_removeContact("Remove", this) { bool check = connect(this, SIGNAL(pressed(const QModelIndex&)), this, SLOT(mousePressed(const QModelIndex&))); @@ -46,6 +47,10 @@ customListView::customListView(QWidget* parent):QListView(parent), m_chat("Chat" check = connect(&m_profile, SIGNAL(triggered()), this, SLOT(showProfile_helper())); Q_ASSERT(check); + + check = connect(&m_removeContact, SIGNAL(triggered()), this, + SLOT(removeContact_helper())); + Q_ASSERT(check); } bool customListView::event(QEvent* e) @@ -105,3 +110,10 @@ void customListView::keyPressEvent(QKeyEvent* event1) } QListView::keyPressEvent(event1); } + +void customListView::removeContact_helper() +{ + QString bareJid = selectedBareJid(); + if(!bareJid.isEmpty()) + emit removeContact(bareJid); +} |
