+ fix drag and drop of Quarter viewer
This commit is contained in:
parent
d3c5a19ecc
commit
b3abd0d4dd
|
@ -618,7 +618,7 @@ bool View3DInventor::onMsg(const char* pMsg, const char** ppReturn)
|
|||
else if(strcmp("SetStereoOff",pMsg) == 0 ) {
|
||||
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::MONO );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if(strcmp("Example1",pMsg) == 0 ) {
|
||||
SoSeparator * root = new SoSeparator;
|
||||
Texture3D(root);
|
||||
|
@ -946,7 +946,7 @@ void View3DInventor::dropEvent (QDropEvent * e)
|
|||
|
||||
void View3DInventor::dragEnterEvent (QDragEnterEvent * e)
|
||||
{
|
||||
// Here we must allow uri drafs and check them in dropEvent
|
||||
// Here we must allow uri drags and check them in dropEvent
|
||||
const QMimeData* data = e->mimeData();
|
||||
if (data->hasUrls())
|
||||
e->accept();
|
||||
|
|
|
@ -2749,3 +2749,44 @@ PyObject *View3DInventorViewer::getPyObject(void)
|
|||
Py_INCREF(_viewerPy);
|
||||
return _viewerPy;
|
||||
}
|
||||
/**
|
||||
* Drops the event \a e and loads the files into the given document.
|
||||
*/
|
||||
void View3DInventorViewer::dropEvent (QDropEvent * e)
|
||||
{
|
||||
const QMimeData* data = e->mimeData();
|
||||
if (data->hasUrls() && selectionRoot && selectionRoot->pcDocument) {
|
||||
getMainWindow()->loadUrls(selectionRoot->pcDocument->getDocument(), data->urls());
|
||||
}
|
||||
else {
|
||||
inherited::dropEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
void View3DInventorViewer::dragEnterEvent (QDragEnterEvent * e)
|
||||
{
|
||||
// Here we must allow uri drags and check them in dropEvent
|
||||
const QMimeData* data = e->mimeData();
|
||||
if (data->hasUrls()) {
|
||||
e->accept();
|
||||
}
|
||||
else {
|
||||
inherited::dragEnterEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
void View3DInventorViewer::dragMoveEvent(QDragMoveEvent *e)
|
||||
{
|
||||
const QMimeData* data = e->mimeData();
|
||||
if (data->hasUrls() && selectionRoot && selectionRoot->pcDocument) {
|
||||
e->accept();
|
||||
}
|
||||
else {
|
||||
inherited::dragMoveEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
void View3DInventorViewer::dragLeaveEvent(QDragLeaveEvent *e)
|
||||
{
|
||||
inherited::dragLeaveEvent(e);
|
||||
}
|
||||
|
|
|
@ -354,6 +354,10 @@ protected:
|
|||
virtual void setSeekMode(SbBool enable);
|
||||
virtual void afterRealizeHook(void);
|
||||
virtual bool processSoEvent(const SoEvent * ev);
|
||||
void dropEvent (QDropEvent * e);
|
||||
void dragEnterEvent (QDragEnterEvent * e);
|
||||
void dragMoveEvent(QDragMoveEvent *e);
|
||||
void dragLeaveEvent(QDragLeaveEvent *e);
|
||||
SbBool processSoEventBase(const SoEvent * const ev);
|
||||
void printDimension();
|
||||
void selectAll();
|
||||
|
|
Loading…
Reference in New Issue
Block a user