Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
4.5.3
-
None
-
None
-
Windows XP, Visual Studio 2005
Description
Copying simple plain text data does not work any more! It used to work with version 4.4.3, then the exactly same code did not work any more with versions 4.5.1 and 4.5.3.
Code snippet:
====================
std::ostringstream ostr;
// data is streamed into ostr with << operator
// ....
// Plain Windows API version
// Note: Since version 4.5.1, QClipboard does not seem to work any more (!??)
/*
QByteArray plainText(ostr.str().c_str());
if(OpenClipboard(0))
*/
// Qt clipboard functions version that does not work any more since version 4.5.1
QClipboard* clipboard = QApplication::clipboard();
clipboard->setText(ostr.str().c_str());
====================
More details:
Using a clipboard list tool and running the code with Qt version 4.4.3, I saw the following data types on the clipboard after a "copy":
DataObject
Unicode Text
Plain Text
Ole Private Data
Locale Identifier
OEM Text
With version 4.5.3, I simply get an empty clipboard!
Finally, the version that directly calls the Windows API functions as shown above in the code snippet, I am getting:
Plain Text
Locale Identifier
OEM Text
Unicode Text
which is more than enough for my program!
For my part, I can live with the direct Windows API calls, but it is not pretty anyway - and others may have more trouble!