mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 23:58:59 +00:00
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:
parent
f9a6f97dca
commit
8c23335be3
1 changed files with 95 additions and 98 deletions
|
@ -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(); });
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue