Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix QObject::connect: Cannot queue arguments of type 'QVector<int>' #2392

Merged
merged 3 commits into from
Nov 4, 2020

Conversation

rhaschke
Copy link
Contributor

Fix annoying Qt warning about unregistered QVector<int>. The reason was that the planning scene name was changed from a non-GUI thread, causing a dataChanged() signal emitted from this thread, which then needs to be queued for processing in the main event loop.
I fixed that by emitting a signal from the thread to change the name. Thus, a QString event is queued, which doesn't pose an issue.

caused by accessing/updating GUI elements from a non-GUI thread
@codecov

This comment has been minimized.

Copy link
Member

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it works for me to remove the warning. 👍

@rhaschke rhaschke changed the title Fix QObject::connect: Cannot queue arguments of type 'QVector<int>' [WIP] Fix QObject::connect: Cannot queue arguments of type 'QVector<int>' Oct 26, 2020
@rhaschke rhaschke changed the title [WIP] Fix QObject::connect: Cannot queue arguments of type 'QVector<int>' Fix QObject::connect: Cannot queue arguments of type 'QVector<int>' Oct 27, 2020
@rhaschke
Copy link
Contributor Author

@simonschmeisser, I addressed your feedback. Thanks for pointing me to invokeMethod.

scene_name_property_->setStdString(getPlanningSceneRO()->getName());
scene_name_property_->blockSignals(old_state);

QMetaObject::invokeMethod(this, "setSceneName", Qt::QueuedConnection,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QMetaObject::invokeMethod(this, "setSceneName", Qt::QueuedConnection,
QMetaObject::invokeMethod(this, &PlanningSceneDisplay::setSceneName, Qt::QueuedConnection,

probably doesn't work due to the argument right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, tried this first. But invokeMethod doesn't support methods, only lambdas.

@rhaschke rhaschke merged commit 382aa5a into moveit:master Nov 4, 2020
@rhaschke rhaschke deleted the fix-qt-warning branch November 4, 2020 18:10
@tylerjw tylerjw mentioned this pull request Apr 9, 2021
@tylerjw tylerjw mentioned this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants