• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.12
  • kdenetwork
  • kopete
  • kopete
  • chatwindow
chatmemberslistview.cpp
Go to the documentation of this file.
1 /*
2  ChatMembersListView
3 
4  Copyright (c) 2007 by Duncan Mac-Vicar Prett <duncan@kde.org>
5 
6  Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
7 
8  *************************************************************************
9  * *
10  * This library is free software; you can redistribute it and/or *
11  * modify it under the terms of the GNU Lesser General Public *
12  * License as published by the Free Software Foundation; either *
13  * version 2 of the License, or (at your option) any later version. *
14  * *
15  *************************************************************************
16 */
17 
18 #include <QToolTip>
19 #include <QHelpEvent>
20 #include <QDrag>
21 #include <QMimeData>
22 
23 #include "kdebug.h"
24 #include "kmenu.h"
25 #include "kopetecontact.h"
26 #include "chatmemberslistview.h"
27 #include "chatsessionmemberslistmodel.h"
28 
29 using namespace Kopete;
30 
31 ChatMembersListView::ChatMembersListView( QWidget *parent )
32  : QListView( parent )
33 {
34  setContextMenuPolicy (Qt::CustomContextMenu);
35  connect(this, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotContextMenuRequested(QPoint)));
36 }
37 
38 void ChatMembersListView::slotContextMenuRequested( const QPoint & pos )
39 {
40  kDebug() << "context menu requested";
41  QModelIndex index = indexAt(pos);
42  if ( model() )
43  {
44  ChatSessionMembersListModel *membermodel = dynamic_cast<ChatSessionMembersListModel *>(model());
45  if ( membermodel )
46  {
47  Kopete::Contact *c = membermodel->contactAt(index);
48 
49  if (!c)
50  return;
51 
52  KMenu *p = c->popupMenu();
53  connect( p, SIGNAL(aboutToHide()), p, SLOT(deleteLater()) );
54  p->popup( mapToGlobal(pos) );
55  }
56  }
57 }
58 
59 ChatMembersListView::~ChatMembersListView()
60 {
61 }
62 
63 #include "chatmemberslistview.moc"
64 
65 // vim: set noet ts=4 sts=4 sw=4:
66 
QWidget
ChatMembersListView::slotContextMenuRequested
void slotContextMenuRequested(const QPoint &pos)
Definition: chatmemberslistview.cpp:38
chatmemberslistview.h
QListView
ChatMembersListView::~ChatMembersListView
virtual ~ChatMembersListView()
Definition: chatmemberslistview.cpp:59
ChatMembersListView::ChatMembersListView
ChatMembersListView(QWidget *parent=0)
Definition: chatmemberslistview.cpp:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:40 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal