mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-20 07:44:02 +02:00
Compare commits
3 commits
6164120969
...
748d18ce9a
Author | SHA1 | Date | |
---|---|---|---|
748d18ce9a | |||
0cd42f83e6 | |||
a0c1b6a512 |
|
@ -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(), Qt::black);
|
palette.setColor(ui->lineEditPath->foregroundRole(), palette.color(QPalette::Text));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1794,6 +1794,7 @@ 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)
|
||||||
|
|
|
@ -829,10 +829,10 @@ void MApplication::RepopulateMeasurementsDatabase(const QString &path)
|
||||||
Q_UNUSED(path)
|
Q_UNUSED(path)
|
||||||
if (m_knownMeasurementsDatabase != nullptr)
|
if (m_knownMeasurementsDatabase != nullptr)
|
||||||
{
|
{
|
||||||
m_knownMeasurementsRepopulateWatcher->setFuture(
|
|
||||||
QtConcurrent::run([this]() { m_knownMeasurementsDatabase->PopulateMeasurementsDatabase(); }));
|
|
||||||
QObject::connect(m_knownMeasurementsRepopulateWatcher, &QFutureWatcher<void>::finished, this,
|
QObject::connect(m_knownMeasurementsRepopulateWatcher, &QFutureWatcher<void>::finished, this,
|
||||||
&MApplication::SyncKnownMeasurements);
|
&MApplication::SyncKnownMeasurements);
|
||||||
|
m_knownMeasurementsRepopulateWatcher->setFuture(
|
||||||
|
QtConcurrent::run([this]() { m_knownMeasurementsDatabase->PopulateMeasurementsDatabase(); }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1942,6 +1942,7 @@ 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)
|
||||||
|
|
|
@ -3474,6 +3474,7 @@ 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)
|
||||||
|
|
|
@ -332,11 +332,13 @@ 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) ? Qt::black : Qt::red);
|
palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text)
|
||||||
|
? palette.color(QPalette::Text)
|
||||||
|
: Qt::red);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
palette.setColor(foregroundRole, Qt::black);
|
palette.setColor(foregroundRole, palette.color(QPalette::Text));
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->lineEditPassmarkLength->setPalette(palette);
|
ui->lineEditPassmarkLength->setPalette(palette);
|
||||||
|
@ -352,11 +354,13 @@ 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) ? Qt::black : Qt::red);
|
palette.setColor(foregroundRole, rx.match(text).hasMatch() && m_variables.contains(text)
|
||||||
|
? palette.color(QPalette::Text)
|
||||||
|
: Qt::red);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
palette.setColor(foregroundRole, Qt::black);
|
palette.setColor(foregroundRole, palette.color(QPalette::Text));
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->lineEditPassmarkWidth->setPalette(palette);
|
ui->lineEditPassmarkWidth->setPalette(palette);
|
||||||
|
@ -555,7 +559,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) ? Qt::black : Qt::red);
|
text.isEmpty() || QFileInfo::exists(text) ? palette.color(QPalette::Text) : Qt::red);
|
||||||
ui->lineEditPieceLabelPath->setPalette(palette);
|
ui->lineEditPieceLabelPath->setPalette(palette);
|
||||||
m_descriptionChanged = true;
|
m_descriptionChanged = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(), Qt::black);
|
palette.setColor(ui->lineEditPath->foregroundRole(), palette.color(QPalette::Text));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -5756,6 +5756,7 @@ 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)
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -502,6 +502,7 @@ 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)
|
||||||
|
|
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue