Abort after timeout must have own signal.
--HG-- branch : feature
This commit is contained in:
parent
faff2b6d5d
commit
4adce13a4d
|
@ -74,7 +74,8 @@ DialogLayoutProgress::DialogLayoutProgress(QElapsedTimer timer, qint64 timeout,
|
|||
|
||||
if (timeout <= 1000)
|
||||
{
|
||||
emit Abort();
|
||||
emit Timeout();
|
||||
progressTimer->stop();
|
||||
}
|
||||
});
|
||||
progressTimer->start(1000);
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
|
||||
signals:
|
||||
void Abort();
|
||||
void Timeout();
|
||||
|
||||
public slots:
|
||||
void Start();
|
||||
|
|
|
@ -231,6 +231,7 @@ bool MainWindowsNoGUI::GenerateLayout(VLayoutGenerator& lGenerator)
|
|||
progressTimer->start(1000);
|
||||
#endif
|
||||
connect(progress.data(), &DialogLayoutProgress::Abort, &lGenerator, &VLayoutGenerator::Abort);
|
||||
connect(progress.data(), &DialogLayoutProgress::Timeout, &lGenerator, &VLayoutGenerator::Timeout);
|
||||
}
|
||||
|
||||
progress->Start();
|
||||
|
|
|
@ -324,6 +324,14 @@ void VLayoutGenerator::Abort()
|
|||
QThreadPool::globalInstance()->clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLayoutGenerator::Timeout()
|
||||
{
|
||||
stopGeneration.store(true);
|
||||
state = LayoutErrors::Timeout;
|
||||
QThreadPool::globalInstance()->clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VLayoutGenerator::IsStripOptimization() const
|
||||
{
|
||||
|
|
|
@ -130,6 +130,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void Abort();
|
||||
void Timeout();
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(VLayoutGenerator)
|
||||
|
|
Loading…
Reference in New Issue
Block a user