Commit 65b1be45 authored by Joachim Pouderoux's avatar Joachim Pouderoux Committed by Kitware Robot

Merge topic 'AddStatusBarMessageWhenCopyViewToClipboard'

f2c05eae Add a status bar message to inform when view content is copied to clipboard
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Mathieu Westphal's avatarMathieu Westphal <mathieu.westphal@kitware.com>
Merge-request: !3173
parents 8ce81b84 f2c05eae
Pipeline #134358 running with stage
......@@ -58,7 +58,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QClipboard>
#include <QDebug>
#include <QFileInfo>
#include <QMainWindow>
#include <QMimeData>
#include <QStatusBar>
//-----------------------------------------------------------------------------
pqSaveScreenshotReaction::pqSaveScreenshotReaction(QAction* parentObject, bool clipboardMode)
......@@ -285,5 +287,12 @@ bool pqSaveScreenshotReaction::copyScreenshotToClipboard(const QSize& size, bool
QMimeData* data = new QMimeData;
data->setImageData(qimg);
QApplication::clipboard()->setMimeData(data);
QMainWindow* mainWindow = qobject_cast<QMainWindow*>(pqCoreUtilities::mainWidget());
if (mainWindow)
{
mainWindow->statusBar()->showMessage(
tr("View content has been copied to the clipboard."), 2000);
}
return true;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment