Did you try something like:
Qt Code:
  1. QHeaderView *header = myTreeWidget->header();
  2. QPushButton *button = new QPushButton("PushMe", header);
  3. QHBoxLayout *layout = new QHBoxLayout(header);
  4. layout->addStretch();
  5. layout->addWidget(button);
To copy to clipboard, switch view to plain text mode 

I don't know if this works, I'm just spitballing here