Fixup a few minor errors in the previous commit
Methods need to be Q_INVOKABLE to be able to call them with QMetaObject::invokeMethod(). Also use the correct return type. This makes the IBUS input context work again. Change-Id: If7ed6dd8fb99f3363c4ecebb98f889ed9eeeff00 Reviewed-on: http://codereview.qt-project.org/4486 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
8be1122710
commit
2cdd7886bf
@ -53,13 +53,13 @@ public:
|
||||
QIBusPlatformInputContext();
|
||||
~QIBusPlatformInputContext();
|
||||
|
||||
bool isValid() const;
|
||||
Q_INVOKABLE bool isValid() const;
|
||||
|
||||
void invokeAction(QInputPanel::Action a, int x);
|
||||
void reset(void);
|
||||
void update(Qt::InputMethodQueries);
|
||||
|
||||
bool x11FilterEvent(uint keyval, uint keycode, uint state, bool press);
|
||||
Q_INVOKABLE bool x11FilterEvent(uint keyval, uint keycode, uint state, bool press);
|
||||
|
||||
public Q_SLOTS:
|
||||
void commitText(const QDBusVariant &text);
|
||||
|
@ -105,9 +105,9 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters)
|
||||
#if defined(XCB_USE_IBUS)
|
||||
QPlatformInputContext *platformInputContext = QPlatformInputContextFactory::create("ibus");
|
||||
if (platformInputContext) {
|
||||
QVariant value;
|
||||
QMetaObject::invokeMethod(platformInputContext, "isValid", Qt::DirectConnection, Q_RETURN_ARG(QVariant, value));
|
||||
if (value.toBool())
|
||||
bool retval;
|
||||
QMetaObject::invokeMethod(platformInputContext, "isValid", Qt::DirectConnection, Q_RETURN_ARG(bool, retval));
|
||||
if (retval)
|
||||
m_inputContext = platformInputContext;
|
||||
}
|
||||
if (platformInputContext && !m_inputContext)
|
||||
|
@ -1032,14 +1032,14 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod
|
||||
|
||||
#if defined(XCB_USE_IBUS)
|
||||
if (QObject* inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext()) {
|
||||
QVariant value;
|
||||
bool retval;
|
||||
QMetaObject::invokeMethod(inputContext, "x11FilterEvent", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, value),
|
||||
Q_RETURN_ARG(bool, retval),
|
||||
Q_ARG(uint, sym),
|
||||
Q_ARG(uint, code),
|
||||
Q_ARG(uint, state),
|
||||
Q_ARG(bool, type == QEvent::KeyPress));
|
||||
if (value.toBool())
|
||||
if (retval)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user