mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2131 AppFwk : Wire up custom menu slot once
When this signal is wired up multiple times, the context menu shows up after activating a menu item in the context menu
This commit is contained in:
parent
e729ae02da
commit
cebe3009e7
@ -195,9 +195,6 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
}
|
||||
else if (PdmUiTreeSelectionQModel::isMultipleValueField(fieldValue))
|
||||
{
|
||||
|
||||
connect(m_treeView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint)));
|
||||
|
||||
caf::PdmUiObjectHandle* uiObject = uiObj(field()->fieldHandle()->ownerObject());
|
||||
if (uiObject)
|
||||
{
|
||||
@ -216,7 +213,6 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
else
|
||||
{
|
||||
m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
m_treeView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
}
|
||||
|
||||
if (!m_attributes.showTextFilter)
|
||||
@ -291,6 +287,9 @@ QWidget* PdmUiTreeSelectionEditor::createEditorWidget(QWidget* parent)
|
||||
|
||||
m_treeView = treeViewHeightHint;
|
||||
|
||||
m_treeView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(m_treeView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customMenuRequested(QPoint)));
|
||||
|
||||
layout->addWidget(treeViewHeightHint);
|
||||
|
||||
return frame;
|
||||
@ -324,7 +323,7 @@ void PdmUiTreeSelectionEditor::customMenuRequested(const QPoint& pos)
|
||||
}
|
||||
}
|
||||
|
||||
if (onlyHeadersInSelection)
|
||||
if (onlyHeadersInSelection && selectedIndexes.size() > 0)
|
||||
{
|
||||
{
|
||||
QAction* act = new QAction("Sub Items On", this);
|
||||
|
Loading…
Reference in New Issue
Block a user