void Ut_MInputContext::testCommitString() { WidgetStub widget(0); QString commitString("committed string"); m_subject->setFocusWidget(&widget); gFocusedWidget = &widget; m_subject->commitString(commitString); waitAndProcessEvents(0); QCOMPARE(widget.inputMethodEventCount(), 1); QInputMethodEvent event = widget.lastInputMethodEvent(); QVERIFY(event.preeditString() == ""); // check that event doesn't contain wrong information QCOMPARE(event.commitString(), commitString); gFocusedWidget = 0; }
std::string TextOutput::commitString() { std::string str; commitString(str); return str; }