Qt Creator hang with certain source files
I am experiencing "no respond" with Qt Creator when editing certain source file.
I compiled Qt using Visual Studio 2010, and is doing fine with many example/demo projects, but sometimes when I try some code example from the web, while in the code editor, Qt creator just "hang", no respond, no cursor when moved within the Qt Creator's window, sometimes it response after sever minutes, sometimes it just ever response and must be killed by using the task manager's "End Process" command on Windows.
My config is Windows 7 64 bit, Qt Creator 2.1, Qt 4.7.1 (32 bit).
For instance, this source file always "hang" after some random seconds:
In pro file:
SOURCES += \
Program.cpp
In the Program.cpp:
#include "QtGui\QtGui"
void loadModules(){}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplashScreen *splash = new QSplashScreen;
splash->setPixmap(QPixmap("C:\\Users\MyUserName\\Desktop\ \Splash.bmp"));
splash->show();
Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
splash->showMessage(QObject::tr("Setting up the main window..."), topRight, Qt::white);
QMainWindow mainWin;
splash->showMessage(QObject::tr("Loading modules..."),topRight, Qt::white);
loadModules();
mainWin.show();
splash->finish(&mainWin);
delete splash;
return app.exec();
}
Re: Qt Creator hang with certain source files
I have no idea why that would hang, but I would try to find out where anythings hangs in this way:
* Delete the second half of source code and try again (perhaps delecting just the code insides methods if it is a class, or just half of the contents of a function, like in this case, main() -- that is probably obvious)
* If it doesn't hang, delete the other half and try again
* Now it is known, which half has the problem
* Doing the deleting in the same manner will eventually (hopefully) reveal the block of code that causes the hanging
(Just one note about: #include "QtGui\QtGui" -- I would use a forward slash -- backward slashes would require repeating -> \\ . Even this may be the reason.)
Re: Qt Creator hang with certain source files
Hi mvuori. Even I am facing the same issue while editing source files related to Qt Tests. Did you find the issue for your problem? Please share if it is solved. thanks