mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 11:53:28 +02:00
fix crash on import from JS
This commit is contained in:
parent
3a8a880a8b
commit
91d79f65f2
3 changed files with 6 additions and 4 deletions
|
@ -25,14 +25,14 @@ function printKeyEvent(eventName, event) {
|
|||
|
||||
|
||||
function keyPressEvent(event) {
|
||||
var debug = true;
|
||||
var debug = false;
|
||||
if (debug) {
|
||||
printKeyEvent("keyPressEvent", event);
|
||||
}
|
||||
}
|
||||
|
||||
function keyReleaseEvent(event) {
|
||||
var debug = true;
|
||||
var debug = false;
|
||||
if (debug) {
|
||||
printKeyEvent("keyReleaseEvent", event);
|
||||
}
|
||||
|
|
|
@ -50,10 +50,12 @@ void ClipboardScriptingInterface::exportVoxels(float x, float y, float z, float
|
|||
z / (float)TREE_SCALE,
|
||||
s / (float)TREE_SCALE };
|
||||
|
||||
// TODO: should we be calling invokeMethod() in all these cases?
|
||||
Application::getInstance()->exportVoxels(sourceVoxel);
|
||||
}
|
||||
|
||||
void ClipboardScriptingInterface::importVoxels() {
|
||||
Application::getInstance()->importVoxels();
|
||||
QMetaObject::invokeMethod(Application::getInstance(), "importVoxels");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ KeyEvent::KeyEvent(const QKeyEvent& event) {
|
|||
} else if (key == Qt::Key_CapsLock) {
|
||||
text = "CAPS LOCK";
|
||||
} else if (key >= Qt::Key_A && key <= Qt::Key_Z && (isMeta || isControl || isAlt)) {
|
||||
// this little bit of hacker will fix the text character keys like a-z in cases of control/alt/meta where
|
||||
// this little bit of hackery will fix the text character keys like a-z in cases of control/alt/meta where
|
||||
// qt doesn't always give you the key characters and will sometimes give you crazy non-printable characters
|
||||
const int lowerCaseAdjust = 0x20;
|
||||
QString unicode;
|
||||
|
|
Loading…
Reference in a new issue