mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2167 statistics dialog. Screen dump to clipboard or file
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicSnapshotViewToClipboardFeature.h"
|
||||
#include "RicGridStatisticsDialog.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
@@ -39,6 +40,34 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicSnapshotViewToClipboardFeature, "RicSnapshotViewToClipboardFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSnapshotViewToClipboardFeature::copyToClipboard(const QImage& image)
|
||||
{
|
||||
QClipboard* clipboard = QApplication::clipboard();
|
||||
if (clipboard)
|
||||
{
|
||||
clipboard->setImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QIcon RicSnapshotViewToClipboardFeature::icon()
|
||||
{
|
||||
return QIcon(":/SnapShot.png");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RicSnapshotViewToClipboardFeature::text()
|
||||
{
|
||||
return "Snapshot To Clipboard";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -75,6 +104,6 @@ void RicSnapshotViewToClipboardFeature::onActionTriggered(bool isChecked)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSnapshotViewToClipboardFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Snapshot To Clipboard");
|
||||
actionToSetup->setIcon(QIcon(":/SnapShot.png"));
|
||||
actionToSetup->setText(text());
|
||||
actionToSetup->setIcon(icon());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user