I am attempting the tutorial "part2" on http://doc.qt.nokia.com/4.7/gettingstartedqt.html. part1 successfully compiled and ran.
part2, however, is giving me an assertion fail when I exit it.
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line: 52
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cpp
Line: 52
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
To copy to clipboard, switch view to plain text mode
This is when I clicked the red X, click the Quit button (part of the tutorial), or Alt-F4.
Here is the tutorial code:
#include <QtGui>
int main(int argv, char **args)
{
QObject::connect(&quitButton,
SIGNAL(clicked
()),
qApp,
SLOT(quit
()));
layout.addWidget(&textEdit);
layout.addWidget(&quitButton);
window.setLayout(&layout);
window.show();
return app.exec();
}
#include <QtGui>
int main(int argv, char **args)
{
QApplication app(argv, args);
QTextEdit textEdit;
QPushButton quitButton("Quit");
QObject::connect(&quitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
QVBoxLayout layout;
layout.addWidget(&textEdit);
layout.addWidget(&quitButton);
QWidget window;
window.setLayout(&layout);
window.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
I've noticed that if the layout.addWidget(... lines are commented out, it does not produce an assertion error.
What could be causing this to happen?
Thanks.
Bookmarks