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

ItemUserPick froze in the c++ sample application

#1
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)

#2
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.
#3
Yes that is what I did.
这是我所做的直接在c++ api:

Item RoboDK::ItemUserPick(const QString &message, int itemtype) {
QList 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; iitem_name_list.append(item_list.at(i).Name());
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);
return item_list.at(index);

}

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

Best regards,
Francois.




Users browsing this thread:
2 Guest(s)