diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 07:29:57 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2009-10-14 09:40:07 (GMT) |
commit | 9a5fce0d7d66e0635678eb129f765b39ea11e600 (patch) | |
tree | c66a1a97767bd9ff7ab151b68c64e95a9321764b | |
parent | ba321e277e392c276c1ff8b32f8fca7d26ed0fbe (diff) | |
download | Qt-9a5fce0d7d66e0635678eb129f765b39ea11e600.zip Qt-9a5fce0d7d66e0635678eb129f765b39ea11e600.tar.gz Qt-9a5fce0d7d66e0635678eb129f765b39ea11e600.tar.bz2 |
Fix some autotest failures and get rid of some compiler warnings
-rw-r--r-- | src/gui/image/qpixmap.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_lite.cpp | 20 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 15 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_lite.cpp | 3 | ||||
-rw-r--r-- | src/plugins/graphicssystems/testlite/x11util.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qaction/tst_qaction.cpp | 2 |
7 files changed, 44 insertions, 6 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 558ae54..21fb23e 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1689,8 +1689,8 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) In addition, on Symbian, the QPixmap class supports conversion to and from CFbsBitmap: the toSymbianCFbsBitmap() function creates - CFbsBitmap equivalent to the QPixmap, based on given mode and returns - a CFbsBitmap object. The fromSymbianCFbsBitmap() function returns a + CFbsBitmap equivalent to the QPixmap, based on given mode and returns + a CFbsBitmap object. The fromSymbianCFbsBitmap() function returns a QPixmap that is equivalent to the given bitmap and given mode. \section1 Pixmap Transformations @@ -1874,6 +1874,8 @@ int QPixmap::defaultDepth() return 32; #elif defined(Q_OS_SYMBIAN) return S60->screenDepth; +#elif defined(Q_WS_LITE) + return 32; //LITE: use graphicssystem (we should do that in general) #endif } diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 613dbb5..77e6ea8 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -757,7 +757,7 @@ void QApplicationPrivate::construct( { initResources(); - graphics_system_name = qgetenv("QT_DEFAULT_GRAPHICS_SYSTEM"); + graphics_system_name = QLatin1String(qgetenv("QT_DEFAULT_GRAPHICS_SYSTEM")); qt_is_gui_used = (qt_appType != QApplication::Tty); process_cmdline(); diff --git a/src/gui/kernel/qapplication_lite.cpp b/src/gui/kernel/qapplication_lite.cpp index f551228..8c3f7f5 100644 --- a/src/gui/kernel/qapplication_lite.cpp +++ b/src/gui/kernel/qapplication_lite.cpp @@ -477,9 +477,29 @@ void qt_cleanup() #endif QFont::cleanup(); QColormap::cleanup(); + delete QApplicationPrivate::inputContext; + QApplicationPrivate::inputContext = 0; + + QApplicationPrivate::active_window = 0; //### this should not be necessary } +#ifdef QT3_SUPPORT +void QApplication::setMainWidget(QWidget *mainWidget) +{ + QApplicationPrivate::main_widget = mainWidget; + if (QApplicationPrivate::main_widget && windowIcon().isNull() + && QApplicationPrivate::main_widget->testAttribute(Qt::WA_SetWindowIcon)) + setWindowIcon(QApplicationPrivate::main_widget->windowIcon()); +} +#endif + + +//------------------------------------------------------------ +// +// Callback functions for plugins: +// + /*! \a tlw == 0 means that \a ev is in global coords only diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 3217222..1abbd9f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1444,7 +1444,7 @@ QWidget::~QWidget() } } -#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) +#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) //### LITE else if (!internalWinId() && isVisible()) { qApp->d_func()->sendSyntheticEnterLeave(this); #ifdef Q_WS_QWS @@ -2319,7 +2319,10 @@ WId QWidget::effectiveWinId() const return id; QWidget *realParent = nativeParentWidget(); Q_ASSERT(realParent); +#ifndef Q_WS_LITE + //### we really need to implement winId functionality Q_ASSERT(realParent->internalWinId()); +#endif return realParent->internalWinId(); } @@ -4004,6 +4007,9 @@ QWidget *QWidget::window() const */ QWidget *QWidget::nativeParentWidget() const { +#ifdef Q_WS_LITE + return window(); //### we don't have native child widgets yet +#endif QWidget *parent = parentWidget(); while (parent && !parent->internalWinId()) parent = parent->parentWidget(); @@ -10145,6 +10151,11 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) Q_ASSERT_X(sizeof(d->high_attributes)*8 >= (Qt::WA_AttributeCount - sizeof(uint)*8), "QWidget::setAttribute(WidgetAttribute, bool)", "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute"); +#ifdef Q_WS_LITE + //### we don't have native child widgets, and WinId isn't really there yet + if (attribute == Qt::WA_NativeWindow) + return; +#endif #ifdef Q_WS_WIN // ### Don't use PaintOnScreen+paintEngine() to do native painting in 5.0 @@ -11454,7 +11465,7 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction) QWidget *targetWidget = 0; int shortestDistance = INT_MAX; foreach(QWidget *targetCandidate, QApplication::allWidgets()) { - + if (targetCandidate->focusProxy()) //skip if focus proxy set continue; diff --git a/src/gui/kernel/qwidget_lite.cpp b/src/gui/kernel/qwidget_lite.cpp index 1c48e10..cab8cda 100644 --- a/src/gui/kernel/qwidget_lite.cpp +++ b/src/gui/kernel/qwidget_lite.cpp @@ -78,6 +78,9 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if ((windowType() == Qt::Popup)) qApp->d_func()->closePopup(this); + //### we don't have proper focus event handling yet + if (this == QApplicationPrivate::active_window) + QApplication::setActiveWindow(0); } void QWidgetPrivate::setParent_sys(QWidget *newparent, Qt::WindowFlags f) diff --git a/src/plugins/graphicssystems/testlite/x11util.cpp b/src/plugins/graphicssystems/testlite/x11util.cpp index fc442a2..41767c9 100644 --- a/src/plugins/graphicssystems/testlite/x11util.cpp +++ b/src/plugins/graphicssystems/testlite/x11util.cpp @@ -220,7 +220,9 @@ bool MyDisplay::handleEvent(XEvent *xe) } } if (!xw) { +#ifdef MYX11_DEBUG qWarning() << "Unknown window" << hex << xe->xany.window << "received event" << xe->type; +#endif return quit; } diff --git a/tests/auto/qaction/tst_qaction.cpp b/tests/auto/qaction/tst_qaction.cpp index 4aad8ca..1e3b143 100644 --- a/tests/auto/qaction/tst_qaction.cpp +++ b/tests/auto/qaction/tst_qaction.cpp @@ -242,7 +242,7 @@ void tst_QAction::setStandardKeys() QList<QKeySequence> expected; #if defined(Q_WS_MAC) || defined(Q_OS_SYMBIAN) expected << QKeySequence("CTRL+C"); -#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) +#elif defined(Q_WS_WIN) || defined(Q_WS_QWS) || defined(Q_WS_LITE) expected << QKeySequence("CTRL+C") << QKeySequence("CTRL+INSERT"); #else expected << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT"); |