Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41125

On windows text copied to the clipboard is lost when application quits

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.3.1
    • Fix Version/s: None
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Environment:
      Windows 8 64 bit

      Description

      On Windows, text copied to the clipboard is lost when application quits. This is a regression from earlier versions of Qt and is probably caused by the fix for https://bugreports.qt-project.org/browse/QTBUG-36958

      Workaround is to subclass QApplication and in the exec() method of the subclass manually call OleFlushClipboard() before returning. Python code demonstrating this follows:

          if iswindows:
              def exec_(self):
                  try:
                      return QApplication.exec_()
                  finally:
                      try:
                          if self.clipboard().ownsClipboard():
                              import ctypes
                              ctypes.WinDLL('ole32.dll').OleFlushClipboard()
                      except Exception:
                          import traceback
                          traceback.print_exc()
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kovid Kovid Goyal
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes