#include #include #include #define _CRTDBG_MAP_ALLOC #include int main(int argc, char *argv[]) { _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); // enable memory leak checking QApplication app(argc, argv); QMainWindow mainWin; QColor c = QColorDialog::getColor(Qt::red, &mainWin); // select color picker button, then cancel out of color dialogs and close window for detected memory leaks mainWin.show(); int result = app.exec(); return result; }