ResInsight/ApplicationCode/UserInterface/RiuCalculationsContextMenuManager.h
2018-03-12 11:12:39 +01:00

60 lines
1.8 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmChildArrayField.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include <QPointer>
#include <QAction>
#include <QWidget>
#include <memory>
#include <map>
class RimSummaryCalculationVariable;
class RicSummaryCurveCalculator;
//==================================================================================================
///
///
//==================================================================================================
class RiuCalculationsContextMenuManager : public QObject
{
Q_OBJECT
static const std::map<QString, std::set<QString>> MENU_MAP;
public:
RiuCalculationsContextMenuManager() { }
void attachWidget(QWidget* widget, RicSummaryCurveCalculator* curveCalc);
public slots:
void slotMenuItems(QPoint point);
private slots:
void slotCreateCalculationCopy();
private:
QPointer<QWidget> m_widget;
RicSummaryCurveCalculator* m_curveCalc;
int m_textPosition;
std::map<QString, std::unique_ptr<QAction>> m_actionCache;
};