Thanks. That worked.
Added after 58 minutes:
This is what I used:
Header file for class
myclass.h
#include <QMessageBox>
#include <QTime>
double time;
#include <QMessageBox>
#include <QTime>
QTime t;
double time;
QMessageBox msgBox;
To copy to clipboard, switch view to plain text mode
In myclass.cpp file for class
void myclass::Method1(void)
{
// Message Box here to introduce method
time = 0.0
t.start();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method2(void)
{
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method3(void)
{
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method4(void)
{
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
Temp
= "Seconds = " + QString::number(time);
msgBox.setText(Temp);
msgBox.exec();
}
void myclass::Method1(void)
{
// Message Box here to introduce method
time = 0.0
t.start();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method2(void)
{
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method3(void)
{
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
}
void myclass::Method4(void)
{
QString Temp;
// Message Box here to introduce method
t.restart();
// Code to time here
time += ((double) t.elapsed())/1000.0;
Temp = "Seconds = " + QString::number(time);
msgBox.setText(Temp);
msgBox.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks