Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

ItemUserPick froze in the c++ sample application

In some case, the ItemUserPick() method will make the whole application froze.
To reproduce using the existing C++ Sample application, simply:

- start the sample
- click on "Integrate RoboDK Window"
- add a first robot in the station, then a second, then a reference frame (like in the attached screenshot)
- click on the "Select Robot" button

The sample is frozen.

I have the same problem with our integration of RodoDK window inside a Qt application.

Attached Files Thumbnail(s)
I think this issue is related to RoboDK's main loop being blocked when you use a Qt application. This issue will happen when you use embedded windows with RoboDK and you display a blocking dialog from RoboDK using the API.

You could create your own version of this popup box (ItemUserPick) by retrieving all the items and let the user choose one.
Yes that is what I did.
Here is what I did directly in the C++ api:

Item RoboDK::ItemUserPick(const QString &message, int itemtype) {
QList<Item> item_list=getItemList(itemtype);
if (item_list.isEmpty())
return Item();
else if (item_list.count()==1)
return item_list.first();

// use Qt to select an item
QStringList item_name_list;
for (int i=0; i<item_list.count(); ++i)
bool ok;
QString item = QInputDialog::getItem(qApp->activeWindow(),message , message, item_name_list, 0, false, &ok);
if (ok==false || item.isEmpty())
return Item();
int index=item_name_list.indexOf(item);


Maybe the c++ api could be update in a similar way to the ItemUserPick() will always work?

Best regards,

Users browsing this thread:
1 Guest(s)