Compare commits

..

No commits in common. "748d18ce9a9bc257a35be075c3a510880f842507" and "61641209699b62bf2018dde15760d8e04bbb4476" have entirely different histories.

11 changed files with 12 additions and 21 deletions

View file

@ -459,7 +459,7 @@ void DialogSaveManualLayout::PathChanged(const QString &text)
if (not text.isEmpty() && dir.exists(text)) if (not text.isEmpty() && dir.exists(text))
{ {
bOk->setEnabled(true); bOk->setEnabled(true);
palette.setColor(ui->lineEditPath->foregroundRole(), palette.color(QPalette::Text)); palette.setColor(ui->lineEditPath->foregroundRole(), Qt::black);
} }
else else
{ {

View file

@ -1794,7 +1794,6 @@ auto VPMainWindow::MaybeSave() -> bool
} }
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
messageBox->setFixedSize(300, 85);
const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)

View file

@ -829,10 +829,10 @@ void MApplication::RepopulateMeasurementsDatabase(const QString &path)
Q_UNUSED(path) Q_UNUSED(path)
if (m_knownMeasurementsDatabase != nullptr) if (m_knownMeasurementsDatabase != nullptr)
{ {
QObject::connect(m_knownMeasurementsRepopulateWatcher, &QFutureWatcher<void>::finished, this,
&MApplication::SyncKnownMeasurements);
m_knownMeasurementsRepopulateWatcher->setFuture( m_knownMeasurementsRepopulateWatcher->setFuture(
QtConcurrent::run([this]() { m_knownMeasurementsDatabase->PopulateMeasurementsDatabase(); })); QtConcurrent::run([this]() { m_knownMeasurementsDatabase->PopulateMeasurementsDatabase(); }));
QObject::connect(m_knownMeasurementsRepopulateWatcher, &QFutureWatcher<void>::finished, this,
&MApplication::SyncKnownMeasurements);
} }
} }

View file

@ -1942,7 +1942,6 @@ auto TKMMainWindow::MaybeSave() -> bool
} }
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
messageBox->setFixedSize(300, 85);
const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)

View file

@ -3474,7 +3474,6 @@ auto TMainWindow::MaybeSave() -> bool
} }
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
messageBox->setFixedSize(300, 85);
const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)

View file

@ -332,13 +332,11 @@ void DialogPatternProperties::ValidatePassmarkLength() const
QRegularExpression rx(NameRegExp()); QRegularExpression rx(NameRegExp());
if (not text.isEmpty()) if (not text.isEmpty())
{ {
palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text) palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text) ? Qt::black : Qt::red);
? palette.color(QPalette::Text)
: Qt::red);
} }
else else
{ {
palette.setColor(foregroundRole, palette.color(QPalette::Text)); palette.setColor(foregroundRole, Qt::black);
} }
ui->lineEditPassmarkLength->setPalette(palette); ui->lineEditPassmarkLength->setPalette(palette);
@ -354,13 +352,11 @@ void DialogPatternProperties::ValidatePassmarkWidth() const
QRegularExpression rx(NameRegExp()); QRegularExpression rx(NameRegExp());
if (not text.isEmpty()) if (not text.isEmpty())
{ {
palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text) palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text) ? Qt::black : Qt::red);
? palette.color(QPalette::Text)
: Qt::red);
} }
else else
{ {
palette.setColor(foregroundRole, palette.color(QPalette::Text)); palette.setColor(foregroundRole, Qt::black);
} }
ui->lineEditPassmarkWidth->setPalette(palette); ui->lineEditPassmarkWidth->setPalette(palette);
@ -559,7 +555,7 @@ void DialogPatternProperties::LabelPathChanged(const QString &text)
{ {
QPalette palette = ui->lineEditPieceLabelPath->palette(); QPalette palette = ui->lineEditPieceLabelPath->palette();
palette.setColor(ui->lineEditPieceLabelPath->foregroundRole(), palette.setColor(ui->lineEditPieceLabelPath->foregroundRole(),
text.isEmpty() || QFileInfo::exists(text) ? palette.color(QPalette::Text) : Qt::red); text.isEmpty() || QFileInfo::exists(text) ? Qt::black : Qt::red);
ui->lineEditPieceLabelPath->setPalette(palette); ui->lineEditPieceLabelPath->setPalette(palette);
m_descriptionChanged = true; m_descriptionChanged = true;
} }

View file

@ -410,7 +410,7 @@ void DialogSaveLayout::PathChanged(const QString &text)
if (not text.isEmpty() && dir.exists(text)) if (not text.isEmpty() && dir.exists(text))
{ {
bOk->setEnabled(true); bOk->setEnabled(true);
palette.setColor(ui->lineEditPath->foregroundRole(), palette.color(QPalette::Text)); palette.setColor(ui->lineEditPath->foregroundRole(), Qt::black);
} }
else else
{ {

View file

@ -5756,7 +5756,6 @@ auto MainWindow::MaybeSave() -> bool
} }
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
messageBox->setFixedSize(300, 85);
const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)

View file

@ -284,10 +284,10 @@ auto MainWindowsNoGUI::GenerateLayout(VLayoutGenerator &lGenerator) -> bool
{ {
QEventLoop wait; QEventLoop wait;
QFutureWatcher<void> fw; QFutureWatcher<void> fw;
QObject::connect(&fw, &QFutureWatcher<void>::finished, &wait, &QEventLoop::quit);
fw.setFuture( fw.setFuture(
QtConcurrent::run([&lGenerator, timer, nestingState]() QtConcurrent::run([&lGenerator, timer, nestingState]()
{ lGenerator.Generate(timer, lGenerator.GetNestingTimeMSecs(), nestingState); })); { lGenerator.Generate(timer, lGenerator.GetNestingTimeMSecs(), nestingState); }));
QObject::connect(&fw, &QFutureWatcher<void>::finished, &wait, &QEventLoop::quit);
wait.exec(); wait.exec();
} }

View file

@ -502,7 +502,6 @@ auto WatermarkWindow::MaybeSave() -> bool
} }
messageBox->setWindowModality(Qt::ApplicationModal); messageBox->setWindowModality(Qt::ApplicationModal);
messageBox->setFixedSize(300, 85);
const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec()); const auto ret = static_cast<QMessageBox::StandardButton>(messageBox->exec());
switch (ret) switch (ret)

View file

@ -235,10 +235,10 @@ auto VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool *stop,
return position.getBestResult(); return position.getBestResult();
}; };
watcher.setFuture(QtConcurrent::mapped(jobs, Nest));
QEventLoop wait; QEventLoop wait;
QObject::connect(&watcher, &QFutureWatcher<VBestSquare>::finished, &wait, &QEventLoop::quit); QObject::connect(&watcher, &QFutureWatcher<VBestSquare>::finished, &wait, &QEventLoop::quit);
watcher.setFuture(QtConcurrent::mapped(jobs, Nest));
wait.exec(); wait.exec();
if (stop->load()) if (stop->load())