diff options
author | axis <qt-info@nokia.com> | 2010-10-08 13:27:44 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-10-08 13:27:44 (GMT) |
commit | a7eab236ca29a06180faa43f982365ae646bb9a3 (patch) | |
tree | 82fe55a8aa3932f4f64700a12ff4bb1e13eaafea | |
parent | f8596b2269631b9522e51bb0a68d86588d4696c7 (diff) | |
parent | 4ee912a752a4b7f129e98e180328f1f46f053d4f (diff) | |
download | Qt-a7eab236ca29a06180faa43f982365ae646bb9a3.zip Qt-a7eab236ca29a06180faa43f982365ae646bb9a3.tar.gz Qt-a7eab236ca29a06180faa43f982365ae646bb9a3.tar.bz2 |
Merge branch '4.7-s60' into master-s60
Conflicts:
src/openvg/qvg_symbian.cpp
-rw-r--r-- | mkspecs/common/symbian/symbian-mmp.conf | 10 | ||||
-rw-r--r-- | mkspecs/common/symbian/symbian.conf | 8 | ||||
-rw-r--r-- | mkspecs/features/symbian/symbian_building.prf | 8 | ||||
-rw-r--r-- | src/gui/dialogs/qinputdialog.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 3 | ||||
-rw-r--r-- | src/openvg/qvg_symbian.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qinputdialog/tst_qinputdialog.cpp | 20 |
8 files changed, 55 insertions, 21 deletions
diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf index 5292781..1fbd302 100644 --- a/mkspecs/common/symbian/symbian-mmp.conf +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -4,16 +4,6 @@ include(symbian.conf) -contains(QMAKE_HOST.os, "Windows") { - QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe - QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe - QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe -} else { - QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc - QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic - QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc -} - load(symbian/add_mmp_rules) symbian-abld { diff --git a/mkspecs/common/symbian/symbian.conf b/mkspecs/common/symbian/symbian.conf index 0bdc8e5..e5038df 100644 --- a/mkspecs/common/symbian/symbian.conf +++ b/mkspecs/common/symbian/symbian.conf @@ -95,6 +95,10 @@ contains(QMAKE_HOST.os,Windows) { QMAKE_DEL_DIR = rmdir QMAKE_DEL_TREE = rmdir /s /q QMAKE_CHK_DIR_EXISTS = if not exist + + QMAKE_MOC = $$[QT_INSTALL_BINS]\\moc.exe + QMAKE_UIC = $$[QT_INSTALL_BINS]\\uic.exe + QMAKE_IDC = $$[QT_INSTALL_BINS]\\idc.exe } else { QMAKE_COPY = cp QMAKE_COPY_DIR = cp -r @@ -104,6 +108,10 @@ contains(QMAKE_HOST.os,Windows) { QMAKE_DEL_DIR = rmdir QMAKE_DEL_TREE = rm -rf QMAKE_CHK_DIR_EXISTS = test -d + + QMAKE_MOC = $$[QT_INSTALL_BINS]/moc + QMAKE_UIC = $$[QT_INSTALL_BINS]/uic + QMAKE_IDC = $$[QT_INSTALL_BINS]/idc } QMAKE_IDL = midl diff --git a/mkspecs/features/symbian/symbian_building.prf b/mkspecs/features/symbian/symbian_building.prf index 614fb65..1a51cb2 100644 --- a/mkspecs/features/symbian/symbian_building.prf +++ b/mkspecs/features/symbian/symbian_building.prf @@ -229,7 +229,7 @@ symbian_resources_INCLUDES = $$replace(symbian_resources_INCLUDES, ",", " -I") symbian_resources_INCLUDES += $$join(INCLUDEPATH, " -I", "-I") symbian_resources_DEFINES = $$join(DEFINES, " -D", "-D") symbian_resources_RCC_DIR = $$replace(RCC_DIR, "/$", "") -symbian_resources_INCLUDES += "-I $$symbian_resources_RCC_DIR" +symbian_resources_INCLUDES += "-I$$symbian_resources_RCC_DIR" for(symbian_resource, SYMBIAN_RESOURCES) { symbian_resource = $$basename(symbian_resource) @@ -245,7 +245,7 @@ symbianresources.commands = cpp -nostdinc -undef \ $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ ${QMAKE_FILE_NAME} \ - -o $${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ + > $${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/${QMAKE_FILE_BASE}.rpp \ -o$${symbianDestdir}/${QMAKE_FILE_BASE}$${QT_LIBINFIX}.rsc \ @@ -265,7 +265,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ $${baseTarget}.rss \ - -o $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ + > $${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/$${baseTarget}.rpp \ -o$${symbianDestdir}/$${baseTarget}.rsc \ @@ -284,7 +284,7 @@ contains(TEMPLATE, "app"):!contains(CONFIG, "no_icon") { $$symbian_resources_INCLUDES \ $$symbian_resources_DEFINES \ $${baseTarget}_reg.rss \ - -o $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ + > $${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ && rcomp -u -m045,046,047 \ -s$${symbian_resources_RCC_DIR}/$${baseTarget}_reg.rpp \ -o$${symbianDestdir}/$${baseTarget}_reg.rsc \ diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp index e996ee9..700b234 100644 --- a/src/gui/dialogs/qinputdialog.cpp +++ b/src/gui/dialogs/qinputdialog.cpp @@ -244,6 +244,9 @@ void QInputDialogPrivate::ensureLineEdit() Q_Q(QInputDialog); if (!lineEdit) { lineEdit = new QLineEdit(q); +#ifndef QT_NO_IM + qt_widget_private(lineEdit)->inheritsInputMethodHints = 1; +#endif lineEdit->hide(); QObject::connect(lineEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_textChanged(QString))); @@ -255,6 +258,9 @@ void QInputDialogPrivate::ensureComboBox() Q_Q(QInputDialog); if (!comboBox) { comboBox = new QComboBox(q); +#ifndef QT_NO_IM + qt_widget_private(comboBox)->inheritsInputMethodHints = 1; +#endif comboBox->hide(); QObject::connect(comboBox, SIGNAL(editTextChanged(QString)), q, SLOT(_q_textChanged(QString))); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index cffad1d..11bcd26 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -273,6 +273,9 @@ QWidgetPrivate::QWidgetPrivate(int version) , isMoved(0) , isGLWidget(0) , usesDoubleBufferedGLContext(0) +#ifndef QT_NO_IM + , inheritsInputMethodHints(0) +#endif #if defined(Q_WS_X11) , picture(0) #elif defined(Q_WS_WIN) @@ -9217,9 +9220,13 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const */ Qt::InputMethodHints QWidget::inputMethodHints() const { - Q_D(const QWidget); #ifndef QT_NO_IM - return d->imHints; + const QWidgetPrivate *priv = d_func(); + while (priv->inheritsInputMethodHints) { + priv = priv->q_func()->parentWidget()->d_func(); + Q_ASSERT(priv); + } + return priv->imHints; #else //QT_NO_IM return 0; #endif //QT_NO_IM diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index c943bd8..a8ddfe7 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -749,6 +749,9 @@ public: uint isMoved : 1; uint isGLWidget : 1; uint usesDoubleBufferedGLContext : 1; +#ifndef QT_NO_IM + uint inheritsInputMethodHints : 1; +#endif // *************************** Platform specific ************************************ #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp index e97ade8..45138f6 100644 --- a/src/openvg/qvg_symbian.cpp +++ b/src/openvg/qvg_symbian.cpp @@ -229,8 +229,7 @@ void* QVGPixmapData::toNativeType(NativeType type) sgInfo.iSizeInPixels.SetSize(w, h); sgInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface; - RSgImage *sgImage = new RSgImage(); - Q_CHECK_PTR(sgImage); + QScopedPointer<RSgImage> sgImage(new RSgImage()); err = sgImage->Create(sgInfo, NULL, NULL); if (err != KErrNone) { driver.Close(); @@ -241,7 +240,7 @@ void* QVGPixmapData::toNativeType(NativeType type) EGLImageKHR eglImage = QEgl::eglCreateImageKHR(QEgl::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, - (EGLClientBuffer)sgImage, + (EGLClientBuffer)sgImage.data(), (EGLint*)KEglImageAttribs); if (!eglImage || eglGetError() != EGL_SUCCESS) { sgImage->Close(); @@ -263,13 +262,14 @@ void* QVGPixmapData::toNativeType(NativeType type) if (vgGetError() != VG_NO_ERROR) { sgImage->Close(); - sgImage = 0; + sgImage.reset(); } + // release stuff vgDestroyImage(dstVgImage); QEgl::eglDestroyImageKHR(QEgl::display(), eglImage); driver.Close(); - return reinterpret_cast<void*>(sgImage); + return reinterpret_cast<void*>(sgImage.take()); #endif } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = new CFbsBitmap; diff --git a/tests/auto/qinputdialog/tst_qinputdialog.cpp b/tests/auto/qinputdialog/tst_qinputdialog.cpp index 0d6644a..5d03142 100644 --- a/tests/auto/qinputdialog/tst_qinputdialog.cpp +++ b/tests/auto/qinputdialog/tst_qinputdialog.cpp @@ -74,6 +74,7 @@ private slots: void getItem_data(); void getItem(); void task256299_getTextReturnNullStringOnRejected(); + void inputMethodHintsOfChildWidget(); }; QString stripFraction(const QString &s) @@ -404,5 +405,24 @@ void tst_QInputDialog::getItem() delete parent; } +void tst_QInputDialog::inputMethodHintsOfChildWidget() +{ + QInputDialog dialog; + dialog.setInputMode(QInputDialog::TextInput); + QList<QObject *> children = dialog.children(); + QLineEdit *editWidget = 0; + for (int c = 0; c < children.size(); c++) { + editWidget = qobject_cast<QLineEdit *>(children.at(c)); + if (editWidget) + break; + } + QVERIFY(editWidget); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhNone); + dialog.setInputMethodHints(Qt::ImhDigitsOnly); + QCOMPARE(editWidget->inputMethodHints(), dialog.inputMethodHints()); + QCOMPARE(editWidget->inputMethodHints(), Qt::ImhDigitsOnly); +} + QTEST_MAIN(tst_QInputDialog) #include "tst_qinputdialog.moc" |