diff options
author | Jing Bai <jing.bai@digia.com> | 2013-01-15 18:04:10 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-21 10:15:20 (GMT) |
commit | 8c2284e811d6a1e5d1d5f0703f127e66800baf78 (patch) | |
tree | 54636ac29412d8ceaacacdab831065808a468e00 /tests/auto | |
parent | 32426500bc9126de7322ce666e1fae4c0848731f (diff) | |
download | Qt-8c2284e811d6a1e5d1d5f0703f127e66800baf78.zip Qt-8c2284e811d6a1e5d1d5f0703f127e66800baf78.tar.gz Qt-8c2284e811d6a1e5d1d5f0703f127e66800baf78.tar.bz2 |
To support QT_NO_IM on Linux/Windows/Mac
Fix compilation issue when QT_NO_IM is defined.
Also fixed references in tests. But fixing
plugins/examples seem not necessary at this point.
Task-number: QTBUG-26109
Change-Id: I2067051951616012117efa6716640cbf198fdb2a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Diffstat (limited to 'tests/auto')
3 files changed, 38 insertions, 6 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 8c08ce6..76c7148 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -127,8 +127,9 @@ private slots: void mouseSelectionMode_data(); void mouseSelectionMode(); void dragMouseSelection(); +#ifndef QT_NO_IM void inputMethodHints(); - +#endif void positionAt(); void cursorDelegate(); @@ -141,8 +142,10 @@ private slots: void canPaste(); void canPasteEmpty(); void textInput(); +#ifndef QT_NO_IM void openInputPanelOnClick(); void openInputPanelOnFocus(); +#endif void geometrySignals(); void pastingRichText_QTBUG_14003(); void implicitSize_data(); @@ -151,10 +154,11 @@ private slots: void implicitSizePreedit(); void testQtQuick11Attributes(); void testQtQuick11Attributes_data(); - +#ifndef QT_NO_IM void preeditMicroFocus(); void inputContextMouseHandler(); void inputMethodComposing(); +#endif void cursorRectangleSize(); void deselect(); @@ -1604,6 +1608,7 @@ void tst_qdeclarativetextedit::mouseSelectionMode() delete canvas; } +#ifndef QT_NO_IM void tst_qdeclarativetextedit::inputMethodHints() { QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethodhints.qml"); @@ -1619,6 +1624,7 @@ void tst_qdeclarativetextedit::inputMethodHints() delete canvas; } +#endif void tst_qdeclarativetextedit::positionAt() { @@ -2064,7 +2070,7 @@ QDeclarativeView *tst_qdeclarativetextedit::createView(const QString &filename) canvas->setSource(QUrl::fromLocalFile(filename)); return canvas; } - +#ifndef QT_NO_IM class MyInputContext : public QInputContext { public: @@ -2327,7 +2333,7 @@ void tst_qdeclarativetextedit::openInputPanelOnFocus() QVERIFY(view.inputContext() == 0); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); } - +#endif //QT_NO_IM void tst_qdeclarativetextedit::geometrySignals() { QDeclarativeComponent component(&engine, SRCDIR "/data/geometrySignals.qml"); @@ -2484,6 +2490,7 @@ void tst_qdeclarativetextedit::testQtQuick11Attributes_data() << ":1 \"TextEdit.onLinkActivated\" is not available in QtQuick 1.0.\n"; } +#ifndef QT_NO_IM void tst_qdeclarativetextedit::preeditMicroFocus() { QString preeditText = "super"; @@ -2710,6 +2717,7 @@ void tst_qdeclarativetextedit::inputMethodComposing() QCOMPARE(edit.isInputMethodComposing(), false); QCOMPARE(spy.count(), 2); } +#endif // QT_NO_IM void tst_qdeclarativetextedit::cursorRectangleSize() { diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index c0e96db..5305ed0 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -116,8 +116,9 @@ private slots: void maxLength(); void masks(); void validators(); +#ifndef QT_NO_IM void inputMethods(); - +#endif void passwordCharacter(); void cursorDelegate(); void cursorVisible(); @@ -129,8 +130,10 @@ private slots: void canPaste(); void readOnly(); +#ifndef QT_NO_IM void openInputPanelOnClick(); void openInputPanelOnFocus(); +#endif void setHAlignClearCache(); void focusOutClearSelection(); @@ -142,10 +145,12 @@ private slots: void testQtQuick11Attributes(); void testQtQuick11Attributes_data(); +#ifndef QT_NO_IM void preeditAutoScroll(); void preeditMicroFocus(); void inputContextMouseHandler(); void inputMethodComposing(); +#endif void cursorRectangleSize(); void deselect(); @@ -1521,6 +1526,7 @@ void tst_qdeclarativetextinput::validators() delete canvas; } +#ifndef QT_NO_IM void tst_qdeclarativetextinput::inputMethods() { QDeclarativeView *canvas = createView(SRCDIR "/data/inputmethods.qml"); @@ -1569,6 +1575,7 @@ void tst_qdeclarativetextinput::inputMethods() delete canvas; } +#endif // QT_NO_IM /* TextInput element should only handle left/right keys until the cursor reaches @@ -2155,6 +2162,8 @@ QDeclarativeView *tst_qdeclarativetextinput::createView(const QString &filename) return canvas; } + +#ifndef QT_NO_IM class MyInputContext : public QInputContext { public: @@ -2389,6 +2398,7 @@ void tst_qdeclarativetextinput::openInputPanelOnFocus() QVERIFY(view.inputContext() == 0); QVERIFY(!view.testAttribute(Qt::WA_InputMethodEnabled)); } +#endif // QT_NO_IM class MyTextInput : public QDeclarativeTextInput { @@ -2497,6 +2507,7 @@ void tst_qdeclarativetextinput::testQtQuick11Attributes_data() << ""; } +#ifndef QT_NO_IM void tst_qdeclarativetextinput::preeditAutoScroll() { QString committedText = "super"; @@ -2807,6 +2818,7 @@ void tst_qdeclarativetextinput::inputMethodComposing() QCOMPARE(input.isInputMethodComposing(), false); QCOMPARE(spy.count(), 2); } +#endif // QT_NO_IM void tst_qdeclarativetextinput::cursorRectangleSize() { diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 4858b25..9cd257f 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ - +#include <qconfig.h> #if defined(QT3_SUPPORT) #include <q3hbox.h> #include <q3textedit.h> @@ -402,7 +402,9 @@ private slots: #endif #endif +#ifndef QT_NO_IM void focusProxyAndInputMethods(); +#endif void scrollWithoutBackingStore(); void taskQTBUG_7532_tabOrderWithFocusProxy(); @@ -440,6 +442,7 @@ bool tst_QWidget::ensureScreenSize(int width, int height) return (available.width() >= width && available.height() >= height); } +#ifndef QT_NO_IM class MyInputContext : public QInputContext { public: @@ -449,6 +452,7 @@ public: void reset() {} bool isComposing() const { return false; } }; +#endif // QT_NO_IM // Testing get/set functions void tst_QWidget::getSetCheck() @@ -585,6 +589,7 @@ void tst_QWidget::getSetCheck() obj1.setAcceptDrops(true); QCOMPARE(true, obj1.acceptDrops()); +#ifndef QT_NO_IM // QInputContext * QWidget::inputContext() // void QWidget::setInputContext(QInputContext *) MyInputContext *var13 = new MyInputContext; @@ -606,6 +611,7 @@ void tst_QWidget::getSetCheck() } #endif QVERIFY(qApp->inputContext() != var13); +#endif // QT_NO_IM // bool QWidget::autoFillBackground() // void QWidget::setAutoFillBackground(bool) @@ -9959,6 +9965,7 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779() void tst_QWidget::inputFocus_task257832() { +#ifndef QT_NO_IM QLineEdit *widget = new QLineEdit; QInputContext *context = widget->inputContext(); if (!context) @@ -9970,6 +9977,9 @@ void tst_QWidget::inputFocus_task257832() widget->setReadOnly(true); QVERIFY(!context->focusWidget()); delete widget; +#else + QWARN("Cannot test without inputmethod support"); +#endif // QT_NO_IM } void tst_QWidget::setGraphicsEffect() @@ -10400,6 +10410,7 @@ void tst_QWidget::opacityChangeCausesBackingStoreRecreation() #endif // !Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE #endif // Q_OS_SYMBIAN +#ifndef QT_NO_IM class InputContextTester : public QInputContext { Q_OBJECT @@ -10456,6 +10467,7 @@ void tst_QWidget::focusProxyAndInputMethods() delete toplevel; } +#endif // QT_NO_IM #ifdef QT_BUILD_INTERNAL class scrollWidgetWBS : public QWidget |