0

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.

//Update: 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();
}

//Update2: I opened another discussion here.

drakon
  • 125
  • 9
  • The code above seems to be correct. At least I couldn't reproduce your problem. – hank Jul 16 '12 at 15:09
  • Yea, me too. In QtCreator works fine. – Blood Jul 16 '12 at 15:12
  • Yes, I already wrote that the error only occurs in x64 release mode. debug and any 32bit mode works fine. Which did you try? - And could you try x64 releas as well? – drakon Jul 16 '12 at 15:34

1 Answers1

0

Ok, I found the problem. It is a bug in the MSVC++ compiler. Installing the service pack and recompiling Qt again helps.

drakon
  • 125
  • 9