Qt4/Opencascade example

Hi,

I just started using Opencasade with qt4. I first tried porting qt3 example to qt4, but my application crashes when a new document is initialized. It is very frustrating that I am stuck. Debugging didn't help me much.

I tried Dolbey's only possible solution so far using Qt4. It works great but it is not a MDI example. Rubberband creation too seems to not work for me.
Can anyone please help me with an Opencascade/Qt4 example? an extention of Dolbey's example with MDI window or any other possible solution to this problem is very much appreciated. Please Help.

Gaurav

P Dolbey's picture

Hi Guarav

I've been kind of busy lately and not had much time to work on the QtOCC project on sourceforge as I'd like (http://sourceforge.net/projects/qtocc), but I'm slowly getting back into it.

The reason for my not using MDI in QtOCC is twofold.

Firstly I don't like MDI apps - they make the overhead of developing a user interaction model more complicated than it should be. I can't think of many CAD applications that benefit from an MDI metaphore - even Microsoft have pretty much given up on it with Office 200X products.

Secondly, from a developer's perpective MDI adds a level of complexity that is not well supported by the current MFC or Qt examples. In particular, Qt4 offers specific classes that support the MDI pattern, but these have not been implemented. Instead, the standard Qt3 examples have implemented their own solution. I spent a lot of time unpicking this solution to develop OCC widgets that are self contained. I have proved this in the past by developing a multi-tabbed application capable of supporting multiple viewer instances in the same window, but I haven't taken it back to the MDI model yet. If you want this then there's nothing stopping you from raising a feature request on the qtocc site. I'm thinking of developing a looser coupling to the GEOM library to support this type of change.

There was a specific problem with rubber-banding using Qt 4.4.0 with the QRubberBand class as a result of the significant changes made to the way that widgets are rendered. I have fixed this in the Qocc3dWidget class found in the qtgeom application in the SVN trunk on sourceforge. (Note that Qt 4.4.1 appeared over the week-end). The necessary changes can be seen here, and should be valid for the QtOCCHarness sample.

http://qtocc.svn.sourceforge.net/viewvc/qtocc/trunk/qtgeom/src/qocc/qocc...

Pete

p.s. for anyone interested, I have also started a collection of Open CASCADE patches on the qtocc subversion site - you can see them here

http://qtocc.svn.sourceforge.net/viewvc/qtocc/ros/

This enables you you see the full change history from the original 6.2.0 versions, but I have only tested these changes on Windows. If anyone has any other patches they would like to contribute to this mini-project, contact me at "peter at dolbey dot freeserve dot co dot uk"

Gaurav Sharma's picture

Dolbey,
Your reply gives me peace of mind. I now abandon my efforts to create MDI paradigm based application using qt4. I thank you and other people in your qtocc team for doing nice work. Wish you luck with qtocc. Now I can start my work with peace of mind. For the past one month I had no luck converting from qt3 to qt4 on my own,basically I was trying to port but ran into problems...anyways...thank you. I for one will be relying on qtocc for Qt4/Opencascade integration.
Gaurav.