changed the usage of "QMenu*" to a local "QMenu"

removed usage of "new QMouseEvent", it was a memory leak
cleaned some includes

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2910 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-14 20:55:44 +00:00
parent e49cc6552c
commit c3c6480f4b
30 changed files with 68 additions and 297 deletions

View File

@ -19,12 +19,6 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QtGui>
#include <QContextMenuEvent>
#include <QCursor>
#include <QMenu>
#include <QMouseEvent>
#include <QPixmap>
#include <QPoint>
#include <iostream>
#include <algorithm>
@ -143,7 +137,6 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
postchannelAct = new QAction(QIcon(":/images/mail_reply.png"), tr( "Post to Channel" ), this );
connect( postchannelAct , SIGNAL( triggered() ), this, SLOT( createMsg() ) );
@ -157,8 +150,6 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
channeldetailsAct = new QAction(QIcon(":/images/info16.png"), tr( "Show Channel Details" ), this );
connect( channeldetailsAct , SIGNAL( triggered() ), this, SLOT( showChannelDetails() ) );
contextMnu.clear();
if (ci.channelFlags & RS_DISTRIB_PUBLISH)
{
contextMnu.addAction( postchannelAct );
@ -178,9 +169,7 @@ void ChannelFeed::channelListCustomPopupMenu( QPoint point )
contextMnu.addAction( channeldetailsAct );
}
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void ChannelFeed::createChannel()

View File

@ -29,7 +29,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
#include <QModelIndex>

View File

@ -34,20 +34,6 @@
#include <sstream>
#include <algorithm>
#include <QContextMenuEvent>
#include <QCursor>
#include <QDateTime>
#include <QFile>
#include <QFileInfo>
#include <QMenu>
#include <QMouseEvent>
#include <QPixmap>
#include <QPoint>
#include <QPrintDialog>
#include <QPrinter>
#include <QHeaderView>
#include <QTimer>
#include <QMessageBox>
#include <QtGui>
/* Images for context menu icons */
@ -176,7 +162,6 @@ ForumsDialog::ForumsDialog(QWidget *parent)
void ForumsDialog::forumListCustomPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *subForumAct = new QAction(QIcon(IMAGE_SUBSCRIBE), tr( "Subscribe to Forum" ), this );
subForumAct->setDisabled (true);
@ -210,19 +195,18 @@ void ForumsDialog::forumListCustomPopupMenu( QPoint point )
detailsForumAct->setEnabled (true);
}
contextMnu.clear();
contextMnu.addAction( subForumAct );
contextMnu.addAction( unsubForumAct );
contextMnu.addSeparator();
contextMnu.addAction( newForumAct );
contextMnu.addAction( detailsForumAct );
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void ForumsDialog::threadListCustomPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply" ), this );
replyAct->setDisabled (true);
@ -250,14 +234,14 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
}
}
contextMnu.clear();
contextMnu.addAction( replyAct);
contextMnu.addAction( viewAct);
contextMnu.addAction( replyauthorAct);
contextMnu.addSeparator();
contextMnu.addAction( expandAll);
contextMnu.addAction( collapseAll);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void ForumsDialog::togglefileview()

View File

@ -30,13 +30,6 @@
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
/* Images for context menu icons */
#define IMAGE_DOWNLOAD ":/images/start.png"

View File

@ -29,13 +29,6 @@
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
/* Images for context menu icons */
#define IMAGE_DOWNLOAD ":/images/start.png"

View File

@ -38,14 +38,7 @@
#include <iostream>
#include <sstream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QMessageBox>
#include <QHeaderView>
#include <QTimer>
/* Images for context menu icons */
@ -144,7 +137,6 @@ void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
voteupAct = new QAction(QIcon(IMAGE_EXPORTFRIEND), tr( "Share Link Anonymously" ), this );
connect( voteupAct , SIGNAL( triggered() ), this, SLOT( voteup_anon() ) );
@ -172,14 +164,13 @@ void LinksDialog::linkTreeWidgetCostumPopupMenu( QPoint point )
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr("Download"), this);
connect(downloadAct, SIGNAL(triggered()), this, SLOT(downloadSelected()));
contextMnu.clear();
contextMnu.addAction(voteupAct);
contextMnu.addSeparator();
contextMnu.addMenu(voteMenu);
contextMnu.addSeparator();
contextMnu.addAction(downloadAct);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void LinksDialog::changedSortRank( int index )

View File

@ -39,7 +39,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QPrintDialog>
#include <QPrinter>
@ -246,9 +245,6 @@ int MessagesDialog::getSelectedMsgCount ()
void MessagesDialog::messageslistWidgetCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu.clear();
/** Defines the actions for the context menu */
QAction* newmsgAct = NULL;
@ -300,17 +296,16 @@ void MessagesDialog::messageslistWidgetCostumPopupMenu( QPoint point )
removemsgAct->setDisabled(true);
}
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void MessagesDialog::msgfilelistWidgetCostumPopupMenu( QPoint point )
{
QAction* getRecAct = NULL;
QAction* getAllRecAct = NULL;
// QAction* getAllRecAct = NULL;
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
getRecAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
connect( getRecAct , SIGNAL( triggered() ), this, SLOT( getcurrentrecommended() ) );
@ -318,10 +313,9 @@ void MessagesDialog::msgfilelistWidgetCostumPopupMenu( QPoint point )
// getAllRecAct = new QAction(QIcon(IMAGE_DOWNLOADALL), tr( "Download" ), this );
// connect( getAllRecAct , SIGNAL( triggered() ), this, SLOT( getallrecommended() ) );
contextMnu.clear();
contextMnu.addAction( getRecAct);
// contextMnu.addAction( getAllRecAct);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void MessagesDialog::newmessage()

View File

@ -31,17 +31,6 @@
#include "rsiface/rsfiles.h"
#include <sstream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QPrintDialog>
#include <QPrinter>
#include <QDateTime>
#include <QHeaderView>
/** Constructor */
MessagesPopupDialog::MessagesPopupDialog(QWidget* parent, Qt::WFlags flags)

View File

@ -49,14 +49,6 @@
#include <iostream>
#include <sstream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QPixmap>
#include <QMouseEvent>
#include <QHeaderView>
/* Images for context menu icons */
#define IMAGE_REMOVEFRIEND ":/images/removefriend16.png"
#define IMAGE_EXPIORTFRIEND ":/images/exportpeers_16x16.png"
@ -175,7 +167,6 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction* expandAll = new QAction(tr( "Expand all" ), this );
connect( expandAll , SIGNAL( triggered() ), ui.messengertreeWidget, SLOT (expandAll()) );
@ -239,7 +230,6 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
QWidgetAction *widgetAction = new QWidgetAction(this);
widgetAction->setDefaultWidget(widget);
contextMnu.clear();
contextMnu.addAction( widgetAction);
contextMnu.addAction( chatAct);
contextMnu.addAction( sendMessageAct);
@ -254,7 +244,7 @@ void MessengerWindow::messengertreeWidgetCostumPopupMenu( QPoint point )
contextMnu.addSeparator();
contextMnu.addAction( expandAll);
contextMnu.addAction( collapseAll);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void MessengerWindow::updateMessengerDisplay()

View File

@ -49,7 +49,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
@ -205,8 +204,6 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
return;
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu.clear();
std::string peer_id = wi->text(4).toStdString() ;
@ -253,7 +250,7 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
contextMnu.addAction( peerdetailsAct);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void NetworkDialog::denyFriend()

View File

@ -94,8 +94,6 @@ private slots:
private:
QTreeWidgetItem *getCurrentNeighbour();
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
/** Defines the actions for the context menu */
QAction* peerdetailsAct;
QAction* denyFriendAct;

View File

@ -27,8 +27,6 @@
#include <gpgme.h>
#include <QMenu>
#include <QMouseEvent>
#include <QGraphicsItem>
#include <iostream>
@ -72,20 +70,6 @@ NetworkView::NetworkView(QWidget *parent)
}
void NetworkView::peerCustomPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
//QAction * voteupAct = new QAction(QIcon(IMAGE_EXPIORTFRIEND), tr( "Vote Link Up" ), this );
//connect( voteupAct , SIGNAL( triggered() ), this, SLOT( voteup() ) );
contextMnu.clear();
//contextMnu.addAction(voteupAct);
contextMnu.exec( mevent->globalPos() );
}
void NetworkView::changedFoFCheckBox( )
{
insertPeers();

View File

@ -38,9 +38,6 @@ public:
private slots:
/** Create the context popup menu and it's submenus */
void peerCustomPopupMenu( QPoint point );
void insertPeers();
void insertSignatures();
void insertConnections();

View File

@ -62,7 +62,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QMessageBox>
#include <QHeaderView>
@ -255,8 +254,7 @@ void PeersDialog::contextMenu( QPoint point )
QMenu contextMnu(this);
contextMnu.addAction( pasteLinkAct);
QMouseEvent mevent(QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
contextMnu.exec( mevent.globalPos() );
contextMnu.exec(QCursor::pos());
}
void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
@ -267,9 +265,6 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
return;
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction* expandAll = new QAction(tr( "Expand all" ), this );
connect( expandAll , SIGNAL( triggered() ), ui.peertreeWidget, SLOT (expandAll()) );
@ -332,7 +327,8 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
QWidgetAction *widgetAction = new QWidgetAction(this);
widgetAction->setDefaultWidget(widget);
contextMnu.clear();
QMenu contextMnu( this );
contextMnu.addAction( widgetAction);
contextMnu.addAction( chatAct);
contextMnu.addAction( msgAct);
@ -347,7 +343,8 @@ void PeersDialog::peertreeWidgetCostumPopupMenu( QPoint point )
contextMnu.addSeparator();
contextMnu.addAction( expandAll);
contextMnu.addAction( collapseAll);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
// replaced by shortcut

View File

@ -172,8 +172,6 @@ private:
/* (2) Utility Fns */
QTreeWidgetItem *getCurrentPeer();
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
/** Defines the actions for the context menu */
QAction* chatAct;
QAction* pasteLinkAct;

View File

@ -42,7 +42,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
@ -91,7 +90,6 @@ bool SearchDialog::initialised = false;
SearchDialog::SearchDialog(QWidget *parent)
: MainPage(parent),
advSearchDialog(NULL),
contextMnu(NULL), contextMnu2(NULL),
nextSearchId(1)
{
/* Invoke the Qt Designer generated object setup routine */
@ -228,40 +226,33 @@ void SearchDialog::initialiseFileTypeMappings()
void SearchDialog::searchtableWidgetCostumPopupMenu( QPoint point )
{
// block the popup if no results available
if ((ui.searchResultWidget->selectedItems()).size() == 0) return;
// block the popup if no results available
if ((ui.searchResultWidget->selectedItems()).size() == 0) return;
// create the menu as required
if (contextMnu == 0)
{
contextMnu = new QMenu(this);
downloadAct = new QAction(QIcon(IMAGE_START), tr( "Download" ), this );
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( download() ) );
downloadAct = new QAction(QIcon(IMAGE_START), tr( "Download" ), this );
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( download() ) );
copysearchlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
connect( copysearchlinkAct , SIGNAL( triggered() ), this, SLOT( copysearchLink() ) );
copysearchlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Link" ), this );
connect( copysearchlinkAct , SIGNAL( triggered() ), this, SLOT( copysearchLink() ) );
sendrslinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this );
connect( sendrslinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
sendrslinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Link" ), this );
connect( sendrslinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) );
broadcastonchannelAct = new QAction( tr( "Broadcast on Channel" ), this );
connect( broadcastonchannelAct , SIGNAL( triggered() ), this, SLOT( broadcastonchannel() ) );
broadcastonchannelAct = new QAction( tr( "Broadcast on Channel" ), this );
connect( broadcastonchannelAct , SIGNAL( triggered() ), this, SLOT( broadcastonchannel() ) );
recommendtofriendsAct = new QAction( tr( "Recommend to Friends" ), this );
connect( recommendtofriendsAct , SIGNAL( triggered() ), this, SLOT( recommendtofriends() ) );
recommendtofriendsAct = new QAction( tr( "Recommend to Friends" ), this );
connect( recommendtofriendsAct , SIGNAL( triggered() ), this, SLOT( recommendtofriends() ) );
QMenu contextMnu(this);
contextMnu->clear();
contextMnu->addAction( downloadAct);
contextMnu->addSeparator();
contextMnu.addAction( downloadAct);
contextMnu.addSeparator();
contextMnu->addAction( copysearchlinkAct);
contextMnu->addAction( sendrslinkAct);
}
contextMnu.addAction( copysearchlinkAct);
contextMnu.addAction( sendrslinkAct);
QMouseEvent *mevent = new QMouseEvent(QEvent::MouseButtonPress,point,Qt::RightButton, Qt::RightButton,Qt::NoModifier);
contextMnu->exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void SearchDialog::download()
@ -366,28 +357,22 @@ void SearchDialog::recommendtofriends()
/** context menu searchTablewidget2 **/
void SearchDialog::searchtableWidget2CostumPopupMenu( QPoint point )
{
// block the popup if no results available
if ((ui.searchSummaryWidget->selectedItems()).size() == 0) return;
// create the menu as required
if (contextMnu2 == 0)
{
contextMnu2 = new QMenu( this );
searchRemoveAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Remove" ), this );
connect( searchRemoveAct , SIGNAL( triggered() ), this, SLOT( searchRemove() ) );
searchRemoveAct = new QAction(QIcon(IMAGE_REMOVE), tr( "Remove" ), this );
connect( searchRemoveAct , SIGNAL( triggered() ), this, SLOT( searchRemove() ) );
searchRemoveAllAct = new QAction(QIcon(IMAGE_REMOVEALL), tr( "Remove All" ), this );
connect( searchRemoveAllAct , SIGNAL( triggered() ), this, SLOT( searchRemoveAll() ) );
searchRemoveAllAct = new QAction(QIcon(IMAGE_REMOVEALL), tr( "Remove All" ), this );
connect( searchRemoveAllAct , SIGNAL( triggered() ), this, SLOT( searchRemoveAll() ) );
QMenu contextMnu(this);
contextMnu2->clear();
contextMnu2->addAction( searchRemoveAct);
contextMnu2->addAction( searchRemoveAllAct);
}
contextMnu.addAction( searchRemoveAct);
contextMnu.addAction( searchRemoveAllAct);
QMouseEvent *mevent2 = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu2->exec( mevent2->globalPos() );
contextMnu.exec(QCursor::pos());
}
/** remove selected search result **/

View File

@ -106,11 +106,6 @@ private:
/** the advanced search dialog instance */
AdvancedSearchDialog * advSearchDialog;
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
QMenu* contextMnu2;
/** Defines the actions for the context menu */
QAction* downloadAct;
QAction* copysearchlinkAct;

View File

@ -23,13 +23,6 @@
#include "rsiface/rsfiles.h"
#include <QContextMenuEvent>
#include <QMenu>
#include <QCheckBox>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
#include <QMessageBox>
#include <QComboBox>

View File

@ -28,8 +28,6 @@
#include <QCheckBox>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
#include <QMessageBox>
@ -77,15 +75,13 @@ ShareManager::~ShareManager()
void ShareManager::shareddirListCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
removeAct = new QAction(QIcon(IMAGE_CANCEL), tr( "Remove" ), this );
connect( removeAct , SIGNAL( triggered() ), this, SLOT( removeShareDirectory() ) );
contextMnu.clear();
contextMnu.addAction( removeAct );
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
/** Loads the settings for this page */

View File

@ -45,7 +45,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
#include <QTimer>
@ -222,9 +221,6 @@ void SharedFilesDialog::forceCheck()
void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
downloadAct = new QAction(QIcon(IMAGE_DOWNLOAD), tr( "Download" ), this );
connect( downloadAct , SIGNAL( triggered() ), this, SLOT( downloadRemoteSelected() ) );
@ -239,13 +235,14 @@ void SharedFilesDialog::shareddirtreeviewCostumPopupMenu( QPoint point )
// connect( addMsgAct , SIGNAL( triggered() ), this, SLOT( addMsgRemoteSelected() ) );
contextMnu.clear();
QMenu contextMnu( this );
contextMnu.addAction( downloadAct);
contextMnu.addSeparator();
contextMnu.addAction( copyremotelinkAct);
contextMnu.addAction( sendremotelinkAct);
// contextMnu.addAction( addMsgAct);
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
@ -721,8 +718,7 @@ void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
contextMnu2.addMenu( &msgMenu);
}
QMouseEvent mevent2( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu2.exec( mevent2.globalPos() );
contextMnu2.exec(QCursor::pos());
}
//============================================================================

View File

@ -39,7 +39,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include <QHeaderView>
#include <QStandardItemModel>
@ -276,9 +275,6 @@ TransfersDialog::TransfersDialog(QWidget *parent)
void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent mevent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
std::set<QStandardItem *> items;
std::set<QStandardItem *>::iterator it;
getIdOfSelectedItems(items);
@ -331,7 +327,7 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
chunkMenu.addAction(chunkStreamingAct);
chunkMenu.addAction(chunkRandomAct);
contextMnu.clear();
QMenu contextMnu( this );
if (addPlayOption)
contextMnu.addAction(playAct);
@ -414,7 +410,7 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
contextMnu.addSeparator();
contextMnu.exec( mevent.globalPos() );
contextMnu.exec(QCursor::pos());
}
TransfersDialog::~TransfersDialog()

View File

@ -133,8 +133,6 @@ private:
/** Create the actions on the tray menu or menubar */
void createActions();
/** Define the popup menus for the Context menu */
QMenu* contextMnu;
/** Defines the actions for the context menu */
QAction* showdowninfoAct;
QAction* playAct;

View File

@ -1,7 +1,5 @@
#include <iostream>
#include <QTimer>
#include <QMenu>
#include <QMouseEvent>
#include <rsiface/rsturtle.h>
#include "TurtleRouterDialog.h"

View File

@ -26,18 +26,6 @@
#include <gui/RetroShareLink.h>
#include "rshare.h"
#include <QTextCodec>
#include <QTextEdit>
#include <QToolBar>
#include <QTextCursor>
#include <QTextList>
#include <QString>
#include <QtDebug>
#include <QIcon>
#include <QPixmap>
#include <QHashIterator>
#include <QDesktopServices>
#include "rsiface/rspeers.h"
#include "rsiface/rsmsgs.h"
#include "rsiface/rsfiles.h"
@ -169,8 +157,7 @@ void PopupChatDialog::contextMenu( QPoint point )
QMenu contextMnu(this);
contextMnu.addAction( pasteLinkAct);
QMouseEvent mevent(QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
contextMnu.exec( mevent.globalPos() );
contextMnu.exec(QCursor::pos());
}
void PopupChatDialog::resetStatusBar()

View File

@ -45,7 +45,6 @@
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include "edge.h"
#include "arrow.h"

View File

@ -25,25 +25,6 @@
#include <gui/RetroShareLink.h>
#include <QtGui>
#include <QFileDialog>
#include <QString>
#include <QTextStream>
#include <QHashIterator>
#include <QDesktopServices>
#include <QTextCodec>
#include <QTextEdit>
#include <QTextCursor>
#include <QTextList>
#include <QString>
#include <QtDebug>
#include <QIcon>
#include <QPixmap>
#include <QContextMenuEvent>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QPixmap>
#include "rsiface/rsforums.h"
#include "rsiface/rsfiles.h"
@ -100,8 +81,7 @@ void CreateForumMsg::forumMessageCostumPopupMenu( QPoint point )
contextMnu->addAction( pasteLinkAct);
contextMnu->addAction( pasteLinkFullAct);
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
contextMnu->exec( mevent->globalPos() );
contextMnu->exec(QCursor::pos());
}

View File

@ -33,29 +33,7 @@
#include <sstream>
#include <QtGui>
#include <QContextMenuEvent>
#include <QCloseEvent>
#include <QColorDialog>
#include <QClipboard>
#include <QFile>
#include <QFileDialog>
#include <QFileInfo>
#include <QMenu>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QMessageBox>
#include <QPixmap>
#include <QPrintDialog>
#include <QPrinter>
#include <QHeaderView>
#include <QTextCharFormat>
#include <QTextCodec>
#include <QTextEdit>
#include <QTextCursor>
#include <QTextList>
#include <QTextStream>
#include <QTextDocumentFragment>
/** Constructor */

View File

@ -25,16 +25,7 @@
#include <sstream>
#include <QContextMenuEvent>
#include <QMenu>
#include <QFile>
#include <QFileDialog>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
#include <QMessageBox>
#include <QPixmap>
#include <QPrintDialog>
/** Constructor */
@ -60,9 +51,7 @@ ProfileEdit::ProfileEdit(QWidget *parent)
void ProfileEdit::profileCustomPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *removeAct = new QAction( tr( "Remove Profile Entry" ), this );
QAction *moveupAct = new QAction( tr( "Move Profile Entry Up" ), this );
@ -72,11 +61,11 @@ void ProfileEdit::profileCustomPopupMenu( QPoint point )
connect( moveupAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveUp() ) );
connect( movedownAct , SIGNAL( triggered() ), this, SLOT( profileEntryMoveDown() ) );
contextMnu.clear();
contextMnu.addAction( removeAct );
contextMnu.addAction( moveupAct );
contextMnu.addAction( movedownAct );
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void ProfileEdit::clear()

View File

@ -27,16 +27,16 @@
#include <sstream>
#include <QContextMenuEvent>
//#include <QContextMenuEvent>
#include <QMenu>
#include <QFile>
//#include <QFile>
#include <QFileDialog>
#include <QCursor>
#include <QPoint>
#include <QMouseEvent>
//#include <QCursor>
//#include <QPoint>
//#include <QMouseEvent>
#include <QMessageBox>
#include <QPixmap>
#include <QPrintDialog>
//#include <QPixmap>
//#include <QPrintDialog>
/** Constructor */
@ -72,7 +72,6 @@ void ProfileView::imageCustomPopupMenu( QPoint point )
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *clearImageAct = new QAction( tr( "Clear Photo" ), this );
QAction *changeImageAct = new QAction( tr( "Change Photo" ), this );
@ -80,10 +79,10 @@ void ProfileView::imageCustomPopupMenu( QPoint point )
connect( clearImageAct , SIGNAL( triggered() ), this, SLOT( clearimage() ) );
connect( changeImageAct , SIGNAL( triggered() ), this, SLOT( selectimagefile() ) );
contextMnu.clear();
contextMnu.addAction( clearImageAct );
contextMnu.addAction( changeImageAct );
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
@ -95,30 +94,24 @@ void ProfileView::profileCustomPopupMenu( QPoint point )
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *editAct = new QAction( tr( "Edit Profile" ), this );
connect( editAct , SIGNAL( triggered() ), this, SLOT( profileEdit() ) );
contextMnu.clear();
contextMnu.addAction( editAct );
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void ProfileView::fileCustomPopupMenu( QPoint point )
{
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *downloadAct = NULL;
QAction *downloadAllAct = NULL;
QAction *removeAct = NULL;
QAction *clearAct = NULL;
contextMnu.clear();
if (mIsOwnId)
{
removeAct = new QAction( tr( "Remove Favourite" ), this );
@ -140,7 +133,7 @@ void ProfileView::fileCustomPopupMenu( QPoint point )
contextMnu.addAction( downloadAllAct );
}
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}

View File

@ -22,8 +22,6 @@
#include <QContextMenuEvent>
#include <QCursor>
#include <QMenu>
#include <QMouseEvent>
#include <QPixmap>
#include <QPoint>
#include <iostream>
@ -126,7 +124,6 @@ void BlogsDialog::blogListCustomPopupMenu( QPoint point )
}
QMenu contextMnu( this );
QMouseEvent *mevent = new QMouseEvent( QEvent::MouseButtonPress, point, Qt::RightButton, Qt::RightButton, Qt::NoModifier );
QAction *createblogpostAct = new QAction(QIcon(":/images/mail_reply.png"), tr( "Post to Blog" ), this );
connect( createblogpostAct , SIGNAL( triggered() ), this, SLOT( createMsg() ) );
@ -161,9 +158,7 @@ void BlogsDialog::blogListCustomPopupMenu( QPoint point )
contextMnu.addAction( blogdetailsAct );
}
contextMnu.exec( mevent->globalPos() );
contextMnu.exec(QCursor::pos());
}
void BlogsDialog::createBlog()