
Originally Posted by
wysota
Hard to say without seeing any code.
It's quite basic. Here are the important bits (unless you want to see the drawing code).
GlWindow::GlWindow()
{
// GLBox* c = new GLBox(this); // <-- displays properly
GLItemView* c = new GLItemView(this); // <-- doesnt display properly
setCentralWidget(c);
}
GlWindow::GlWindow()
: QMainWindow()
{
// GLBox* c = new GLBox(this); // <-- displays properly
GLItemView* c = new GLItemView(this); // <-- doesnt display properly
setCentralWidget(c);
}
To copy to clipboard, switch view to plain text mode
GLItemView
::GLItemView(QWidget* parent
){
GLBox* box = new GLBox(parent);
setViewport(box);
}
GLItemView::GLItemView(QWidget* parent)
: QAbstractItemView(parent)
{
GLBox* box = new GLBox(parent);
setViewport(box);
}
To copy to clipboard, switch view to plain text mode
Images of it working as a normal widget and non-working as a viewport. (full source attached).
Bookmarks