I have a function which returns selected text only from qtextedit. I need to get plain text, but this function returns text with some control characters.
For example: function textEdit->textCursor().selectedText() return:
"select? timestamp,? strftime('%d.%m.%Y', Datetime(timestamp, 'unixepoch', 'localtime')) as date,? strftime('%H:%M:%S', Datetime(timestamp, 'unixepoch', 'localtime')) as time,? author,? from_dispname,? dialog_partner,? body_xml?from? Messages?where? timestamp >= 1501504199? -- timestamp >= 1502345001?order by? timestamp asc"
function textEdit->toPlainText() return:
"select\n timestamp,\n strftime('%d.%m.%Y', Datetime(timestamp, 'unixepoch', 'localtime')) as date,\n strftime('%H:%M:%S', Datetime(timestamp, 'unixepoch', 'localtime')) as time,\n author,\n from_dispname,\n dialog_partner,\n body_xml\nfrom\n Messages\nwhere\n timestamp >= 1501504199\n -- timestamp >= 1502345001\norder by\n timestamp asc"
In first example are ?(question mark) without enters and I am not able to replace them.
What am I doing wrong?