mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:43:03 +02:00
Temporary IME position for QML GL widgets
This commit is contained in:
parent
17dc2decf6
commit
f783a80f34
2 changed files with 10 additions and 1 deletions
|
@ -85,6 +85,15 @@ void GLWidget::doneCurrent() {
|
||||||
_context->doneCurrent();
|
_context->doneCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariant GLWidget::inputMethodQuery(Qt::InputMethodQuery query) const {
|
||||||
|
if (query == Qt::ImCursorRectangle) {
|
||||||
|
int x = 50;
|
||||||
|
int y = 50;
|
||||||
|
return QRect(x, y, 10, 10);
|
||||||
|
}
|
||||||
|
return QWidget::inputMethodQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
bool GLWidget::event(QEvent* event) {
|
bool GLWidget::event(QEvent* event) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseMove:
|
case QEvent::MouseMove:
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
void swapBuffers();
|
void swapBuffers();
|
||||||
gl::Context* context() { return _context; }
|
gl::Context* context() { return _context; }
|
||||||
QOpenGLContext* qglContext();
|
QOpenGLContext* qglContext();
|
||||||
|
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
||||||
|
|
Loading…
Reference in a new issue