I am doing the following to add my class (directX) in a QHBoxLayout:

Qt Code:
  1. Window::Window(QWidget* parent)
  2. : QWidget(0) // top-level, no parent
  3. {
  4. ui.setupUi(this);
  5.  
  6. QHBoxLayout *layout = new QHBoxLayout();
  7. setLayout(layout);
  8. layout->addWidget(new QD3DWidget(this));
  9. }
To copy to clipboard, switch view to plain text mode 

Everything works perfectly, but would like to use the QT Designer,
So I created a QHBoxLayout but I can not add in my QD3DWidget QHBoxLayout, I'm trying something like:
Qt Code:
  1. Window::Window(QWidget* parent)
  2. : QWidget(0) // top-level, no parent
  3. {
  4. ui.setupUi(this);
  5.  
  6. ui.horizontalLayout->addWidget(new QD3DWidget(this));
  7. }
To copy to clipboard, switch view to plain text mode 

The viewport directx does not appear, only a white window appears, and I set to be blue in directX,and when I make the code directly (without ui) it is blue

Thanks