From 6cd1a36774605afaa37d8e3edf870f9133e1cf3e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 4 Nov 2009 13:09:30 +0100 Subject: compilefixes for qfeatures Reviewed-by: Maurice --- src/gui/kernel/qsoftkeymanager.cpp | 4 ++++ src/gui/kernel/qwidget_win.cpp | 14 ++++++++++++-- src/gui/styles/qwindowsmobilestyle.cpp | 7 ++++++- src/gui/styles/qwindowsmobilestyle_p.h | 4 ++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 21795b4..e970d2f 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -137,12 +137,14 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act */ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget) { +#ifndef QT_NO_ACTION QScopedPointer action(createAction(standardKey, actionWidget)); connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent())); connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*))); QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key); return action.take(); +#endif //QT_NO_ACTION } void QSoftKeyManager::cleanupHash(QObject* obj) @@ -175,6 +177,7 @@ void QSoftKeyManager::updateSoftKeys() bool QSoftKeyManager::event(QEvent *e) { +#ifndef QT_NO_ACTION if (e->type() == QEvent::UpdateSoftKeys) { QList softKeys; QWidget *source = QApplication::focusWidget(); @@ -201,6 +204,7 @@ bool QSoftKeyManager::event(QEvent *e) QSoftKeyManagerPrivate::updateSoftKeys_sys(softKeys); return true; } +#endif //QT_NO_ACTION return false; } diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 22a94b9..2bdaddb 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -677,7 +677,11 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const QWidget *parentWindow = window(); QWExtra *extra = parentWindow->d_func()->extra; if (!isVisible() || parentWindow->isMinimized() || !testAttribute(Qt::WA_WState_Created) || !internalWinId() - || (extra && extra->proxyWidget)) { + || (extra +#ifndef QT_NO_GRAPHICSVIEW + && extra->proxyWidget +#endif //QT_NO_GRAPHICSVIEW + )) { if (extra && extra->topextra && extra->topextra->embedded) { QPoint pt = mapTo(parentWindow, pos); POINT p = {pt.x(), pt.y()}; @@ -704,7 +708,11 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const QWidget *parentWindow = window(); QWExtra *extra = parentWindow->d_func()->extra; if (!isVisible() || parentWindow->isMinimized() || !testAttribute(Qt::WA_WState_Created) || !internalWinId() - || (extra && extra->proxyWidget)) { + || (extra +#ifndef QT_NO_GRAPHICSVIEW + && extra->proxyWidget +#endif //QT_NO_GRAPHICSVIEW + )) { if (extra && extra->topextra && extra->topextra->embedded) { POINT p = {pos.x(), pos.y()}; ScreenToClient(parentWindow->effectiveWinId(), &p); @@ -2042,6 +2050,7 @@ void QWidgetPrivate::winSetupGestures() bool needv = false; bool singleFingerPanEnabled = false; +#ifndef QT_NO_SCROLLAREA if (QAbstractScrollArea *asa = qobject_cast(q->parent())) { QScrollBar *hbar = asa->horizontalScrollBar(); QScrollBar *vbar = asa->verticalScrollBar(); @@ -2055,6 +2064,7 @@ void QWidgetPrivate::winSetupGestures() if (!winid) winid = q->winId(); // enforces the native winid on the viewport } +#endif //QT_NO_SCROLLAREA if (winid && qAppPriv->SetGestureConfig) { GESTURECONFIG gc[1]; memset(gc, 0, sizeof(gc)); diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index 7ed187f..c543006 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -4121,6 +4121,7 @@ void QWindowsMobileStylePrivate::setupWindowsMobileStyle65() void QWindowsMobileStylePrivate::drawTabBarTab(QPainter *painter, const QStyleOptionTab *tab) { +#ifndef QT_NO_TABBAR #ifdef Q_WS_WINCE_WM if (wm65) { tintImagesButton(tab->palette.button().color()); @@ -4207,6 +4208,7 @@ void QWindowsMobileStylePrivate::drawTabBarTab(QPainter *painter, const QStyleOp } } painter->restore(); +#endif //QT_NO_TABBAR } void QWindowsMobileStylePrivate::drawPanelItemViewSelected(QPainter *painter, const QStyleOptionViewItemV4 *option, QRect rect) @@ -4412,7 +4414,7 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleUp(QPainter *p, QStyleOption void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOptionSlider *opt, bool completeFrame, bool secondScrollBar) { - +#ifndef QT_NO_SCROLLBAR #ifdef Q_WS_WINCE_WM if (wm65) { tintImagesHigh(opt->palette.highlight().color()); @@ -4469,10 +4471,12 @@ void QWindowsMobileStylePrivate::drawScrollbarHandleDown(QPainter *p, QStyleOpti arrowOpt.rect.adjust(1, 0, 1, 0); q_func()->proxy()->drawPrimitive(QStyle::PE_IndicatorArrowDown, &arrowOpt, p, 0); } +#endif //QT_NO_SCROLLBAR } void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOptionSlider *opt) { +#ifndef QT_NO_SCROLLBAR #ifdef Q_OS_WINCE_WM if (wm65) { p->fillRect(opt->rect, QColor(231, 231, 231)); @@ -4498,6 +4502,7 @@ void QWindowsMobileStylePrivate::drawScrollbarGroove(QPainter *p,const QStyleOpt fill = opt->palette.light(); } p->fillRect(opt->rect, fill); +#endif //QT_NO_SCROLLBAR } QWindowsMobileStyle::QWindowsMobileStyle(QWindowsMobileStylePrivate &dd) : QWindowsStyle(dd) { diff --git a/src/gui/styles/qwindowsmobilestyle_p.h b/src/gui/styles/qwindowsmobilestyle_p.h index 1e8c7ff..139a4ab 100644 --- a/src/gui/styles/qwindowsmobilestyle_p.h +++ b/src/gui/styles/qwindowsmobilestyle_p.h @@ -60,6 +60,10 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_STYLE_WINDOWSMOBILE +class QStyleOptionTab; +class QStyleOptionSlider; +class QStyleOptionViewItemV4; + class QWindowsMobileStylePrivate : public QWindowsStylePrivate { Q_DECLARE_PUBLIC(QWindowsMobileStyle) -- cgit v0.12 From a48ab815b5b6f6a20d4c8a2dba41e6dfc6a54073 Mon Sep 17 00:00:00 2001 From: Keith Isdale Date: Fri, 6 Nov 2009 16:16:35 +1000 Subject: cetest crashes and no helpful debugging provided Unguarded use of QList::first() leads to Q_ASSERT() if the list is empty Add support for a "-d" option to project file print parser debugging Do not make use of QMAKESPEC variables in .qmake.cache instead determine the current default if mkspec was not passed to cetest Task-number: QTBUG-5490 Reviewed-by: Lincoln Ramsay Joerg Bornemann --- tools/qtestlib/wince/cetest/main.cpp | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tools/qtestlib/wince/cetest/main.cpp b/tools/qtestlib/wince/cetest/main.cpp index e00c0e7..763439a 100644 --- a/tools/qtestlib/wince/cetest/main.cpp +++ b/tools/qtestlib/wince/cetest/main.cpp @@ -129,6 +129,7 @@ void usage() " -conf : Specify location of qt.conf file\n" " -f : Specify project file\n" " -cache : Specify .qmake.cache file to use\n" + " -d : Increase qmake debugging \n" " -timeout : Specify a timeout value after which the test will be terminated\n" " -1 specifies waiting forever (default)\n" " 0 specifies starting the process detached\n" @@ -216,6 +217,8 @@ int main(int argc, char **argv) return -1; } cacheFile = arguments.at(i); + } else if (arguments.at(i).toLower() == QLatin1String("-d")) { + Option::debug_level++; } else if (arguments.at(i).toLower() == QLatin1String("-timeout")) { if (++i == arguments.size()) { cout << "Error: No timeout value specified!" << endl; @@ -235,13 +238,22 @@ int main(int argc, char **argv) return -1; } debugOutput(QString::fromLatin1("Using Project File:").append(proFile),1); + }else { + if (!QFileInfo(proFile).exists()) { + cout << "Error: Project file does not exist " << qPrintable(proFile) << endl; + return -1; + } } Option::before_user_vars.append("CONFIG+=build_pass"); - // read target and deployment rules - int qmakeArgc = 1; - char* qmakeArgv[] = { "qmake.exe" }; + // read target and deployment rules passing the .pro to use instead of + // relying on qmake guessing the .pro to use + int qmakeArgc = 2; + QByteArray ba(QFile::encodeName(proFile)); + char* proFileEncodedName = ba.data(); + char* qmakeArgv[2] = { "qmake.exe", proFileEncodedName }; + Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING; Option::output_dir = qmake_getpwd(); if (!cacheFile.isEmpty()) @@ -267,6 +279,24 @@ int main(int argc, char **argv) else TestConfiguration::testDebug = false; + // determine what is the real mkspec to use if the default mkspec is being used + if (Option::mkfile::qmakespec.endsWith("/default")) + project.values("QMAKESPEC") = project.values("QMAKESPEC_ORIGINAL"); + else + project.values("QMAKESPEC") = QStringList() << Option::mkfile::qmakespec; + + // ensure that QMAKESPEC is non-empty .. to meet requirements of QList::at() + if (project.values("QMAKESPEC").isEmpty()){ + cout << "Error: QMAKESPEC not set after parsing " << qPrintable(proFile) << endl; + return -1; + } + + // ensure that QT_CE_C_RUNTIME is non-empty .. to meet requirements of QList::at() + if (project.values("QT_CE_C_RUNTIME").isEmpty()){ + cout << "Error: QT_CE_C_RUNTIME not defined in mkspec/qconfig.pri " << qPrintable(project.values("QMAKESPEC").join(" ")); + return -1; + } + QString destDir = project.values("DESTDIR").join(" "); if (!destDir.isEmpty()) { if (QDir::isRelativePath(destDir)) { -- cgit v0.12 From e3d3973d761248da23343be47e1be6777e9e84f0 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 Nov 2009 12:06:22 +0100 Subject: fixes button size for Windows mobile style The old button sizes were just to big. For example the trivialwizard example had a minimal width that was much too wide for the screen. Task-number: QTBUG-3613 Reviewed-by: thartman --- src/gui/styles/qwindowsmobilestyle.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index c543006..86ba947 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -6330,16 +6330,20 @@ QSize QWindowsMobileStyle::sizeFromContents(ContentsType type, const QStyleOptio switch (type) { case CT_PushButton: if (const QStyleOptionButton *button = qstyleoption_cast(option)) { - newSize = QWindowsStyle::sizeFromContents(type, option, size, widget); + newSize = QCommonStyle::sizeFromContents(type, option, size, widget); int w = newSize.width(), h = newSize.height(); int defwidth = 0; if (button->features & QStyleOptionButton::AutoDefaultButton) defwidth = 2 * proxy()->pixelMetric(PM_ButtonDefaultIndicator, button, widget); - if (w < 75 + defwidth && button->icon.isNull()) - w = 75 + defwidth; - if (h < 23 + defwidth) - h = 23 + defwidth; + + int minwidth = int(QStyleHelper::dpiScaled(55.0f)); + int minheight = int(QStyleHelper::dpiScaled(19.0f)); + + if (w < minwidth + defwidth && button->icon.isNull()) + w = minwidth + defwidth; + if (h < minheight + defwidth) + h = minheight + defwidth; newSize = QSize(w + 4, h + 4); } break; -- cgit v0.12 From 85a7c3477742516e1b89d527eccf702ffaca767f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 Nov 2009 12:12:09 +0100 Subject: fix QWizard issues on Windows CE Was reproducable with the example in \examples\dialogs\trivialwizard You could not push the navigation buttons using the stylus. Task-number: QTBUG-3613 Reviewed-by: thartman --- src/gui/kernel/qwidget_win.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 2bdaddb..b7ba273 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1339,8 +1339,15 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) if (isResize && !q->testAttribute(Qt::WA_StaticContents) && q->internalWinId()) ValidateRgn(q->internalWinId(), 0); +#ifdef Q_WS_WINCE + // On Windows CE we can't just fiddle around with the window state. + // Too much magic in setWindowState. + if (isResize && q->isMaximized()) + q->setWindowState(q->windowState() & ~Qt::WindowMaximized); +#else if (isResize) data.window_state &= ~Qt::WindowMaximized; +#endif if (data.window_state & Qt::WindowFullScreen) { QTLWExtra *top = topData(); -- cgit v0.12 From a2c08390e3ea2aefdc9b3284498137e1fd4b8b13 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 Nov 2009 15:50:00 +0100 Subject: my changes for 4.6.0 --- dist/changes-4.6.0 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index a42b213..a03ed43 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -217,6 +217,10 @@ QtGui - On Windows CE the link time code geration has been disabled by default to be consistent with win32-msvc200x. + + - The default button size has been reduced in the Windows mobile style. + + - [QTBUG-3613] QWizard issues have been fixed on Windows mobile. - Added QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES2 qmake variables for specifying OpenGL ES @@ -225,7 +229,6 @@ QtGui - KDE Integration: Improved the integration into KDE desktop (loading of KDE palette, usage of KColorDialog and KFileDialog) using the GuiPlatformPlugin - - Phonon on Windows * Now much more reliable when reading a file through a QIODevice. * If Video Mixing Renderer 9 is not available, falls back to software -- cgit v0.12 From d4b0fa0b4fd566a8afa268b29fc5b9b08bd503ee Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 Nov 2009 21:13:43 +0100 Subject: changes-4.6.0 updated --- dist/changes-4.6.0 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index a03ed43..a3af04e 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -221,6 +221,17 @@ QtGui - The default button size has been reduced in the Windows mobile style. - [QTBUG-3613] QWizard issues have been fixed on Windows mobile. + + - [254673] Restoring minimzed widgets fixed for Windows mobile and + Windows CE. + + - [255242] Seeking within large files (bigger than 0x80000000 bytes) fixed + on Windows CE. + + - [257352] When configuring Qt for Windows CE, configure points the user to + setcepaths, when its done. + + - [259850] Added a makespec template for Windows CE 6. - Added QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES2 qmake variables for specifying OpenGL ES -- cgit v0.12