Test: fix -Wclazy-connect-by-name
This commit is contained in:
@@ -81,6 +81,8 @@ UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f)
|
||||
, ui(new Ui_UnitTest)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setupConnections();
|
||||
|
||||
setProgressColor(QColor(40,210,43)); // a darker green
|
||||
ui->progressBar->setAlignment(Qt::AlignCenter);
|
||||
|
||||
@@ -97,6 +99,19 @@ UnitTestDialog::~UnitTestDialog()
|
||||
{
|
||||
}
|
||||
|
||||
void UnitTestDialog::setupConnections()
|
||||
{
|
||||
connect(ui->treeViewFailure, &QTreeWidget::itemDoubleClicked,
|
||||
this, &UnitTestDialog::onTreeViewFailureItemDoubleClicked);
|
||||
connect(ui->helpButton, &QPushButton::clicked,
|
||||
this, &UnitTestDialog::onHelpButtonClicked);
|
||||
connect(ui->aboutButton, &QPushButton::clicked,
|
||||
this, &UnitTestDialog::onAboutButtonClicked);
|
||||
connect(ui->startButton, &QPushButton::clicked,
|
||||
this, &UnitTestDialog::onStartButtonClicked);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the color to the progressbar to \a col.
|
||||
*/
|
||||
@@ -118,7 +133,7 @@ void UnitTestDialog::setProgressColor(const QColor& col)
|
||||
/**
|
||||
* Opens a dialog to display a detailed description about the error.
|
||||
*/
|
||||
void UnitTestDialog::on_treeViewFailure_itemDoubleClicked(QTreeWidgetItem * item, int column)
|
||||
void UnitTestDialog::onTreeViewFailureItemDoubleClicked(QTreeWidgetItem * item, int column)
|
||||
{
|
||||
Q_UNUSED(column);
|
||||
|
||||
@@ -146,7 +161,7 @@ void UnitTestDialog::on_treeViewFailure_itemDoubleClicked(QTreeWidgetItem * item
|
||||
/**
|
||||
* Shows the help dialog.
|
||||
*/
|
||||
void UnitTestDialog::on_helpButton_clicked()
|
||||
void UnitTestDialog::onHelpButtonClicked()
|
||||
{
|
||||
QMessageBox::information(this, tr("Help"), tr(
|
||||
"Enter the name of a callable object which, when called, will return a TestCase.\n"
|
||||
@@ -158,7 +173,7 @@ void UnitTestDialog::on_helpButton_clicked()
|
||||
/**
|
||||
* Shows the about dialog.
|
||||
*/
|
||||
void UnitTestDialog::on_aboutButton_clicked()
|
||||
void UnitTestDialog::onAboutButtonClicked()
|
||||
{
|
||||
QMessageBox::information(this, tr("About FreeCAD UnitTest"), tr(
|
||||
"Copyright (c) Werner Mayer\n\n"
|
||||
@@ -169,7 +184,7 @@ void UnitTestDialog::on_aboutButton_clicked()
|
||||
/**
|
||||
* Runs the unit tests.
|
||||
*/
|
||||
void UnitTestDialog::on_startButton_clicked()
|
||||
void UnitTestDialog::onStartButtonClicked()
|
||||
{
|
||||
reset();
|
||||
setProgressColor(QColor(40,210,43)); // a darker green
|
||||
@@ -281,7 +296,7 @@ QString UnitTestDialog::getUnitTest() const
|
||||
bool UnitTestDialog::runCurrentTest()
|
||||
{
|
||||
clearErrorList();
|
||||
on_startButton_clicked();
|
||||
onStartButtonClicked();
|
||||
int count = ui->treeViewFailure->topLevelItemCount();
|
||||
reject();
|
||||
return (count == 0);
|
||||
|
||||
@@ -65,11 +65,12 @@ protected:
|
||||
~UnitTestDialog() override;
|
||||
void setProgressColor(const QColor& col);
|
||||
|
||||
public Q_SLOTS:
|
||||
void on_treeViewFailure_itemDoubleClicked (QTreeWidgetItem * item, int column);
|
||||
void on_helpButton_clicked();
|
||||
void on_aboutButton_clicked();
|
||||
void on_startButton_clicked();
|
||||
private:
|
||||
void onTreeViewFailureItemDoubleClicked (QTreeWidgetItem * item, int column);
|
||||
void onHelpButtonClicked();
|
||||
void onAboutButtonClicked();
|
||||
void onStartButtonClicked();
|
||||
void setupConnections();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui_UnitTest> ui;
|
||||
|
||||
Reference in New Issue
Block a user