Advertisement
dazzle191

Kursa4 fixes

Jun 14th, 2023 (edited)
1,834
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <QClipboard>
  2.  
  3. void ChatWindow::on_textEdit_cursorPositionChanged()
  4. {
  5.     QClipboard* buf = QApplication::clipboard();
  6.  
  7.     QTextCursor cursor = ui->textEdit->textCursor();
  8.     cursor.select(QTextCursor::LineUnderCursor);
  9.     ui->textEdit->copy();
  10.  
  11.     QString str = buf->text();
  12.     str.remove(0, 9);
  13.     buf->setText(str);
  14.  
  15.     ui->textEdit->setTextCursor(cursor);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement