From ac33ec483123f0801e28ebc915b0483d92969c30 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 29 Jun 2020 01:13:25 -0400 Subject: [PATCH] CResourceTableContextMenu: Make use of Qt 5 signals and slots --- .../CResourceTableContextMenu.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp b/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp index 6fc863d3..e291d3a2 100644 --- a/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp +++ b/src/Editor/ResourceBrowser/CResourceTableContextMenu.cpp @@ -14,7 +14,7 @@ CResourceTableContextMenu::CResourceTableContextMenu(CResourceBrowser *pBrowser, , mpProxy(pProxy) { // Connect to the view - connect(pView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(ShowMenu(QPoint))); + connect(pView, &QTableView::customContextMenuRequested, this, &CResourceTableContextMenu::ShowMenu); } void CResourceTableContextMenu::InitMenu() @@ -32,40 +32,40 @@ void CResourceTableContextMenu::InitMenu() const QString kOpenInExplorerString = tr("Show in file manager"); #endif - addAction(tr("Open"), this, SLOT(Open())); - addAction(tr("Open in External Application"), this, SLOT(OpenInExternalApp())); - addAction(kOpenInExplorerString, this, SLOT(OpenInExplorer())); + addAction(tr("Open"), this, &CResourceTableContextMenu::Open); + addAction(tr("Open in External Application"), this, &CResourceTableContextMenu::OpenInExternalApp); + addAction(kOpenInExplorerString, this, &CResourceTableContextMenu::OpenInExplorer); addSeparator(); } if (mpClickedEntry || mpClickedDirectory) { - addAction(tr("Rename"), this, SLOT(Rename())); + addAction(tr("Rename"), this, &CResourceTableContextMenu::Rename); if (mpModel->IsDisplayingAssetList()) { - addAction(tr("Select Folder"), this, SLOT(SelectFolder())); + addAction(tr("Select Folder"), this, &CResourceTableContextMenu::SelectFolder); } if (mpClickedEntry) { - addAction(tr("Show Referencers"), this, SLOT(ShowReferencers())); - addAction(tr("Show Dependencies"), this, SLOT(ShowDependencies())); + addAction(tr("Show Referencers"), this, &CResourceTableContextMenu::ShowReferencers); + addAction(tr("Show Dependencies"), this, &CResourceTableContextMenu::ShowDependencies); } } if (mpClickedEntry || mpClickedDirectory || !mSelectedIndexes.isEmpty()) { - addAction(tr("Delete"), this, SLOT(Delete())); + addAction(tr("Delete"), this, &CResourceTableContextMenu::Delete); } addSeparator(); if (mpClickedEntry) { - addAction(tr("Copy Name"), this, SLOT(CopyName())); - addAction(tr("Copy Path"), this, SLOT(CopyPath())); - addAction(tr("Copy ID"), this, SLOT(CopyID())); + addAction(tr("Copy Name"), this, &CResourceTableContextMenu::CopyName); + addAction(tr("Copy Path"), this, &CResourceTableContextMenu::CopyPath); + addAction(tr("Copy ID"), this, &CResourceTableContextMenu::CopyID); addSeparator(); } @@ -78,7 +78,7 @@ void CResourceTableContextMenu::InitMenu() switch (mpClickedEntry->ResourceType()) { case EResourceType::StringTable: - addAction(tr("Create Scan"), this, SLOT(CreateSCAN())); + addAction(tr("Create Scan"), this, &CResourceTableContextMenu::CreateSCAN); break; default: break; }