Batchprocessing improvments
This commit is contained in:
+19
-6
@@ -89,19 +89,32 @@ void ScriptEngine::sync()
|
||||
_pool->waitForDone();
|
||||
}
|
||||
|
||||
QString ScriptEngine::getString(const QString &label, const QString &text) const
|
||||
QJSValue ScriptEngine::getString(const QString &label, const QString &text) const
|
||||
{
|
||||
return QInputDialog::getText(_parent, tr("Enter text"), label, QLineEdit::Normal, text);
|
||||
bool ok = false;
|
||||
QString ret = QInputDialog::getText(_parent, tr("Enter text"), label, QLineEdit::Normal, text, &ok);
|
||||
return ok ? ret : QJSValue();
|
||||
}
|
||||
|
||||
int ScriptEngine::getInt(const QString &label, int value)
|
||||
QJSValue ScriptEngine::getInt(const QString &label, int value)
|
||||
{
|
||||
return QInputDialog::getInt(_parent, tr("Enter integer number"), label, value);
|
||||
bool ok = false;
|
||||
int ret = QInputDialog::getInt(_parent, tr("Enter integer number"), label, value, INT_MIN, INT_MAX, 1, &ok);
|
||||
return ok ? ret : QJSValue();
|
||||
}
|
||||
|
||||
double ScriptEngine::getFloat(const QString &label, double value, int decimals) const
|
||||
QJSValue ScriptEngine::getFloat(const QString &label, double value, int decimals) const
|
||||
{
|
||||
return QInputDialog::getDouble(_parent, tr("Enter float number"), label, value, INT_MIN, INT_MAX, decimals);
|
||||
bool ok = false;
|
||||
double ret = QInputDialog::getDouble(_parent, tr("Enter float number"), label, value, -INFINITY, INFINITY, decimals, &ok);
|
||||
return ok ? ret : QJSValue();
|
||||
}
|
||||
|
||||
QJSValue ScriptEngine::getItem(const QStringList &items, const QString &label, int current) const
|
||||
{
|
||||
bool ok = false;
|
||||
QString ret = QInputDialog::getItem(_parent, tr("Select item"), label, items, current, false, &ok);
|
||||
return ok ? ret : QJSValue();
|
||||
}
|
||||
|
||||
bool ScriptEngine::convert(File *file, QString &outpath, const QString &format, const QVariantMap ¶ms, bool async)
|
||||
|
||||
Reference in New Issue
Block a user