Skip to content

Main Executor requires "widgets" to be dragged into Qt build. #168

@Kasheen

Description

@Kasheen

This is more of an improvement request than a bug which relates to the Main Executor for Qt.

Improvement Description
Currently Main Executor uses #include <QApplication> at Line 37.

For QApplication to be available a project must be built with QT += widgets inside the .pro which might not be the case for console or qml front ended applications.

Requested Change
The required functionality from QApplication can actually be found in QCoreApplication which is further up QApplication's inheritance hierarchy. QCoreApplication does not need widgets specified on the Qt project file.

The include and usages could become:
Line 37: #include <QCoreApplication
Line 85: _receiver->moveToThread(QCoreApplication::instance()->thread());
Line 114: QCoreApplication::postEvent(event->receiver(), event.release());

I'm not sure if the use of widgets requires extra libs to be bundled for runtime, but this change might make it easier to include stlabs concurrency in all types of qt projects that don't necessarily need widgets.

I'm not sure if there's any side effects to these changes, perhaps others have some comments?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions