QT 中 Visual Studio .Net [DebuggerStepThrough] 等于什么?
What is equals of Visual Studio .Net [DebuggerStepThrough] in QT?
我想在 Qt 中调试时忽略一些行。
我知道我可以在 Visual Studio .Net 中使用 [DebuggerStepThrough]
http://www.debuggerstepthrough.com/2013/01/some-good-to-know-c-attributes.html
但我想知道这段代码在 Qt、C++ 中的等价物。
Qt 中是否有用于此目的的代码,如果没有,我如何在 Qt Creator 中实现?
在使用 Visual Studio 编译器的 windows 上,您可以使用以下内容:
int main(int argc, char** argv) {
//code to run at any build
foo();
//code to run only in debug build
#ifdef _DEBUG
bar();
#endif
//code to run only in release build
#ifndef _DEBUG
baz();
#endif
}
希望对您有所帮助。
我想在 Qt 中调试时忽略一些行。
我知道我可以在 Visual Studio .Net 中使用 [DebuggerStepThrough]
http://www.debuggerstepthrough.com/2013/01/some-good-to-know-c-attributes.html
但我想知道这段代码在 Qt、C++ 中的等价物。
Qt 中是否有用于此目的的代码,如果没有,我如何在 Qt Creator 中实现?
在使用 Visual Studio 编译器的 windows 上,您可以使用以下内容:
int main(int argc, char** argv) {
//code to run at any build
foo();
//code to run only in debug build
#ifdef _DEBUG
bar();
#endif
//code to run only in release build
#ifndef _DEBUG
baz();
#endif
}
希望对您有所帮助。