On Tutorial example on Qt

Hello, I am a beginner of OCC, and interested in OCC with Qt.

I spent long time to compile OCC 6.5.0 including 3rd-party library, because I have MSVC 2008 and I cannot use the prebuilt binary.

Then I run the "Tutorial" with Qt, but I regreted the poor performance. The screen is flickering when resizing the window, and also has some problem in rubberbands.

For some struggling, I can solve the problem.

(1) add to View class,

QPaintEngine* paintEngine() const { return NULL; }

That's all. But I don't know the reason. Do anybody know the reason ?

The second minor problem in the tutorial is that the object in DynamicRotation mode is changed to solid representation even though wireframe setting. That can be solved by adding comment

case CurAction3d_DynamicRotation:
// if ( !myDegenerateModeIsOn )
// myView->SetDegenerateModeOn();
myView->StartRotation( point.x(), point.y() );
break;

Regards.

Sharjith Naramparambath's picture

Hello Jeong-Rae,

Is this problem coming up on Windows7? I have rubberbanding screen refresh issues on Windows7 pretty much on every OpenGL application. The GDI rectangle drawing doesn't refresh the OpenGL screen correctly. This happens for me only on Windows7 and not on XP.

Jeong-Rae CHO's picture

My platform is Windows 7, Qt 4.7.2, MSVC 2008.
I am sorry not to know what kind of problem is issued.

Patrik Mueller's picture

Hi,

Microsoft changed its OpenGL driver interface for Vista and Windows7. Mixing GDI and OpenGL should be avoided!! Try to use an OpenGL implementation for rubberbanding!

Greets,

Patrik

Jeong-Rae CHO's picture

I solved the problem in rubberbanding. Simply I call repaint() after show() method in QRubberBand as folllowings:

void View::DrawRectangle(...)
{
...

myRectBand->show();
myRectBand->repaint(); // added... immediately paint the rubberband
...
}