From f055e5daf17d73a56ac956c273a0a7160e634e7b Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Thu, 16 Sep 2010 10:43:54 +0300 Subject: QS60style: itemview selection indication works incorrectly Currently QS60Style shows tick mark for listWidget with multiselection capability only after two or more items are selected. This is fixed so that selection indication is shown in multiselection itemviews (all of them and not just list widget) irregardless of number of selected items. Also, if itemview loses focus with singleitem itemview, style now still draws item highlight to it (with 50% transparency). Task-number: QTBUG-12875, QTBUG-13072 Reviewed-by: Janne Anttila --- src/gui/styles/qs60style.cpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 358c6aa..971e1e3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1430,11 +1430,25 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, const QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &voptAdj, widget); QRect textRect = subElementRect(SE_ItemViewItemText, &voptAdj, widget); const QAbstractItemView *itemView = qobject_cast(widget); + const bool singleSelection = + (itemView->selectionMode() == QAbstractItemView::SingleSelection || + itemView->selectionMode() == QAbstractItemView::NoSelection); + const bool selectItems = (itemView->selectionBehavior() == QAbstractItemView::SelectItems); - // draw themed background for table unless background brush has been defined. + // draw themed background for itemview unless background brush has been defined. if (vopt->backgroundBrush == Qt::NoBrush) { if (itemView) { + //With single item selection, use highlight focus as selection indicator. + if (singleSelection && isSelected){ + voptAdj.state = voptAdj.state | State_HasFocus; + if (!hasFocus && selectItems) { + painter->save(); + painter->setOpacity(0.5); + } + } drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget); + if (singleSelection && isSelected && !hasFocus && selectItems) + painter->restore(); } } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget);} @@ -1444,27 +1458,19 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, voptAdj.icon.paint(painter, iconRect, voptAdj.decorationAlignment, mode, state); // Draw selection check mark. Show check mark only in multi selection modes. - if (itemView) { - const bool singleSelection = - (itemView->selectionMode() == QAbstractItemView::SingleSelection || - itemView->selectionMode() == QAbstractItemView::NoSelection)|| - (itemView->selectionModel()->selectedIndexes().count() < 2 ); - - const bool selectItemsOnly = (itemView->selectionBehavior() == QAbstractItemView::SelectItems); - + if (itemView && !singleSelection) { const QRect selectionRect = subElementRect(SE_ItemViewItemCheckIndicator, &voptAdj, widget); QStyleOptionViewItemV4 checkMarkOption(voptAdj); if (selectionRect.isValid()) checkMarkOption.rect = selectionRect; // Draw selection mark. - if (isSelected && !singleSelection && selectItemsOnly) { + if (isSelected && selectItems) { proxy()->drawPrimitive(PE_IndicatorViewItemCheck, &checkMarkOption, painter, widget); // @todo: this should happen in the rect retrievel i.e. subElementRect() if (textRect.right() > selectionRect.left()) textRect.setRight(selectionRect.left()); - } else if (singleSelection && - voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) { + } else if (voptAdj.features & QStyleOptionViewItemV2::HasCheckIndicator) { checkMarkOption.state = checkMarkOption.state & ~State_HasFocus; switch (vopt->checkState) { @@ -1484,7 +1490,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, // draw the text if (!voptAdj.text.isEmpty()) { - if (isSelected || hasFocus ) + if (hasFocus) painter->setPen(voptAdj.palette.highlightedText().color()); else painter->setPen(voptAdj.palette.text().color()); @@ -2314,7 +2320,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QAbstractItemView::SelectionBehavior selectionBehavior = itemView ? itemView->selectionBehavior() : QAbstractItemView::SelectItems; // Set the draw area for highlights (focus, select rect or pressed rect) - if (hasFocus || isSelected || isPressed) { + if (hasFocus || isPressed) { if (selectionBehavior != QAbstractItemView::SelectItems) { // set highlight rect so that it is continuous from cell to cell, yet sligthly // smaller than cell rect @@ -2344,7 +2350,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QRect elementRect = option->rect; //draw item is drawn as pressed, if it already has focus. - if (isPressed && (hasFocus || isSelected)) { + if (isPressed && hasFocus) { themeGraphicDefined = true; element = tableView ? QS60StylePrivate::SE_TableItemPressed : QS60StylePrivate::SE_ListItemPressed; } else if (hasFocus || (isSelected && selectionBehavior != QAbstractItemView::SelectItems)) { @@ -2984,7 +2990,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con case SE_ItemViewItemText: case SE_ItemViewItemDecoration: if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast(opt)) { - const QListWidget *listItem = qobject_cast(widget); + const QAbstractItemView *listItem = qobject_cast(widget); const bool multiSelection = !listItem ? false : listItem->selectionMode() == QAbstractItemView::MultiSelection || listItem->selectionMode() == QAbstractItemView::ExtendedSelection || @@ -3054,7 +3060,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con break; case SE_ItemViewItemCheckIndicator: if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast(opt)) { - const QListWidget *listItem = qobject_cast(widget); + const QAbstractItemView *listItem = qobject_cast(widget); const bool singleSelection = listItem && (listItem->selectionMode() == QAbstractItemView::SingleSelection || -- cgit v0.12 From 52409912fdb150111e0559d9b44c12bca3126a61 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 6 Sep 2010 16:23:35 +0200 Subject: Fixed incorrect Symbian scoping. The missing install functionality is only true for mmp based systems. --- src/3rdparty/webkit/WebCore/WebCore.pro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 87638a0..5f688f3 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -2860,13 +2860,13 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) { } } -!symbian { +!symbian-abld:!symbian-sbsv2 { modfile.files = $$moduleFile modfile.path = $$[QMAKE_MKSPECS]/modules INSTALLS += modfile } else { - # INSTALLS is not implemented in qmake's s60 generators, copy headers manually + # INSTALLS is not implemented in qmake's mmp generators, copy headers manually inst_modfile.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT} inst_modfile.input = moduleFile -- cgit v0.12 From 99205499b848d2af5502b63ecee8cfd4c577ec42 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Thu, 16 Sep 2010 11:25:34 +0200 Subject: Fix warnings --- src/declarative/qml/qdeclarativecustomparser_p.h | 2 +- src/declarative/util/qdeclarativepixmapcache_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativecustomparser_p.h b/src/declarative/qml/qdeclarativecustomparser_p.h index 509e30a..c3f9dd2 100644 --- a/src/declarative/qml/qdeclarativecustomparser_p.h +++ b/src/declarative/qml/qdeclarativecustomparser_p.h @@ -117,7 +117,7 @@ public: NoFlag = 0x00000000, AcceptsAttachedProperties = 0x00000001 }; - Q_DECLARE_FLAGS(Flags, Flag); + Q_DECLARE_FLAGS(Flags, Flag) QDeclarativeCustomParser() : compiler(0), object(0), m_flags(NoFlag) {} QDeclarativeCustomParser(Flags f) : compiler(0), object(0), m_flags(f) {} diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h index b4d88bd..2e83cc4 100644 --- a/src/declarative/util/qdeclarativepixmapcache_p.h +++ b/src/declarative/util/qdeclarativepixmapcache_p.h @@ -98,7 +98,7 @@ public: bool connectDownloadProgress(QObject *, int); private: - Q_DISABLE_COPY(QDeclarativePixmap); + Q_DISABLE_COPY(QDeclarativePixmap) QDeclarativePixmapData *d; }; -- cgit v0.12 From db701aac50cf0e60d64697743331b437630e1d51 Mon Sep 17 00:00:00 2001 From: mread Date: Thu, 16 Sep 2010 14:33:35 +0100 Subject: QTBUG-4852 Turning on runtime nested exception support where available Added nested_exceptions.prf to the symbian mkspecs features, and used it from the stl.prf config. nested_exceptions.prf adds the .mmp flag to use the nested exceptions runtime support library for apps. stl.prf will add nested_exceptions to the config when the support library is present. Since this check depends on the existence of the runtime support library when qmake is run, qtp will have to add nested_exceptions to their config when building with nested exception support. This change means that, where nested exceptions are supported on Symbian, apps will no longer crash if a nested exception is encountered at runtime. Task-number: QTBUG-4852 Reviewed-by: Miikka Heikkinen --- mkspecs/features/symbian/nested_exceptions.prf | 4 ++++ mkspecs/features/symbian/stl.prf | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 mkspecs/features/symbian/nested_exceptions.prf diff --git a/mkspecs/features/symbian/nested_exceptions.prf b/mkspecs/features/symbian/nested_exceptions.prf new file mode 100644 index 0000000..defca94 --- /dev/null +++ b/mkspecs/features/symbian/nested_exceptions.prf @@ -0,0 +1,4 @@ +# use nested exceptions runtime support for apps +contains(TEMPLATE, app) { + MMP_RULES *= EPOCNESTEDEXCEPTIONS +} diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf index 2a3bce4..65d4b93 100644 --- a/mkspecs/features/symbian/stl.prf +++ b/mkspecs/features/symbian/stl.prf @@ -36,3 +36,8 @@ equals(use_libstdcppv5, true) { } else { LIBS *= -llibstdcpp.dll } + +# use the runtime support for nested exceptions, if a library is available +exists($${EPOCROOT}epoc32/release/armv5/urel/usrt_nx_*.lib) { + CONFIG += nested_exceptions +} -- cgit v0.12 From 61ffabaf55f4130114ede74f90ae820bebbfa84a Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Thu, 16 Sep 2010 15:46:23 +0200 Subject: Restore 4.7.0 behavior that non-existing paths are possible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changing a relative path to a non-existing absolute path used to work, this should work again after this patch. Reviewed-by: João Abecasis --- src/corelib/io/qdir.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index fcd17f7..efcc8f9 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -1550,10 +1550,11 @@ bool QDir::makeAbsolute() // ### What do the return values signify? QScopedPointer dir(new QDirPrivate(*d_ptr.constData())); dir->setPath(absolutePath); - if (!(dir->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) + d_ptr = dir.take(); + + if (!(d_ptr->fileEngine->fileFlags(QAbstractFileEngine::TypesMask) & QAbstractFileEngine::DirectoryType)) return false; - d_ptr = dir.take(); return true; } -- cgit v0.12 From 093221ee4ca3b6ca08731c6d7cb71c360ef68a18 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 16 Sep 2010 15:33:33 +0200 Subject: Fixed EPOCROOT references in createpackage.pl. The makefile build system does not require EPOCROOT to end in a slash. RevBy: Jani Hautakangas --- bin/createpackage.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/createpackage.pl b/bin/createpackage.pl index 361b32d..cce0b54 100755 --- a/bin/createpackage.pl +++ b/bin/createpackage.pl @@ -139,6 +139,9 @@ unless (GetOptions('i|install' => \$install, Usage(); } +my $epocroot = $ENV{EPOCROOT}; +$epocroot =~ s,[\\/]$,,x; + my $certfilepath = abs_path(dirname($certfile)); # Read params to variables @@ -303,12 +306,12 @@ if ($preprocessonly) { } if($stub) { - if(!($ENV{EPOCROOT})) { die("EPOCROOT must be set to create stub sis files"); } - my $systeminstall = "$ENV{EPOCROOT}epoc32/data/z/system/install"; + if(!($epocroot)) { die("EPOCROOT must be set to create stub sis files"); } + my $systeminstall = "$epocroot/epoc32/data/z/system/install"; mkpath($systeminstall); my $stub_sis_name = $systeminstall."/".$stub_sis_name; # Create stub SIS. - system ("$ENV{EPOCROOT}epoc32/tools/makesis -s $pkgoutput $stub_sis_name"); + system ("$epocroot/epoc32/tools/makesis -s $pkgoutput $stub_sis_name"); } else { if ($certtext eq "Self Signed" && !@certificates @@ -321,8 +324,8 @@ if($stub) { # Create SIS. # The 'and' is because system uses 0 to indicate success. - if($ENV{EPOCROOT}) { - system ("$ENV{EPOCROOT}epoc32/tools/makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed"); + if($epocroot) { + system ("$epocroot/epoc32/tools/makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed"); } else { system ("makesis $pkgoutput $unsigned_sis_name") and die ("makesis failed"); } -- cgit v0.12 From acc84a9d0d3427155298db3a8c0ad406d078de0e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 16 Sep 2010 16:59:14 +0300 Subject: Check S60_VERSION instead of existence of certain files in bearer plugin Checking for existence of files does not work in clean platform builds, so check the S60_VERSION instead, which can be explicitly set by those builds to correct value. Task-number: QT-3949 Reviewed-by: axis --- src/plugins/bearer/symbian/3_2/3_2.pro | 12 +++++++----- src/plugins/bearer/symbian/symbian_3/symbian_3.pro | 18 ++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/plugins/bearer/symbian/3_2/3_2.pro b/src/plugins/bearer/symbian/3_2/3_2.pro index 6f3ecaf..ac3b3f8 100644 --- a/src/plugins/bearer/symbian/3_2/3_2.pro +++ b/src/plugins/bearer/symbian/3_2/3_2.pro @@ -1,13 +1,15 @@ include(../symbian.pri) symbian { - exists($${EPOCROOT}epoc32/release/winscw/udeb/cmmanager.lib)| \ - exists($${EPOCROOT}epoc32/release/armv5/lib/cmmanager.lib) { + contains(S60_VERSION, 3.1) { + is_using_gnupoc { + LIBS += -lapengine + } else { + LIBS += -lAPEngine + } + } else { DEFINES += SNAP_FUNCTIONALITY_AVAILABLE LIBS += -lcmmanager - } else { - # Fall back to 3_1 implementation on platforms that do not have cmmanager - LIBS += -lapengine } } diff --git a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro index fd66198..ef90ad2 100644 --- a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro +++ b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro @@ -1,22 +1,20 @@ include(../symbian.pri) symbian { - exists($${EPOCROOT}epoc32/release/winscw/udeb/cmmanager.lib)| \ - exists($${EPOCROOT}epoc32/release/armv5/lib/cmmanager.lib) { + contains(S60_VERSION, 3.1) { + is_using_gnupoc { + LIBS += -lapengine + } else { + LIBS += -lAPEngine + } + } else { DEFINES += SNAP_FUNCTIONALITY_AVAILABLE LIBS += -lcmmanager - exists($$prependEpocroot($$MW_LAYER_PUBLIC_EXPORT_PATH(extendedconnpref.h))) { + !contains(S60_VERSION, 3.2):!contains(S60_VERSION, 5.0) { DEFINES += OCC_FUNCTIONALITY_AVAILABLE LIBS += -lextendedconnpref } - } else { - # Fall back to 3_1 implementation on platforms that do not have cmmanager - is_using_gnupoc { - LIBS += -lapengine - } else { - LIBS += -lAPEngine - } } } -- cgit v0.12