CResourceSelector: Make use of Qt 5 signals and slots

This commit is contained in:
Lioncash 2020-06-29 01:04:23 -04:00
parent 8e5d075e9f
commit 815affd07e
1 changed files with 8 additions and 8 deletions

View File

@ -59,11 +59,11 @@ CResourceSelector::CResourceSelector(QWidget *pParent)
mpResNameButton->installEventFilter(this); mpResNameButton->installEventFilter(this);
// UI Connections // UI Connections
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(CreateContextMenu(QPoint))); connect(this, &CResourceSelector::customContextMenuRequested, this, &CResourceSelector::CreateContextMenu);
connect(mpResNameButton, SIGNAL(clicked()), this, SLOT(Find())); connect(mpResNameButton, &QPushButton::clicked, this, &CResourceSelector::Find);
connect(mpSelectButton, SIGNAL(clicked()), this, SLOT(Select())); connect(mpSelectButton, &QPushButton::clicked, this, &CResourceSelector::Select);
connect(mpClearButton, SIGNAL(clicked()), this, SLOT(Clear())); connect(mpClearButton, &QPushButton::clicked, this, &CResourceSelector::Clear);
connect(gpEdApp->ResourceBrowser(), SIGNAL(ResourceMoved(CResourceEntry*,CVirtualDirectory*,TString)), this, SLOT(OnResourceMoved(CResourceEntry*))); connect(gpEdApp->ResourceBrowser(), &CResourceBrowser::ResourceMoved, this, &CResourceSelector::OnResourceMoved);
// Set up context menu // Set up context menu
mpEditAssetAction = new QAction(tr("Edit"), this); mpEditAssetAction = new QAction(tr("Edit"), this);
@ -71,9 +71,9 @@ CResourceSelector::CResourceSelector(QWidget *pParent)
mpCopyPathAction = new QAction(tr("Copy path"), this); mpCopyPathAction = new QAction(tr("Copy path"), this);
// Context menu connections // Context menu connections
connect(mpEditAssetAction, SIGNAL(triggered()), this, SLOT(EditAsset())); connect(mpEditAssetAction, &QAction::triggered, this, &CResourceSelector::EditAsset);
connect(mpCopyNameAction, SIGNAL(triggered()), this, SLOT(CopyName())); connect(mpCopyNameAction, &QAction::triggered, this, &CResourceSelector::CopyName);
connect(mpCopyPathAction, SIGNAL(triggered()), this, SLOT(CopyPath())); connect(mpCopyPathAction, &QAction::triggered, this, &CResourceSelector::CopyPath);
UpdateUI(); UpdateUI();
} }