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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.3.1
    • GUI: Drag and Drop
    • None
    • 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

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              kovid Kovid Goyal
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes