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

QClipboard::text: Warning 'Retrying to obtain clipboard'

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.0
    • QPA: Windows
    • None
    • Windows

    Description

      A call of functionQClipboard::text as immediate response to a signal QClipboard::changed causes frequently the warning 'Retrying to obtain clipboard'. I found the following code in qwindowsclipboard.cpp:

      IDataObject *QWindowsClipboardRetrievalMimeData::retrieveDataObject() const
      {
          enum : int { attempts = 3 };
          IDataObject * pDataObj = nullptr;
          // QTBUG-53979, retry in case the other application has clipboard locked
          for (int i = 1; i <= attempts; ++i) {
              if (SUCCEEDED(OleGetClipboard(&pDataObj))) {
                  if (QWindowsContext::verbose > 1)
                      qCDebug(lcQpaMime) << __FUNCTION__ << pDataObj;
                  return pDataObj;
              }
              qCWarning(lcQpaMime, i == attempts
                        ? "Unable to obtain clipboard."
                        : "Retrying to obtain clipboard.");
              QThread::msleep(50);
          }
      
          return nullptr;
      }
      

      Possible fix: Issue only the warning 'Unable to obtain clipboard'.
      The bug is obviously related to QTBUG-53979 and possibly to QTBUG-27097.

      Attachments

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

        Activity

          People

            owolff Oliver Wolff
            wschenke Winfried Schenke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes