Qt and OSG integration issue, disappearing scene graph

So, I ran into a problem when integrating QT and OSG. I had a QT / OSG program that works fine. The layout is similar to what you see below.

|--------------------------|
|  1   |         2         |
|      |                   |
|      |                   |
|      |                   |
|      |                   |
|      |                   |
|      |-------------------|
|      |         3         |
|      |                   |
|--------------------------|

The central widget consists of a QFrame, which has three helper widgets and uses a grid. Widget 1 is a QFrame also with a grid layout. Widget 2 is an OSG viewer, as described below. Widget 3 is a QFrame with a grid layout.

Two objects are filled with widgets modeled after the example in osgviewerQT.cpp. It mainly uses the built-in window, and I have a QTimer that fires every 10 milliseconds and calls the osg frame function.

4 . QLabels QTables, . 1 . , , 2. , 1 2 , . , ? valgrind, , , , lib. , frame .

+3
2

: viewer. - :

AbstractQTGLWidget.hpp:

...
class AbstractQTGLWidget ... {
  ...
protected:
  QSize sizeHint() const { return QSize(400,300); }
  ...
};

( 100% ), , width() height().

, , .

, , osg . , , .

, , 0 0 , ...

0: with 0

1: With 1

+2

, . OpenSceneGraph ( OpenThreads).

, QFrame OSG.

, , :

 viewer->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+1

All Articles