I was not able to use QHBoxLayout,

When I use
Qt Code:
  1. MyDoubleSpinBox2 *editor = new MyDoubleSpinBox2(parent);
  2.  
  3. QToolButton *tool;
  4. tool = new QToolButton();
  5. tool->setText("...");
  6.  
  7. QHBoxLayout layout;
  8. layout.addWidget(editor);
  9. layout.addWidget(tool);
To copy to clipboard, switch view to plain text mode 

I could not see tool button