Results 1 to 4 of 4

Thread: QWidget in a MFC CView

  1. #1
    Join Date
    Apr 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QWidget in a MFC CView

    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.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWidget in a MFC CView

    don't have any experience but this looks like your best bet:

    http://doc.qt.nokia.com/solutions/4/...ate/index.html
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Apr 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWidget in a MFC CView

    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.

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWidget in a MFC CView

    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.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 1
    Last Post: 16th September 2010, 15:57
  2. Replies: 1
    Last Post: 12th April 2010, 12:55
  3. Replies: 3
    Last Post: 1st April 2010, 23:56
  4. CView
    By krishbhala in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2007, 07:02
  5. Replies: 1
    Last Post: 2nd May 2006, 21:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.