forked from teamnwah/openmw-tes3coop
added interface for per edit-mode drop handling
This commit is contained in:
parent
37a72d1ea6
commit
102397067c
3 changed files with 25 additions and 1 deletions
|
@ -64,3 +64,9 @@ void CSVRender::EditMode::dragCompleted() {}
|
||||||
void CSVRender::EditMode::dragAborted() {}
|
void CSVRender::EditMode::dragAborted() {}
|
||||||
|
|
||||||
void CSVRender::EditMode::dragWheel (int diff, double speedFactor) {}
|
void CSVRender::EditMode::dragWheel (int diff, double speedFactor) {}
|
||||||
|
|
||||||
|
void CSVRender::EditMode::dragEnterEvent (QDragEnterEvent *event) {}
|
||||||
|
|
||||||
|
void CSVRender::EditMode::dropEvent (QDropEvent* event) {}
|
||||||
|
|
||||||
|
void CSVRender::EditMode::dragMoveEvent (QDragMoveEvent *event) {}
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
|
|
||||||
#include "../widget/modebutton.hpp"
|
#include "../widget/modebutton.hpp"
|
||||||
|
|
||||||
|
class QDragEnterEvent;
|
||||||
|
class QDropEvent;
|
||||||
|
class QDragMoveEvent;
|
||||||
|
|
||||||
namespace CSVRender
|
namespace CSVRender
|
||||||
{
|
{
|
||||||
class WorldspaceWidget;
|
class WorldspaceWidget;
|
||||||
|
@ -79,6 +83,15 @@ namespace CSVRender
|
||||||
|
|
||||||
/// Default-implementation: ignored
|
/// Default-implementation: ignored
|
||||||
virtual void dragWheel (int diff, double speedFactor);
|
virtual void dragWheel (int diff, double speedFactor);
|
||||||
|
|
||||||
|
/// Default-implementation: ignored
|
||||||
|
virtual void dragEnterEvent (QDragEnterEvent *event);
|
||||||
|
|
||||||
|
/// Default-implementation: ignored
|
||||||
|
virtual void dropEvent (QDropEvent* event);
|
||||||
|
|
||||||
|
/// Default-implementation: ignored
|
||||||
|
virtual void dragMoveEvent (QDragMoveEvent *event);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,8 @@ void CSVRender::WorldspaceWidget::dragEnterEvent (QDragEnterEvent* event)
|
||||||
// These drops are handled through the subview object.
|
// These drops are handled through the subview object.
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
dynamic_cast<EditMode&> (*mEditMode->getCurrent()).dragEnterEvent (event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,10 +350,11 @@ void CSVRender::WorldspaceWidget::dragMoveEvent(QDragMoveEvent *event)
|
||||||
// These drops are handled through the subview object.
|
// These drops are handled through the subview object.
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
dynamic_cast<EditMode&> (*mEditMode->getCurrent()).dragMoveEvent (event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CSVRender::WorldspaceWidget::storeMappingSetting (const CSMPrefs::Setting *setting)
|
bool CSVRender::WorldspaceWidget::storeMappingSetting (const CSMPrefs::Setting *setting)
|
||||||
{
|
{
|
||||||
if (setting->getParent()->getKey()!="3D Scene Input")
|
if (setting->getParent()->getKey()!="3D Scene Input")
|
||||||
|
@ -460,6 +463,8 @@ void CSVRender::WorldspaceWidget::dropEvent (QDropEvent* event)
|
||||||
{
|
{
|
||||||
emit dataDropped(mime->getData());
|
emit dataDropped(mime->getData());
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
dynamic_cast<EditMode&> (*mEditMode->getCurrent()).dropEvent (event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue