QClipboard: setting only owner, not data

  • We are planning to port a GTK+ application to Qt.
    In GTK+ you can set the clipboard with a "owner": the system clipboard will never be loaded with real data, only with MIME type(s). When later the data will be really needed, for example when the user pastes it inside another application, a callback/signal to your application is called, and your application will build and provide the data.
    All is accomplished with the function gtk_clipboard_set_with_owner(). This should be the equivalent of X11 function XSetSelectionOwner(). Under windows you can use SetClipboardData() with a NULL handle, and your window will receive WM_RENDERFORMAT/WM_RENDERALLFORMATS message later to provide the data.

    Is there a similar pattern/usage for Qt?

    Thank you.

  • Lifetime Qt Champion

    Hi welcome to devnet,

    Based on the QClipboard documentation, it seems that you don't have the same options as in GTK+.

Log in to reply