mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3087 Show plot data. Display tabbed dialog for summary data
This commit is contained in:
@@ -30,14 +30,21 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_DECADE = DateTimeSpan(10, 0, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_YEAR = DateTimeSpan(1, 0, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_HALFYEAR = DateTimeSpan(0, 6, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_QUARTER = DateTimeSpan(0, 3, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_MONTH = DateTimeSpan(0, 1, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_WEEK = DateTimeSpan(0, 0, 7);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_DAY = DateTimeSpan(0, 0, 1);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_WEEK = DateTimeSpan(0, 0, 7);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_MONTH = DateTimeSpan(0, 1, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_QUARTER = DateTimeSpan(0, 3, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_HALFYEAR = DateTimeSpan(0, 6, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_YEAR = DateTimeSpan(1, 0, 0);
|
||||
const DateTimeSpan RiaQDateTimeTools::TIMESPAN_DECADE = DateTimeSpan(10, 0, 0);
|
||||
|
||||
const QString RiaQDateTimeTools::TIMESPAN_DAY_NAME = "Day";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_WEEK_NAME = "Week";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_MONTH_NAME = "Month";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_QUARTER_NAME = "Quarter";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_HALFYEAR_NAME = "Half Year";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_YEAR_NAME = "Year";
|
||||
const QString RiaQDateTimeTools::TIMESPAN_DECADE_NAME = "Decade";
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -261,13 +268,13 @@ const DateTimeSpan RiaQDateTimeTools::timeSpan(DateTimePeriod period)
|
||||
{
|
||||
switch (period)
|
||||
{
|
||||
case DateTimePeriod::DECADE: return TIMESPAN_DECADE;
|
||||
case DateTimePeriod::YEAR: return TIMESPAN_YEAR;
|
||||
case DateTimePeriod::HALFYEAR: return TIMESPAN_HALFYEAR;
|
||||
case DateTimePeriod::QUARTER: return TIMESPAN_QUARTER;
|
||||
case DateTimePeriod::MONTH: return TIMESPAN_MONTH;
|
||||
case DateTimePeriod::WEEK: return TIMESPAN_WEEK;
|
||||
case DateTimePeriod::DAY: return TIMESPAN_DAY;
|
||||
case DateTimePeriod::WEEK: return TIMESPAN_WEEK;
|
||||
case DateTimePeriod::MONTH: return TIMESPAN_MONTH;
|
||||
case DateTimePeriod::QUARTER: return TIMESPAN_QUARTER;
|
||||
case DateTimePeriod::HALFYEAR: return TIMESPAN_HALFYEAR;
|
||||
case DateTimePeriod::YEAR: return TIMESPAN_YEAR;
|
||||
case DateTimePeriod::DECADE: return TIMESPAN_DECADE;
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return DateTimeSpan();
|
||||
@@ -285,13 +292,13 @@ QDateTime RiaQDateTimeTools::truncateTime(const QDateTime& dt, DateTimePeriod pe
|
||||
|
||||
switch (period)
|
||||
{
|
||||
case DateTimePeriod::DECADE: return createUtcDateTime(QDate((y / 10) * 10, 1, 1));
|
||||
case DateTimePeriod::YEAR: return createUtcDateTime(QDate(y, 1, 1));
|
||||
case DateTimePeriod::HALFYEAR: return createUtcDateTime(QDate(y, ((m - 1) / 6) * 6 + 1, 1));
|
||||
case DateTimePeriod::QUARTER: return createUtcDateTime(QDate(y, ((m - 1) / 3) * 3 + 1, 1));
|
||||
case DateTimePeriod::MONTH: return createUtcDateTime(QDate(y, m, 1));
|
||||
case DateTimePeriod::WEEK: return createUtcDateTime(QDate(y, m, d).addDays(-dow + 1));
|
||||
case DateTimePeriod::DAY: return createUtcDateTime(QDate(y, m, d));
|
||||
case DateTimePeriod::WEEK: return createUtcDateTime(QDate(y, m, d).addDays(-dow + 1));
|
||||
case DateTimePeriod::MONTH: return createUtcDateTime(QDate(y, m, 1));
|
||||
case DateTimePeriod::QUARTER: return createUtcDateTime(QDate(y, ((m - 1) / 3) * 3 + 1, 1));
|
||||
case DateTimePeriod::HALFYEAR: return createUtcDateTime(QDate(y, ((m - 1) / 6) * 6 + 1, 1));
|
||||
case DateTimePeriod::YEAR: return createUtcDateTime(QDate(y, 1, 1));
|
||||
case DateTimePeriod::DECADE: return createUtcDateTime(QDate((y / 10) * 10, 1, 1));
|
||||
}
|
||||
CVF_ASSERT(false);
|
||||
return createUtcDateTime();
|
||||
@@ -300,17 +307,35 @@ QDateTime RiaQDateTimeTools::truncateTime(const QDateTime& dt, DateTimePeriod pe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<DateTimePeriodInfo> RiaQDateTimeTools::dateTimePeriodInfoList()
|
||||
std::vector<DateTimePeriod> RiaQDateTimeTools::dateTimePeriods()
|
||||
{
|
||||
return std::vector<DateTimePeriodInfo>(
|
||||
return std::vector<DateTimePeriod>(
|
||||
{
|
||||
{ DateTimePeriod::NONE, "None" },
|
||||
{ DateTimePeriod::DECADE, "Decade" },
|
||||
{ DateTimePeriod::YEAR, "Year" },
|
||||
{ DateTimePeriod::HALFYEAR, "Half Year" },
|
||||
{ DateTimePeriod::QUARTER, "Quarter" },
|
||||
{ DateTimePeriod::MONTH, "Month" },
|
||||
{ DateTimePeriod::WEEK, "Week" },
|
||||
{ DateTimePeriod::DAY, "Day" },
|
||||
DateTimePeriod::NONE,
|
||||
DateTimePeriod::DAY,
|
||||
DateTimePeriod::WEEK,
|
||||
DateTimePeriod::MONTH,
|
||||
DateTimePeriod::QUARTER,
|
||||
DateTimePeriod::HALFYEAR,
|
||||
DateTimePeriod::YEAR,
|
||||
DateTimePeriod::DECADE,
|
||||
});
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaQDateTimeTools::dateTimePeriodName(DateTimePeriod period)
|
||||
{
|
||||
switch (period)
|
||||
{
|
||||
case DateTimePeriod::DAY: return TIMESPAN_DAY_NAME;
|
||||
case DateTimePeriod::WEEK: return TIMESPAN_WEEK_NAME;
|
||||
case DateTimePeriod::MONTH: return TIMESPAN_MONTH_NAME;
|
||||
case DateTimePeriod::QUARTER: return TIMESPAN_QUARTER_NAME;
|
||||
case DateTimePeriod::HALFYEAR: return TIMESPAN_HALFYEAR_NAME;
|
||||
case DateTimePeriod::YEAR: return TIMESPAN_YEAR_NAME;
|
||||
case DateTimePeriod::DECADE: return TIMESPAN_DECADE_NAME;
|
||||
default: return "None";
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,6 @@ class QDateTime;
|
||||
class QDate;
|
||||
class QTime;
|
||||
class DateTimeSpan;
|
||||
class DateTimePeriodInfo;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
@@ -38,13 +37,13 @@ class DateTimePeriodInfo;
|
||||
enum class DateTimePeriod
|
||||
{
|
||||
NONE = -1,
|
||||
DECADE,
|
||||
YEAR,
|
||||
HALFYEAR,
|
||||
QUARTER,
|
||||
MONTH,
|
||||
DAY,
|
||||
WEEK,
|
||||
DAY
|
||||
MONTH,
|
||||
QUARTER,
|
||||
HALFYEAR,
|
||||
YEAR,
|
||||
DECADE
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -52,15 +51,23 @@ enum class DateTimePeriod
|
||||
//==================================================================================================
|
||||
class RiaQDateTimeTools
|
||||
{
|
||||
static const DateTimeSpan TIMESPAN_DECADE;
|
||||
static const DateTimeSpan TIMESPAN_YEAR;
|
||||
static const DateTimeSpan TIMESPAN_HALFYEAR;
|
||||
static const DateTimeSpan TIMESPAN_QUARTER;
|
||||
static const DateTimeSpan TIMESPAN_MONTH;
|
||||
static const DateTimeSpan TIMESPAN_WEEK;
|
||||
static const DateTimeSpan TIMESPAN_DAY;
|
||||
static const DateTimeSpan TIMESPAN_WEEK;
|
||||
static const DateTimeSpan TIMESPAN_MONTH;
|
||||
static const DateTimeSpan TIMESPAN_QUARTER;
|
||||
static const DateTimeSpan TIMESPAN_HALFYEAR;
|
||||
static const DateTimeSpan TIMESPAN_YEAR;
|
||||
static const DateTimeSpan TIMESPAN_DECADE;
|
||||
|
||||
public:
|
||||
static const QString TIMESPAN_DAY_NAME;
|
||||
static const QString TIMESPAN_WEEK_NAME;
|
||||
static const QString TIMESPAN_MONTH_NAME;
|
||||
static const QString TIMESPAN_QUARTER_NAME;
|
||||
static const QString TIMESPAN_HALFYEAR_NAME;
|
||||
static const QString TIMESPAN_YEAR_NAME;
|
||||
static const QString TIMESPAN_DECADE_NAME;
|
||||
|
||||
static Qt::TimeSpec currentTimeSpec();
|
||||
|
||||
static QDateTime fromString(const QString& dateString, const QString& format);
|
||||
@@ -89,7 +96,8 @@ public:
|
||||
static const DateTimeSpan timeSpan(DateTimePeriod period);
|
||||
static QDateTime truncateTime(const QDateTime& dt, DateTimePeriod period);
|
||||
|
||||
static std::vector<DateTimePeriodInfo> dateTimePeriodInfoList();
|
||||
static std::vector<DateTimePeriod> dateTimePeriods();
|
||||
static QString dateTimePeriodName(DateTimePeriod period);
|
||||
|
||||
private:
|
||||
static quint64 secondsInDay();
|
||||
@@ -116,13 +124,3 @@ private:
|
||||
int m_months;
|
||||
int m_days;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class DateTimePeriodInfo
|
||||
{
|
||||
public:
|
||||
DateTimePeriod period;
|
||||
QString name;
|
||||
};
|
@@ -90,7 +90,7 @@ void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
|
||||
QString title = summaryPlot->description();
|
||||
QString text = summaryPlot->asciiDataForPlotExport();
|
||||
|
||||
RicShowPlotDataFeature::showTextWindow(title, text);
|
||||
RicShowPlotDataFeature::showTabbedTextWindow(title, [summaryPlot](DateTimePeriod period) { return summaryPlot->asciiDataForPlotExport(period); });
|
||||
}
|
||||
|
||||
for (RimWellLogPlot* wellLogPlot : wellLogPlots)
|
||||
@@ -115,6 +115,25 @@ void RicShowPlotDataFeature::setupActionLook(QAction* actionToSetup)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowPlotDataFeature::showTabbedTextWindow(const QString& title, std::function<QString(DateTimePeriod)> textProvider)
|
||||
{
|
||||
RiuPlotMainWindow* plotwindow = RiaApplication::instance()->mainPlotWindow();
|
||||
CVF_ASSERT(plotwindow);
|
||||
|
||||
RiuShowTabbedPlotDataDialog* textWiget = new RiuShowTabbedPlotDataDialog();
|
||||
textWiget->setMinimumSize(800, 600);
|
||||
|
||||
textWiget->setWindowTitle(title);
|
||||
textWiget->setTextProvider(textProvider);
|
||||
|
||||
textWiget->show();
|
||||
|
||||
plotwindow->addToTemporaryWidgets(textWiget);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowPlotDataFeature::showTextWindow(const QString& title, const QString& text)
|
||||
{
|
||||
RiuPlotMainWindow* plotwindow = RiaApplication::instance()->mainPlotWindow();
|
||||
|
@@ -18,9 +18,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
|
||||
#include <functional>
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@@ -36,7 +38,8 @@ protected:
|
||||
virtual void setupActionLook( QAction* actionToSetup );
|
||||
|
||||
public:
|
||||
static void showTextWindow(const QString& title, const QString& text);
|
||||
static void showTabbedTextWindow(const QString& title, std::function<QString(DateTimePeriod)> textProvider);
|
||||
static void RicShowPlotDataFeature::showTextWindow(const QString& title, const QString& text);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -93,7 +93,7 @@ RicResampleDialogResult RicResampleDialog::openDialog(QWidget *parent /*= 0*/,
|
||||
if(!caption.isEmpty()) dialog.setWindowTitle(caption);
|
||||
else dialog.setWindowTitle(DEFAULT_DIALOG_TITLE);
|
||||
|
||||
dialog.setPeriodOptions(RiaQDateTimeTools::dateTimePeriodInfoList());
|
||||
dialog.setPeriodOptions(RiaQDateTimeTools::dateTimePeriods());
|
||||
|
||||
dialog.resize(DEFAULT_DIALOG_WIDTH, DEFAULT_DIALOG_HEIGHT);
|
||||
dialog.exec();
|
||||
@@ -104,13 +104,13 @@ RicResampleDialogResult RicResampleDialog::openDialog(QWidget *parent /*= 0*/,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicResampleDialog::setPeriodOptions(const std::vector<DateTimePeriodInfo>& dateTimePeriodInfos)
|
||||
void RicResampleDialog::setPeriodOptions(const std::vector<DateTimePeriod>& dateTimePeriods)
|
||||
{
|
||||
QStringList s;
|
||||
for (auto& item : dateTimePeriodInfos)
|
||||
for (auto& period : dateTimePeriods)
|
||||
{
|
||||
QString text = item.period != DateTimePeriod::NONE ? item.name : "No Resampling";
|
||||
m_timePeriodCombo->addItem(text, QVariant((int)item.period));
|
||||
QString text = period != DateTimePeriod::NONE ? RiaQDateTimeTools::dateTimePeriodName(period) : "No Resampling";
|
||||
m_timePeriodCombo->addItem(text, QVariant((int)period));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
const QString& caption = QString());
|
||||
|
||||
private:
|
||||
void setPeriodOptions(const std::vector<DateTimePeriodInfo>& dateTimePeriodInfos);
|
||||
void setPeriodOptions(const std::vector<DateTimePeriod>& dateTimePeriods);
|
||||
DateTimePeriod selectedDateTimePeriod() const;
|
||||
|
||||
private slots:
|
||||
|
@@ -4,6 +4,7 @@
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// 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.
|
||||
//
|
||||
@@ -19,13 +20,16 @@
|
||||
#include "RiuTextDialog.h"
|
||||
#include "RiuTools.h"
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QBoxLayout>
|
||||
#include <QClipboard>
|
||||
#include <QMenu>
|
||||
#include <QTabWidget>
|
||||
|
||||
|
||||
#include <cvfAssert.h>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -156,3 +160,124 @@ void RiuTextDialog::contextMenuEvent(QContextMenuEvent* event)
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuShowTabbedPlotDataDialog::RiuShowTabbedPlotDataDialog(QWidget* parent /*= nullptr*/)
|
||||
: QDialog(parent, RiuTools::defaultDialogFlags())
|
||||
{
|
||||
m_tabWidget = new QTabWidget(this);
|
||||
|
||||
connect(m_tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotTabChanged(int)));
|
||||
|
||||
for(auto timePeriod : RiaQDateTimeTools::dateTimePeriods())
|
||||
{
|
||||
QString tabTitle =
|
||||
timePeriod == DateTimePeriod::NONE ? "No Resampling" :
|
||||
QString("Plot Data, %1").arg(RiaQDateTimeTools::dateTimePeriodName(timePeriod));
|
||||
|
||||
RiuQPlainTextEdit* textEdit = new RiuQPlainTextEdit();
|
||||
textEdit->setReadOnly(true);
|
||||
textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
|
||||
|
||||
QFont font("Courier", 8);
|
||||
textEdit->setFont(font);
|
||||
textEdit->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
m_tabWidget->addTab(textEdit, tabTitle);
|
||||
}
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout();
|
||||
layout->addWidget(m_tabWidget);
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuShowTabbedPlotDataDialog::setTextProvider(std::function<QString(DateTimePeriod)> textProvider)
|
||||
{
|
||||
m_textProvider = textProvider;
|
||||
|
||||
updateText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuQPlainTextEdit * RiuShowTabbedPlotDataDialog::currentTextEdit() const
|
||||
{
|
||||
return dynamic_cast<RiuQPlainTextEdit*>(m_tabWidget->currentWidget());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
DateTimePeriod RiuShowTabbedPlotDataDialog::indexToPeriod(int index)
|
||||
{
|
||||
auto currTabTitle = m_tabWidget->tabText(index);
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_DAY_NAME)) return DateTimePeriod::DAY;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_WEEK_NAME)) return DateTimePeriod::WEEK;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_MONTH_NAME)) return DateTimePeriod::MONTH;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_QUARTER_NAME)) return DateTimePeriod::QUARTER;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_HALFYEAR_NAME)) return DateTimePeriod::HALFYEAR;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_YEAR_NAME)) return DateTimePeriod::YEAR;
|
||||
if (currTabTitle.contains(RiaQDateTimeTools::TIMESPAN_DECADE_NAME)) return DateTimePeriod::DECADE;
|
||||
return DateTimePeriod::NONE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuShowTabbedPlotDataDialog::updateText()
|
||||
{
|
||||
auto textEdit = currentTextEdit();
|
||||
auto currIndex = m_tabWidget->currentIndex();
|
||||
if (textEdit && textEdit->toPlainText().isEmpty() && m_textProvider)
|
||||
{
|
||||
textEdit->setPlainText(m_textProvider(indexToPeriod(currIndex)));
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuShowTabbedPlotDataDialog::slotTabChanged(int index)
|
||||
{
|
||||
updateText();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuShowTabbedPlotDataDialog::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
QMenu menu;
|
||||
RiuQPlainTextEdit* textEdit = dynamic_cast<RiuQPlainTextEdit*>(m_tabWidget->currentWidget());
|
||||
|
||||
{
|
||||
|
||||
QAction* actionToSetup = new QAction(this);
|
||||
|
||||
actionToSetup->setText("Copy");
|
||||
actionToSetup->setIcon(QIcon(":/Copy.png"));
|
||||
actionToSetup->setShortcuts(QKeySequence::Copy);
|
||||
|
||||
connect(actionToSetup, SIGNAL(triggered()), textEdit, SLOT(slotCopyContentToClipboard()));
|
||||
|
||||
menu.addAction(actionToSetup);
|
||||
}
|
||||
|
||||
{
|
||||
QAction* actionToSetup = new QAction(this);
|
||||
|
||||
actionToSetup->setText("Select All");
|
||||
actionToSetup->setShortcuts(QKeySequence::SelectAll);
|
||||
|
||||
connect(actionToSetup, SIGNAL(triggered()), textEdit, SLOT(slotSelectAll()));
|
||||
|
||||
menu.addAction(actionToSetup);
|
||||
}
|
||||
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
|
@@ -18,10 +18,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <QPlainTextEdit>
|
||||
|
||||
#include <functional>
|
||||
|
||||
class QTabWidget;
|
||||
class RimSummaryPlot;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiuQPlainTextEdit : public QPlainTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -57,4 +67,30 @@ protected:
|
||||
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
class RiuShowTabbedPlotDataDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit RiuShowTabbedPlotDataDialog(QWidget* parent = nullptr);
|
||||
|
||||
void setTextProvider(std::function<QString (DateTimePeriod)> textProvider);
|
||||
|
||||
private:
|
||||
RiuQPlainTextEdit * currentTextEdit() const;
|
||||
DateTimePeriod indexToPeriod(int index);
|
||||
void updateText();
|
||||
|
||||
QTabWidget* m_tabWidget;
|
||||
std::function<QString(DateTimePeriod)> m_textProvider;
|
||||
|
||||
private slots:
|
||||
void slotTabChanged(int index);
|
||||
|
||||
protected:
|
||||
virtual void contextMenuEvent(QContextMenuEvent *) override;
|
||||
};
|
||||
|
||||
|
@@ -99,7 +99,7 @@ void PdmUiCommandSystemProxy::setUiValueToField(PdmUiFieldHandle* uiFieldHandle,
|
||||
{
|
||||
std::vector<PdmUiItem*> items;
|
||||
SelectionManager::instance()->selectedItems(items, SelectionManager::CURRENT);
|
||||
SelectionManager::instance()->selectedItems(items, SelectionManager::APPLICATION_GLOBAL);
|
||||
//SelectionManager::instance()->selectedItems(items, SelectionManager::APPLICATION_GLOBAL);
|
||||
|
||||
for (size_t i = 0; i < items.size(); i++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user