I am doing the following to add my class (directX) in a QHBoxLayout:
: QWidget(0) // top-level, no parent {
ui.setupUi(this);
setLayout(layout);
layout->addWidget(new QD3DWidget(this));
}
Window::Window(QWidget* parent)
: QWidget(0) // top-level, no parent
{
ui.setupUi(this);
QHBoxLayout *layout = new QHBoxLayout();
setLayout(layout);
layout->addWidget(new QD3DWidget(this));
}
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:
: QWidget(0) // top-level, no parent {
ui.setupUi(this);
ui.horizontalLayout->addWidget(new QD3DWidget(this));
}
Window::Window(QWidget* parent)
: QWidget(0) // top-level, no parent
{
ui.setupUi(this);
ui.horizontalLayout->addWidget(new QD3DWidget(this));
}
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
Bookmarks