PDA

View Full Version : QWidget in a MFC CView



Thor28
19th December 2011, 22:17
We are trying to convert an MFC-based application to Qt. As an interim step, it would be quite helpful if we could use a QWidget derived class for the entire contents of a CView derived class.

Specifically, we have an MFC CView derived split window as the view of a CDocument-derived class; we would like the right hand side of the split CView to be entirely filled with a QTableWidget-derived class. This replaces an existing grid from another third party grid library.

I realize this is not a good design; it is not my goal or final stop. However, it would be really helpful if I could get this to work to help the conversion process. The general problem we are having is that it is difficult to keep the application minimally functioning and buildable during this conversion process. We have a prior (failed) attempt to convert everything at once.

Any suggestions or help? I realize this is a strange request, but it would be really helpful towards breaking the conversion into smaller, manageable pieces.

Thanks.

amleto
20th December 2011, 21:07
don't have any experience but this looks like your best bet:

http://doc.qt.nokia.com/solutions/4/qtwinmigrate/index.html

Thor28
21st December 2011, 13:54
Yes, I am using this. However, CView isn't specifically addressed by this and it isn't clear to me how the CView client area could work with QWidget.

amleto
21st December 2011, 18:36
at a glance, All I saw was that the widget will need to call OnUpdate on the view, when the doc's (widget's) data changes.