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
This commit is contained in:
g_j_m 2005-10-25 01:33:38 +00:00
parent 8f31f4d47d
commit 0f5e4421fb

View File

@ -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)