Moved everything associated with executing and explaining queries to querytab.
It is now possible to create multiple independent query tabs. However somethings are currently a bit broken.
This commit is contained in:
parent
6c268bd774
commit
7f379f3b80
13 changed files with 668 additions and 634 deletions
38
stopwatch.cpp
Normal file
38
stopwatch.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#include "stopwatch.h"
|
||||
#include "util.h"
|
||||
|
||||
StopWatch::StopWatch()
|
||||
: m_elapsed(std::make_unique<QElapsedTimer>())
|
||||
{}
|
||||
|
||||
void StopWatch::start()
|
||||
{
|
||||
m_elapsed->start();
|
||||
m_timer = std::make_unique<QTimer>(nullptr);
|
||||
connect(m_timer.get(), SIGNAL(timeout()), this, SLOT(updateTimer()));
|
||||
m_timer->start(18);
|
||||
}
|
||||
|
||||
void StopWatch::updateTimer()
|
||||
{
|
||||
// auto nu = std::chrono::steady_clock::now();
|
||||
// std::chrono::duration<float, std::milli> diff = nu - m_startTime;
|
||||
// elapsedTime = diff;
|
||||
// m_timeElapsedLabel->setText(msfloatToHumanReadableString(diff.count()));
|
||||
|
||||
qint64 ms = m_elapsed->elapsed();
|
||||
msfloatToHumanReadableString(ms);
|
||||
|
||||
if (m_timer) {
|
||||
int interval = 18;
|
||||
if (ms >= 10000) {
|
||||
int rem = ms % 1000;
|
||||
interval = 1000 - rem;
|
||||
}
|
||||
else if (ms >= 1000) {
|
||||
interval = 100;
|
||||
}
|
||||
|
||||
m_timer->start(interval);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue