Important: Please read the Qt Code of Conduct -

Copy from QPlainTextEdit to Excel

  • I have filled a QPlainTextEdit with Text in a table form, means I have lines with Tab-separated fields.
    When I copy the contend via Ctrl-A Ctrl-C and paste into Excel I get only on cell per line.
    It looks as if the Tab is missing in the Clipboard text, but when I copy in into a text-editor is has Tabs (When I copy this text again in the Clipboard and paste it into Excel it works again.)
    Then I have tried to copy the PlainTextEdit-content via code to the clipboard. The pasting with this clipboard contents works corrent.

    So my question what makes Qt when I copy via Ctrl-C ????

  • Moderators

    @Andy314 said:

    So my question what makes Qt when I copy via Ctrl-C ????

    The widget puts the selected content into the clipboard in various different formats (text/plain, text/html, etc.)
    The target application takes the one it thinks it is the most appropriate for pasting. So you don't have any influence on that. Only by choosing what is offered in the first place.

    There are clipboard inspectors available. Or you even can simply build one yourself with Qt, it's quite easy. And check what are the contents of the clipboard.

Log in to reply