QtGui.h revision 6b15695578f07a3f72c4c9475c1a261a3021472a
#ifndef __cxxtest__QtGui_h__
#define __cxxtest__QtGui_h__
//
// The QtGui displays a simple progress bar using the Qt Toolkit. It
// has been tested with versions 2.x and 3.x.
//
// Apart from normal Qt command-line arguments, it accepts the following options:
// -minimized Start minimized, pop up on error
// -keep Don't close the window at the end
// -title TITLE Set the window caption
//
// If both are -minimized and -keep specified, GUI will only keep the
// window if it's in focus.
//
#include <qapplication.h>
#include <qglobal.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qmessagebox.h>
#include <qpixmap.h>
#include <qprogressbar.h>
#include <qstatusbar.h>
{
{
{
}
{
createWindow( wd );
}
void guiEnterSuite( const char *suiteName )
{
}
{
showTestName( testName );
}
void yellowBar()
{
}
void redBar()
{
showNormal();
setColor( 255, 0, 0 );
}
void leaveGui()
{
if ( keep() ) {
showSummary();
_application->exec();
}
else
_mainWindow->close( true );
}
bool _startMinimized, _keep;
unsigned _numTotalTests;
{
_startMinimized = _keep = false;
for ( int i = 1; i < argc; ++ i ) {
if ( arg == "-minimized" )
_startMinimized = true;
else if ( arg == "-keep" )
_keep = true;
}
}
{
}
{
getTotalTests( wd );
if ( _startMinimized )
else
showNormal();
}
void getTotalTests()
{
}
{
char s[WorldDescription::MAX_STRLEN_TOTAL_TESTS];
}
void createMainWindow()
{
}
void createProgressBar()
{
_progressBar->setProgress( 0 );
setColor( 0, 255, 0 );
}
void createStatusBar()
{
}
void setMainWidget()
{
}
void showMinimized()
{
}
void showNormal()
{
centerWindow();
}
{
}
{
}
void advanceProgressBar()
{
}
{
}
void showTestsDone( unsigned testsDone )
{
}
{
}
void setColor( int r, int g, int b )
{
}
{
#if QT_VERSION >= 0x030000
#else // Qt version < 3.0.0
#endif // QT_VERSION
}
void processEvents()
{
}
void centerWindow()
{
_mainWindow->setGeometry( xCenter - (windowWidth / 2), yCenter - (windowHeight / 2), windowWidth, windowHeight );
}
bool keep()
{
if ( !_keep )
return false;
if ( !_startMinimized )
return true;
}
void showSummary()
{
if ( tracker().failedTests() )
else
}
};
};
#endif // __cxxtest__QtGui_h__