aboutsummaryrefslogtreecommitdiff
path: root/examples/GuiClient/customListView.cpp
diff options
context:
space:
mode:
authorManjeet Dahiya <manjeetdahiya@gmail.com>2010-09-28 16:08:11 +0000
committerManjeet Dahiya <manjeetdahiya@gmail.com>2010-09-28 16:08:11 +0000
commit740343ca5bd92532eb77df67211733db53447a3d (patch)
tree963714eeef4ede9c578dbff07d3b6af22461522a /examples/GuiClient/customListView.cpp
parent97c57b6463e094e934b5fe460201dcf1b169f1be (diff)
downloadqxmpp-740343ca5bd92532eb77df67211733db53447a3d.tar.gz
add removeContact signaling
Diffstat (limited to 'examples/GuiClient/customListView.cpp')
-rw-r--r--examples/GuiClient/customListView.cpp14
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);
+}