[Interest] Signals, slots before the event loop starts?

Konstantin Shegunov kshegunov at gmail.com
Thu Apr 11 16:07:23 CEST 2019


On Thu, Apr 11, 2019 at 4:57 PM Jason H <jhihn at gmx.com> wrote:

> Update on this:
> It didn't work. I called it, nothing (discernable) happened. Got a bunch
> of serial port not open errors....
>

Something else's amiss. Here's the test-case:


#include <QCoreApplication>

#include <QDebug>


int main(int argc, char *argv[])

{

    QCoreApplication app(argc, argv);


    QObject::connect(&app, &QCoreApplication::aboutToQuit, [] () -> void  {

        qDebug() << "Goodbye cruel world!";

    });

    QMetaObject::invokeMethod(&app, &QCoreApplication::quit,
Qt::QueuedConnection);


    return QCoreApplication::exec();

}

Which produces (as expected):


17:05:37: Debugging starts

Goodbye cruel world!

17:05:38: Debugging has finished
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190411/3d9b3e6a/attachment.html>


More information about the Interest mailing list