Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Qt4.8.1 undhandled exception at QMdiArea::addSubwindow

    Installation and Deployment
    1
    2
    1530
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      drakon2 last edited by

      I compiled Qt 4.8.1 with these instructions: http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/

      for my system (Visual Studio 2010, x64). The compilation worked and everything seemed Ok. While compiling there is a lot of output, but it's very fast and therefore I can't read it so i suppose that shouldn't be a problem.

      After I compiled succesfully my current project I got an unhandled runtime exception. After a while I discovered that it comes from the QMdiArea::addSubwindow function, which seems to throw the exception (I'm not able to catch it with overriden notify function though). So I searched for an example project to see if it's my code or something else. I found this example here: http://www.codeprogress.com/cpp/libraries/qt/qMdiAreaAddSubWindow.php

      And it works fine in 32bit mode as well as debug mode of x64, but again at the QMdiArea::addSubwindow function there is an unhandled exception. Has anyone an idea what's wrong or had the same problem?

      Currently I'm recompiling Qt to get the debug information again (i cleaned it beforehand).

      But maybe someone had the same problem and a solution for me.

      @
      The code is here (the exact same as in the link)
      #include <QApplication>
      #include <QMainWindow>
      #include <QMdiArea>
      #include <QMdiSubWindow>

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);

      QMainWindow window;
      window.setFixedSize(800,600);
      window.setWindowTitle(QString::fromUtf8("My QMdiWindow"));
      QMdiArea* area = new QMdiArea();
      area->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
      
      //Create QMdiSubWindow
      QMdiSubWindow* subWindow = new QMdiSubWindow();
      subWindow->setFixedSize(200,100); 
      
      //Add subWindow to Main QMdiWindow here
      area->addSubWindow(subWindow);
      
      window.setCentralWidget(area);
      window.show();
      
      
      return app.exec();
      

      }
      @

      Repost from "here":http://stackoverflow.com/questions/11506188/qt4-8-1-undhandled-exception-at-qmdiareaaddsubwindow since I didn't received an answer there. Maybe it's Qt bug anyway.

      1 Reply Last reply Reply Quote 0
      • D
        drakon2 last edited by

        Ok, I found the problem. It is a bug in the MSVC++ compiler. Installing the "service pack":http://www.microsoft.com/en-us/download/details.aspx?id=23691 and recompiling Qt again helps.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post