Results 1 to 8 of 8

Thread: Problem with MDI framework

  1. #1
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Problem with MDI framework

    Hi,

    I have created one application as like follow:


    Qt Code:
    1. MainWindow::MainWindow() : QMainWindow()
    2. {
    3. QWorkspace* workspace = new QWorkspace(this);
    4. setCentralWidget(workspace);
    5. workspace->setScrollBarsEnabled(true);
    6.  
    7. QGraphicsView* view = new QGraphicsView(workspace);
    8. workspace->addWindow(view);
    9. view->showMaximized();
    10. workspace->setActiveWindow(view);
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 

    Whenever I am minimizing and then restoring the QGraphicsView window,
    I am getting following message:

    "QCoreApplication:: postEvent: Unexpected null receiver"

    Please can any body tell me why this message might be coming.

    I am working on Qt4.2.2 and Fedora core-5 application.
    Last edited by wysota; 5th July 2007 at 18:03. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with MDI framework

    Quote Originally Posted by a_m_mukul View Post
    QGraphicsView* view = new QGraphicsView(workspace);
    workspace->addWindow(graphicsView);
    graphicsView->showMaximized();
    workspace->setActiveWindow(m_graphicsView);
    It seems that you have three graphics views (view, graphicsView and m_graphicsView) instead of one.

  3. #3
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with MDI framework

    Just a point to remember, if you upgrade to Qt4.3, there is better support for MDI using QMdiArea which I believe is a replacement for QWorkspace.

    Example :

    Qt Code:
    1. m_pworkspace = new QMdiArea;
    2. m_pCanView = new CanView( this );
    3. m_pworkspace->addSubWindow( m_pCanView );
    4. m_pCanView->show();
    To copy to clipboard, switch view to plain text mode 

    Regards,
    Steve

  4. #4
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Problem with MDI framework

    it was a typo in demo program, actually i have only one graphicsView

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with MDI framework

    Try creating the workspace and the graphics view without specifing their parents.

  6. #6
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Problem with MDI framework

    I tried but didn't work....i have tried all type of combination of specifying/not-specifying the parents.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with MDI framework

    Does it occur if you use Qt 4.2.3?

  8. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem with MDI framework

    I'd like to see and test something compilable that reproduces the problem.
    J-P Nurmi

Similar Threads

  1. [QMYSQL] connection problem
    By chaos_theory in forum Installation and Deployment
    Replies: 5
    Last Post: 2nd July 2007, 10:52
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 13:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 15:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 22:36
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.