c++ - Stop QDrag manually -
c++ - Stop QDrag manually -
i need stop qdrag when dragenterevent occurs. want release qdrag without releasing mouse button.
i have tried send events qdrag no luck.
qmouseevent* evt = new qmouseevent(qevent::mousebuttonrelease,event->pos() ,qt::leftbutton, qt::leftbutton, qt::nomodifier); qcoreapplication::sendevent(drag,evt);
how accomplish this?
update: release mouse when qdragevent occurs.
qmouseevent* finishmoveevent = new qmouseevent (qevent::mousebuttonrelease, event->pos (), qt::leftbutton, qt::leftbutton, qt::nomodifier); qtabbar::mousereleaseevent(finishmoveevent); qapp->sendevent(parentwidget(),finishmoveevent); qapp->sendevent(drag,finishmoveevent); qapp->postevent(drag,finishmoveevent,qt::higheventpriority);
i tried each of line in possible combinations. please help.
how release qdrag during qdragenterevent.
the drag not receive mouse events, widgets do. drag filters/intercepts events. need send relevant event target widget, , hope user experience won't suffer.
c++ qt qt5 qt5.2
Comments
Post a Comment