示例#1
0
void
WAssert(bool test, const char *message, int line, const char *file, const char *date)
{
	if (!test)
	{
		QString out = qApp->translate("Debug",
			"Send this message to [email protected]! "
			"This message has also been dumped to 'assert.txt'."
			"\n\n%1\n\nLine %2\nFile %3\nDate: %4").arg(qApp->translate("Debug",
				message)).arg(line).arg(file).arg(date);
		WFile f;
		if (f.Open(L"assert.txt", QIODevice::WriteOnly))
		{
			QByteArray tmp = out.toUtf8();
			f.WriteBlock(tmp, tmp.length());
			f.Close();
		}
		WPopup(out);
	}
}