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

kopete/kopete

chatmemberslistview.cpp

Go to the documentation of this file.
00001 /*
00002     ChatMembersListView
00003 
00004     Copyright (c) 2007 by Duncan Mac-Vicar Prett <duncan@kde.org>
00005    
00006     Kopete    (c) 2002-2007 by the Kopete developers  <kopete-devel@kde.org>
00007 
00008     *************************************************************************
00009     *                                                                       *
00010     * This library is free software; you can redistribute it and/or         *
00011     * modify it under the terms of the GNU Lesser General Public            *
00012     * License as published by the Free Software Foundation; either          *
00013     * version 2 of the License, or (at your option) any later version.      *
00014     *                                                                       *
00015     *************************************************************************
00016 */
00017 
00018 #include <QToolTip>
00019 #include <QHelpEvent>
00020 #include <QDrag>
00021 #include <QMimeData>
00022 
00023 #include "kdebug.h"
00024 #include "kmenu.h"
00025 #include "kopetecontact.h"
00026 #include "chatmemberslistview.h"
00027 #include "chatsessionmemberslistmodel.h"
00028 
00029 using namespace Kopete;
00030 
00031 ChatMembersListView::ChatMembersListView( QWidget *parent )
00032      : QListView( parent )
00033 {
00034     setContextMenuPolicy (Qt::CustomContextMenu);
00035     connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(slotContextMenuRequested(const QPoint &)));
00036 }
00037 
00038 void ChatMembersListView::slotContextMenuRequested( const QPoint & pos )
00039 {
00040     kDebug() << "context menu requested";
00041     QModelIndex index = indexAt(pos);
00042     if ( model() )
00043     {
00044         ChatSessionMembersListModel *membermodel = dynamic_cast<ChatSessionMembersListModel *>(model());
00045         if ( membermodel )
00046         {
00047             Kopete::Contact *c = membermodel->contactAt(index);
00048             
00049             if (!c)
00050                 return;
00051     
00052             KMenu *p = c->popupMenu( membermodel->session() );
00053             connect( p, SIGNAL( aboutToHide() ), p, SLOT( deleteLater() ) );
00054             p->popup( mapToGlobal(pos) );
00055         }
00056     }
00057 }
00058 
00059 ChatMembersListView::~ChatMembersListView()
00060 {
00061 }
00062 
00063 #include "chatmemberslistview.moc"
00064 
00065 // vim: set noet ts=4 sts=4 sw=4:
00066 

kopete/kopete

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

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal