ColumnChooser - Drag&Drop problem with special Characters and QT 4.6.8

... the .toUTF8() conversion used with QT5.3.x to handle special
characters (e.g. german Umlaute) in column chooser does not work for QT
4.8.6 (at least not for the Windows) - as a result (Drag&Drop from those
fields into Columns or Search Field is not working)
... following the approach other places, changed approach to
"serialization" of the info for "Drag&Drop" - so work independent on any
QT conversions (which seem to depend on other conditions - change over
time)
This commit is contained in:
Joern
2014-07-21 19:11:49 +02:00
parent b0f6fc2b6a
commit 381c43cab8
2 changed files with 20 additions and 6 deletions

View File

@@ -290,7 +290,12 @@ SearchBox::dragEnterEvent(QDragEnterEvent *event)
void
SearchBox::dropEvent(QDropEvent *event)
{
QString name = event->mimeData()->data("application/x-columnchooser");
QByteArray rawData = event->mimeData()->data("application/x-columnchooser");
QDataStream stream(&rawData, QIODevice::ReadOnly);
stream.setVersion(QDataStream::Qt_4_6);
QString name;
stream >> name;
// fugly, but it works for BikeScore with the (TM) in it... so...
// independent of Latin1 or UTF-8 coming from "Column Chooser" the "TM" special sign is not recognized by the parser,
// so strip the "TM" off for this case (only)