Set WA_InputMethodEnabled in test.
If WA_InputMethodMethod is not set, setFocusWidget will fail in a ASSERT in a debug-compiled Qt. Reviewer: Hugo Lima <hugo.lima@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
ef05a106c3
commit
3bc3257c8b
1 changed files with 4 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
from PySide.QtCore import Qt
|
||||||
from PySide.QtGui import QPushButton
|
from PySide.QtGui import QPushButton
|
||||||
from helper import UsesQApplication
|
from helper import UsesQApplication
|
||||||
|
|
||||||
|
|
@ -10,6 +11,9 @@ class QInputContextTest(UsesQApplication):
|
||||||
widget = QPushButton()
|
widget = QPushButton()
|
||||||
widget.show()
|
widget.show()
|
||||||
|
|
||||||
|
if not widget.testAttribute(Qt.WA_InputMethodEnabled):
|
||||||
|
widget.setAttribute(Qt.WA_InputMethodEnabled)
|
||||||
|
|
||||||
context = self.app.inputContext()
|
context = self.app.inputContext()
|
||||||
self.assertEqual(context.focusWidget(), None)
|
self.assertEqual(context.focusWidget(), None)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue