MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / closeEvent

Method closeEvent

gui/mainwindow.cpp:1583–1610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1581}
1582
1583void MainWindow::closeEvent(QCloseEvent *event)
1584{
1585 // Check that we aren't checking files
1586 if (!mThread->isChecking()) {
1587 saveSettings();
1588 event->accept();
1589 } else {
1590 const QString text(tr("Analyzer is running.\n\n" \
1591 "Do you want to stop the analysis and exit Cppcheck?"));
1592
1593 QMessageBox msg(QMessageBox::Warning,
1594 tr("Cppcheck"),
1595 text,
1596 QMessageBox::Yes | QMessageBox::No,
1597 this);
1598
1599 msg.setDefaultButton(QMessageBox::No);
1600 const int rv = msg.exec();
1601 if (rv == QMessageBox::Yes) {
1602 // This isn't really very clean way to close threads but since the app is
1603 // exiting it doesn't matter.
1604 mThread->stop();
1605 saveSettings();
1606 mExiting = true;
1607 }
1608 event->ignore();
1609 }
1610}
1611
1612void MainWindow::toggleAllChecked(bool checked)
1613{

Callers

nothing calls this directly

Calls 2

isCheckingMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected