Hi, the simples would be to pass the GatewayWidget to myshape during construction, e.g.
Qt Code:
  1. void GatewayWidget::receivedTitlesEx(...)
  2. {
  3. myshape* shape1 = new myshape(text, this);
  4. ...
  5. }
To copy to clipboard, switch view to plain text mode 
and store the pointer in a member.

Ginsengelf

EDIT: or emit a signal instead of calling the function directly