forked from dolphin-emu/dolphin
Qt/RegisterView: fix the context menu not working correctly
It seemed impossible to SELECT an item, however, when right clicking, the CURRENT item is set to the appropriate cell, this commit makes the view use thta cell instead of the first selected one.
This commit is contained in:
@@ -108,13 +108,11 @@ void RegisterWidget::ShowContextMenu()
|
|||||||
{
|
{
|
||||||
QMenu* menu = new QMenu(this);
|
QMenu* menu = new QMenu(this);
|
||||||
|
|
||||||
if (m_table->selectedItems().size())
|
auto variant = m_table->currentItem()->data(DATA_TYPE);
|
||||||
{
|
|
||||||
auto variant = m_table->selectedItems()[0]->data(DATA_TYPE);
|
|
||||||
|
|
||||||
if (!variant.isNull())
|
if (!variant.isNull())
|
||||||
{
|
{
|
||||||
auto* item = reinterpret_cast<RegisterColumn*>(m_table->selectedItems()[0]);
|
auto* item = static_cast<RegisterColumn*>(m_table->currentItem());
|
||||||
auto type = static_cast<RegisterType>(item->data(DATA_TYPE).toInt());
|
auto type = static_cast<RegisterType>(item->data(DATA_TYPE).toInt());
|
||||||
auto display = item->GetDisplay();
|
auto display = item->GetDisplay();
|
||||||
|
|
||||||
@@ -210,7 +208,6 @@ void RegisterWidget::ShowContextMenu()
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
AddAction(menu, tr("Update"), this, [this] { emit RequestTableUpdate(); });
|
AddAction(menu, tr("Update"), this, [this] { emit RequestTableUpdate(); });
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user