From 0f5e4421fbafdc26ba43d5d24ebcd630114a29ce Mon Sep 17 00:00:00 2001 From: g_j_m Date: Tue, 25 Oct 2005 01:33:38 +0000 Subject: [PATCH] Mods after testing the copy/paste of attribute table data through a Windows X server. Still requires testing on a Windows and Mac version of Qgis git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4132 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgsattributetable.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/qgsattributetable.cpp b/src/qgsattributetable.cpp index 6df25ab2dd7..0e2c63930f1 100644 --- a/src/qgsattributetable.cpp +++ b/src/qgsattributetable.cpp @@ -398,8 +398,18 @@ void QgsAttributeTable::copySelectedRows() std::cerr << "Selected data in table is:\n" << toClipboard; #endif // And then copy to the clipboard - QClipboard* clipboard = QApplication::clipboard(); - clipboard->setText(toClipboard); + QClipboard* clipboard = QApplication::clipboard(); + + // With qgis running under Linux, but with a Windows based X + // server (Xwin32), ::Selection was necessary to get the data into + // the Windows clipboard (which seems contrary to the Qt + // docs). With a Linux X server, ::Clipboard was required. + // The simple solution was to put the text into both clipboards. + + // The ::Selection setText() below one may need placing inside so + // #ifdef so that it doesn't get compiled under Windows. + clipboard->setText(toClipboard, QClipboard::Selection); + clipboard->setText(toClipboard, QClipboard::Clipboard); } bool QgsAttributeTable::commitChanges(QgsVectorLayer* layer)