Commit 2f4d68e9 authored by Michael Winkelmann's avatar Michael Winkelmann

Microseconds delay

parent f4013bf0
...@@ -24,7 +24,8 @@ int main(int ac, char *av[]) { ...@@ -24,7 +24,8 @@ int main(int ac, char *av[]) {
{{"output", "o"}, "Output PDF file", "output", "output.pdf"}, {{"output", "o"}, "Output PDF file", "output", "output.pdf"},
{{"importpath", "I"}, "QML import path", "importpath" }, {{"importpath", "I"}, "QML import path", "importpath" },
{{"show-pdf", "p"}, "Show PDF file", "show-qml" }, {{"show-pdf", "p"}, "Show PDF file", "show-qml" },
{{"show-qml", "q"}, "Show QML Output", "show-pdf" } {{"show-qml", "q"}, "Show QML Output", "show-pdf" },
{{"delay", "D"}, "Delay in milliseconds", "delay", "0" }
}); });
parser.process(app); parser.process(app);
...@@ -33,6 +34,7 @@ int main(int ac, char *av[]) { ...@@ -33,6 +34,7 @@ int main(int ac, char *av[]) {
auto outputPdf = parser.value("output"); auto outputPdf = parser.value("output");
auto showPdf = parser.isSet("show-pdf"); auto showPdf = parser.isSet("show-pdf");
auto showQml = parser.isSet("show-qml"); auto showQml = parser.isSet("show-qml");
auto delay = parser.value("delay").toInt();
QDir outputPdfDir; QDir outputPdfDir;
...@@ -57,8 +59,7 @@ int main(int ac, char *av[]) { ...@@ -57,8 +59,7 @@ int main(int ac, char *av[]) {
if (showQml) if (showQml)
view->show(); view->show();
QTimer::singleShot(delay,[=]() {
QTimer::singleShot(10000,[=]() {
QmlPrinter printer; QmlPrinter printer;
qInfo() << QObject::tr("Writing PDF to %1").arg(outputPdfDir.absolutePath()); qInfo() << QObject::tr("Writing PDF to %1").arg(outputPdfDir.absolutePath());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment