TestGui::UnitTestDialog Class Reference

#include <UnitTestImp.h>

Public Slots

void on_aboutButton_clicked ()
 Shows the about dialog. More...
 
void on_helpButton_clicked ()
 Shows the help dialog. More...
 
void on_startButton_clicked ()
 Runs the unit tests. More...
 
void on_treeViewFailure_itemDoubleClicked (QTreeWidgetItem *item, int column)
 Opens a dialog to display a detailed description about the error. More...
 

Public Member Functions

void addUnitTest (const QString &unit)
 Adds a unit test. More...
 
void clearErrorList ()
 Empties the error listview. More...
 
void clearUnitTests ()
 Clears the unit tests. More...
 
QString getUnitTest () const
 Returns the unit test. More...
 
void insertError (const QString &failure, const QString &details)
 Inserts an item with text failure to the listview. More...
 
void reject ()
 Closes and resets this dialog. More...
 
void reset ()
 Resets this dialog. More...
 
void setErrorCount (int)
 Sets the number of faulty tests to ct. More...
 
void setFailCount (int)
 Sets the number of failed tests to ct. More...
 
void setProgressFraction (float fraction, const QString &=QString())
 Sets the progress of the progress bar whereas fraction is in between 0.0 and 1.0. More...
 
void setRemainCount (int)
 Sets the number of remaining tests to ct. More...
 
void setRunCount (int)
 Sets the number of performed tests to ct. More...
 
void setStatusText (const QString &text)
 Sets the text in the status bar. More...
 
void setUnitTest (const QString &unit)
 Sets the unit test. More...
 
void showErrorDialog (const char *title, const char *message)
 Shows an error dialog with title and message. More...
 

Static Public Member Functions

static void destruct ()
 Destructs the instance of this dialog. More...
 
static bool hasInstance ()
 Returns true if an instance of this dialog exists, false otherwise. More...
 
static UnitTestDialoginstance ()
 Creates and returns the one and only instance of this dialog. More...
 

Protected Member Functions

void setProgressColor (const QColor &col)
 Sets the color to the progressbar to col. More...
 
 UnitTestDialog (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 Constructs a TestGui::UnitTestDialog as a child of 'parent', with the name 'name' and widget flags set to 'f'. More...
 
 ~UnitTestDialog ()
 Destroys the object and frees any allocated resources. More...
 

Constructor & Destructor Documentation

◆ UnitTestDialog()

UnitTestDialog::UnitTestDialog ( QWidget parent = nullptr,
Qt::WindowFlags  f = Qt::WindowFlags() 
)
protected

Constructs a TestGui::UnitTestDialog as a child of 'parent', with the name 'name' and widget flags set to 'f'.

The dialog will by default be modeless, unless you set 'modal' to true to construct a modal dialog.

References setProgressColor().

Referenced by instance().

◆ ~UnitTestDialog()

UnitTestDialog::~UnitTestDialog ( )
protected

Destroys the object and frees any allocated resources.

Member Function Documentation

◆ addUnitTest()

void UnitTestDialog::addUnitTest ( const QString &  unit)

Adds a unit test.

If a test with name unit already is added then nothing happens.

Referenced by TestGui::UnitTestDialogPy::addUnitTest(), and setUnitTest().

◆ clearErrorList()

void UnitTestDialog::clearErrorList ( )

Empties the error listview.

Referenced by TestGui::UnitTestDialogPy::clearErrorList().

◆ clearUnitTests()

void UnitTestDialog::clearUnitTests ( )

Clears the unit tests.

Referenced by TestGui::UnitTestDialogPy::clearUnitTests().

◆ destruct()

void UnitTestDialog::destruct ( void  )
static

Destructs the instance of this dialog.

◆ getUnitTest()

QString UnitTestDialog::getUnitTest ( ) const

Returns the unit test.

◆ hasInstance()

bool UnitTestDialog::hasInstance ( )
static

Returns true if an instance of this dialog exists, false otherwise.

◆ insertError()

void UnitTestDialog::insertError ( const QString &  failure,
const QString &  details 
)

Inserts an item with text failure to the listview.

details will be shown when double-clicking on the matching listitem.

Referenced by TestGui::UnitTestDialogPy::insertError().

◆ instance()

◆ on_aboutButton_clicked

void UnitTestDialog::on_aboutButton_clicked ( )
slot

Shows the about dialog.

◆ on_helpButton_clicked

void UnitTestDialog::on_helpButton_clicked ( )
slot

Shows the help dialog.

◆ on_startButton_clicked

void UnitTestDialog::on_startButton_clicked ( )
slot

◆ on_treeViewFailure_itemDoubleClicked

void UnitTestDialog::on_treeViewFailure_itemDoubleClicked ( QTreeWidgetItem item,
int  column 
)
slot

Opens a dialog to display a detailed description about the error.

◆ reject()

◆ reset()

void UnitTestDialog::reset ( void  )

◆ setErrorCount()

void UnitTestDialog::setErrorCount ( int  ct)

Sets the number of faulty tests to ct.

Referenced by TestGui::UnitTestDialogPy::setErrorCount().

◆ setFailCount()

void UnitTestDialog::setFailCount ( int  ct)

Sets the number of failed tests to ct.

Referenced by TestGui::UnitTestDialogPy::setFailCount().

◆ setProgressColor()

void UnitTestDialog::setProgressColor ( const QColor &  col)
protected

Sets the color to the progressbar to col.

Referenced by on_startButton_clicked(), setProgressFraction(), and UnitTestDialog().

◆ setProgressFraction()

void UnitTestDialog::setProgressFraction ( float  fraction,
const QString &  color = QString() 
)

Sets the progress of the progress bar whereas fraction is in between 0.0 and 1.0.

It also sets the color of the progress bar to red if a failure or error in the unit test occurred.

References setProgressColor().

Referenced by TestGui::UnitTestDialogPy::setProgressFrac().

◆ setRemainCount()

void UnitTestDialog::setRemainCount ( int  ct)

Sets the number of remaining tests to ct.

Referenced by TestGui::UnitTestDialogPy::setRemainCount().

◆ setRunCount()

void UnitTestDialog::setRunCount ( int  ct)

Sets the number of performed tests to ct.

Referenced by TestGui::UnitTestDialogPy::setRunCount().

◆ setStatusText()

void UnitTestDialog::setStatusText ( const QString &  text)

Sets the text in the status bar.

Referenced by TestGui::UnitTestDialogPy::setStatusText().

◆ setUnitTest()

void UnitTestDialog::setUnitTest ( const QString &  unit)

Sets the unit test.

If the item is not there yet it gets added.

References addUnitTest().

Referenced by TestGui::UnitTestDialogPy::setUnitTest().

◆ showErrorDialog()

void UnitTestDialog::showErrorDialog ( const char *  title,
const char *  message 
)

Shows an error dialog with title and message.

Referenced by TestGui::UnitTestDialogPy::errorDialog(), and on_startButton_clicked().


The documentation for this class was generated from the following files: