Hi,
You can set contents margin layout with 0 like this :
Qt Code:
  1. centralwidget = new QWidget(MainWindow);
  2. gridLayout->setSpacing(0);
  3. gridLayout->setContentsMargins(0, 0, 0, 0);
To copy to clipboard, switch view to plain text mode 

And set QPlainTextEdit frameShape to QFrame::NoFrame.
Qt Code:
  1. plainTextEdit->setFrameShape(QFrame::NoFrame);
  2. plainTextEdit->setLineWidth(0);
To copy to clipboard, switch view to plain text mode 

Are this metod solve your problem?
Thank you.

Best regards,

Toto