diff options
author | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-05-11 09:39:36 (GMT) |
---|---|---|
committer | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-05-11 09:39:36 (GMT) |
commit | 23909776fb7b9283239f61b6fc819285b87200ef (patch) | |
tree | cb41a164322a5e35fa80aedd99144f02c5ca96c4 /src | |
parent | c4bae5c2028f4f83c6f110cec160265b65ab78b0 (diff) | |
parent | 565f2957fb049f2df0330fac72ec5335860b9c7f (diff) | |
download | Qt-23909776fb7b9283239f61b6fc819285b87200ef.zip Qt-23909776fb7b9283239f61b6fc819285b87200ef.tar.gz Qt-23909776fb7b9283239f61b6fc819285b87200ef.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys
Diffstat (limited to 'src')
81 files changed, 1428 insertions, 879 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 27aaac1..15b2d53 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1118,7 +1118,7 @@ class QDataStream; #ifndef Q_DECL_EXPORT # ifdef Q_OS_WIN # define Q_DECL_EXPORT __declspec(dllexport) -# elif defined(Q_CC_NOKIAX86) +# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) # define Q_DECL_EXPORT __declspec(dllexport) # elif defined(QT_VISIBILITY_AVAILABLE) # define Q_DECL_EXPORT __attribute__((visibility("default"))) @@ -1130,7 +1130,7 @@ class QDataStream; #ifndef Q_DECL_IMPORT # if defined(Q_OS_WIN) # define Q_DECL_IMPORT __declspec(dllimport) -# elif defined(Q_CC_NOKIAX86) +# elif defined(Q_CC_NOKIAX86) || defined(Q_CC_RVCT) # define Q_DECL_IMPORT __declspec(dllimport) # else # define Q_DECL_IMPORT diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp index 9990696..b203899 100644 --- a/src/corelib/io/qdatastream.cpp +++ b/src/corelib/io/qdatastream.cpp @@ -514,7 +514,7 @@ void QDataStream::setByteOrder(ByteOrder bo) \value Qt_4_2 Version 8 (Qt 4.2) \value Qt_4_3 Version 9 (Qt 4.3) \value Qt_4_4 Version 10 (Qt 4.4) - \value Qt_4_5 Version 10 (Qt 4.5) + \value Qt_4_5 Version 11 (Qt 4.5) \omitvalue Qt_4_6 \sa setVersion(), version() diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 0d82c2a..901641c 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -50,6 +50,7 @@ #include "qstring.h" #include "qregexp.h" #include "qvector.h" +#include "qalgorithms.h" #ifdef QT_BUILD_CORE_LIB # include "qresource.h" #endif @@ -190,32 +191,28 @@ QDirPrivate::~QDirPrivate() /* For sorting */ struct QDirSortItem { - QString filename_cache; - QString suffix_cache; + mutable QString filename_cache; + mutable QString suffix_cache; QFileInfo item; }; -static int qt_cmp_si_sort_flags; -#if defined(Q_C_CALLBACKS) -extern "C" { -#endif -#ifdef Q_OS_WINCE -static int __cdecl qt_cmp_si(const void *n1, const void *n2) -#else -static int qt_cmp_si(const void *n1, const void *n2) -#endif -{ - if (!n1 || !n2) - return 0; +class QDirSortItemComparator { + int qt_cmp_si_sort_flags; +public: + QDirSortItemComparator(int flags) : qt_cmp_si_sort_flags(flags) {} + bool operator()(const QDirSortItem &, const QDirSortItem &); +}; - QDirSortItem* f1 = (QDirSortItem*)n1; - QDirSortItem* f2 = (QDirSortItem*)n2; +bool QDirSortItemComparator::operator()(const QDirSortItem &n1, const QDirSortItem &n2) +{ + const QDirSortItem* f1 = &n1; + const QDirSortItem* f2 = &n2; if ((qt_cmp_si_sort_flags & QDir::DirsFirst) && (f1->item.isDir() != f2->item.isDir())) - return f1->item.isDir() ? -1 : 1; + return f1->item.isDir(); if ((qt_cmp_si_sort_flags & QDir::DirsLast) && (f1->item.isDir() != f2->item.isDir())) - return f1->item.isDir() ? 1 : -1; + return !f1->item.isDir(); int r = 0; int sortBy = (qt_cmp_si_sort_flags & QDir::SortByMask) @@ -264,18 +261,11 @@ static int qt_cmp_si(const void *n1, const void *n2) : f1->filename_cache.compare(f2->filename_cache); } - if (r == 0) // Enforce an order - the order the items appear in the array - r = (char*)n1 - (char*)n2; - if (qt_cmp_si_sort_flags & QDir::Reversed) - return -r; - return r; + return r > 0; + return r < 0; } -#if defined(Q_C_CALLBACKS) -} -#endif - inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QStringList &l, QStringList *names, QFileInfoList *infos) const { @@ -292,9 +282,8 @@ inline void QDirPrivate::sortFileList(QDir::SortFlags sort, QStringList &l, path += QLatin1Char('/'); si[i].item = QFileInfo(path + l.at(i)); } - qt_cmp_si_sort_flags = sort; if ((sort & QDir::SortByMask) != QDir::Unsorted) - qsort(si, i, sizeof(si[0]), qt_cmp_si); + qStableSort(si, si+i, QDirSortItemComparator(sort)); // put them back in the list(s) for (int j = 0; j<i; j++) { if(infos) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 3aea508..e120f28 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -294,6 +294,8 @@ public: QTemporaryFileEngine(const QString &file) : QFSFileEngine(file) { } ~QTemporaryFileEngine(); + void setFileName(const QString &file); + bool open(QIODevice::OpenMode flags); bool remove(); bool close(); @@ -304,6 +306,13 @@ QTemporaryFileEngine::~QTemporaryFileEngine() QFSFileEngine::close(); } +void QTemporaryFileEngine::setFileName(const QString &file) +{ + // Really close the file, so we don't leak + QFSFileEngine::close(); + QFSFileEngine::setFileName(file); +} + bool QTemporaryFileEngine::open(QIODevice::OpenMode openMode) { Q_D(QFSFileEngine); diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index ed9d0aa..1167671 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -67,8 +67,10 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; \snippet doc/src/snippets/code/src_corelib_io_qtextstream.cpp 1 Note that you cannot use QTextStream::atEnd(), which returns true when you - have reached the end of the data stream, with stdin. - + have reached the end of the data stream, with stdin. The reason for this is + that as long as stdin doesn't give any input to the QTextStream, \c atEnd() + will return true even if the stdin is open and waiting for more characters. + Besides using QTextStream's constructors, you can also set the device or string QTextStream operates on by calling setDevice() or setString(). You can seek to a position by calling seek(), and diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 3110e63..6c47c7b 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -505,7 +505,6 @@ void QEventDispatcherSymbian::closingDown() delete m_wakeUpAO; if (m_activeScheduler) { - CActiveScheduler::Install(NULL); delete m_activeScheduler; } } diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 1493dce..69c4f2f 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -113,7 +113,7 @@ public: int capacity() const; inline void reserve(int size); - inline void squeeze() { if (d->size < d->alloc) realloc(); d->capacity = 0;} + inline void squeeze() { if (d->size < d->alloc || d->ref != 1) realloc(); d->capacity = 0;} inline const QChar *unicode() const; inline QChar *data(); diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 3fd52ee..1f047b8 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -315,7 +315,7 @@ void QVector<T>::detach_helper() { realloc(d->size, d->alloc); } template <typename T> void QVector<T>::reserve(int asize) -{ if (asize > d->alloc) realloc(d->size, asize); d->capacity = 1; } +{ if (asize > d->alloc || d->ref != 1) realloc(d->size, asize); d->capacity = 1; } template <typename T> void QVector<T>::resize(int asize) { realloc(asize, (asize > d->alloc || (!d->capacity && asize < d->size && asize < (d->alloc >> 1))) ? diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 9753bbe..955f4a0 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -432,9 +432,14 @@ inline void QDBusPendingCallWatcherPrivate::_q_finished() QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent) : QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call) { - if (d) { - if (!d->watcherHelper) + if (d) { // QDBusPendingCall::d + if (!d->watcherHelper) { d->watcherHelper = new QDBusPendingCallWatcherHelper; + if (isFinished()) { + // cause a signal emission anyways + QMetaObject::invokeMethod(d->watcherHelper, "finished", Qt::QueuedConnection); + } + } d->watcherHelper->add(this); } } @@ -464,6 +469,7 @@ void QDBusPendingCallWatcher::waitForFinished() d->waitForFinished(); // our signals were queued, so deliver them + QCoreApplication::sendPostedEvents(d->watcherHelper, QEvent::MetaCall); QCoreApplication::sendPostedEvents(this, QEvent::MetaCall); } } diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp index 0dc16c9..5ed8852 100644 --- a/src/gui/dialogs/qabstractprintdialog.cpp +++ b/src/gui/dialogs/qabstractprintdialog.cpp @@ -400,7 +400,7 @@ void QAbstractPrintDialogPrivate::setPrinter(QPrinter *newPrinter) QAbstractPrintDialog::setEnabledOptions() and QAbstractPrintDialog::addEnabledOption() have no effect. - In Qt 4.4, it was possible to use the satic functions to show a sheet on + In Qt 4.4, it was possible to use the static functions to show a sheet on Mac OS X. This is no longer supported in Qt 4.5. If you want this functionality, use QPrintDialog::open(). diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index b911ee0..789b364 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -2145,7 +2145,6 @@ void QFileDialogPrivate::createWidgets() #ifndef QT_NO_COMPLETER completer = new QFSCompletor(model, q); qFileDialogUi->fileNameEdit->setCompleter(completer); - completer->sourceModel = model; QObject::connect(qFileDialogUi->fileNameEdit, SIGNAL(textChanged(QString)), q, SLOT(_q_autoCompleteFileName(QString))); #endif // QT_NO_COMPLETER diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h index 875cf4d..de7e332 100644 --- a/src/gui/dialogs/qfiledialog_p.h +++ b/src/gui/dialogs/qfiledialog_p.h @@ -97,7 +97,7 @@ class Ui_QFileDialog; */ class QFSCompletor : public QCompleter { public: - QFSCompletor(QAbstractItemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(0) + QFSCompletor(QFileSystemModel *model, QObject *parent = 0) : QCompleter(model, parent), proxyModel(0), sourceModel(model) { #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) setCaseSensitivity(Qt::CaseInsensitive); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 3e8d38f..30c15bc 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1225,8 +1225,8 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags) return; // Flags that alter the geometry of the item (or its children). - int geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations); - bool fullUpdate = (flags & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask); + const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations); + bool fullUpdate = (quint32(flags) & geomChangeFlagsMask) != (d_ptr->flags & geomChangeFlagsMask); if (fullUpdate) d_ptr->fullUpdateHelper(false, true); @@ -1921,7 +1921,7 @@ void QGraphicsItem::setOpacity(qreal opacity) itemChange(ItemOpacityHasChanged, newOpacity); // Update. - d_ptr->fullUpdateHelper(); + d_ptr->fullUpdateHelper(/*childrenOnly=*/false, /*maybeDirtyClipPath=*/false, /*ignoreOpacity=*/true); } /*! @@ -3235,10 +3235,16 @@ bool QGraphicsItem::contains(const QPointF &point) const } /*! - Returns true if this item collides with \a other; otherwise returns false. - The ways items collide is determined by \a mode. The default value for \a - mode is Qt::IntersectsItemShape; \a other collides with this item if it - either intersects, contains, or is contained by this item's shape. + + Returns true if this item collides with \a other; otherwise + returns false. + + The \a mode is applied to \a other, and the resulting shape or + bounding rectangle is then compared to this item's shape. The + default value for \a mode is Qt::IntersectsItemShape; \a other + collides with this item if it either intersects, contains, or is + contained by this item's shape (see Qt::ItemSelectionMode for + details). The default implementation is based on shape intersection, and it calls shape() on both items. Because the complexity of arbitrary shape-shape @@ -3293,6 +3299,11 @@ bool QGraphicsItem::collidesWithItem(const QGraphicsItem *other, Qt::ItemSelecti Qt::IntersectsItemShape; \a path collides with this item if it either intersects, contains, or is contained by this item's shape. + Note that this function checks whether the item's shape or + bounding rectangle (depending on \a mode) is contained within \a + path, and not whether \a path is contained within the items shape + or bounding rectangle. + \sa collidesWithItem(), contains(), shape() */ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode) const @@ -3333,11 +3344,12 @@ bool QGraphicsItem::collidesWithPath(const QPainterPath &path, Qt::ItemSelection /*! Returns a list of all items that collide with this item. - The way collisions are detected is determined by \a mode. The default - value for \a mode is Qt::IntersectsItemShape; All items whose shape - intersects or is contained by this item's shape are returned. + The way collisions are detected is determined by applying \a mode + to items that are compared to this item, i.e., each item's shape + or bounding rectangle is checked against this item's shape. The + default value for \a mode is Qt::IntersectsItemShape. - \sa QGraphicsScene::collidingItems(), collidesWithItem() + \sa collidesWithItem() */ QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode) const { @@ -3621,9 +3633,8 @@ void QGraphicsItem::setBoundingRegionGranularity(qreal granularity) \internal Returns true if we can discard an update request; otherwise false. */ -bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, - bool ignoreVisibleBit, - bool ignoreDirtyBit) const +bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, bool ignoreVisibleBit, + bool ignoreDirtyBit, bool ignoreOpacity) const { // No scene, or if the scene is updating everything, means we have nothing // to do. The only exception is if the scene tracks the growing scene rect. @@ -3632,7 +3643,7 @@ bool QGraphicsItemPrivate::discardUpdateRequest(bool ignoreClipping, || !scene || (scene->d_func()->updateAll && scene->d_func()->hasSceneRect) || (!ignoreClipping && (childrenClippedToShape() && isClippedAway())) - || (childrenCombineOpacity() && isFullyTransparent()); + || (!ignoreOpacity && childrenCombineOpacity() && isFullyTransparent()); } /*! @@ -3662,11 +3673,10 @@ void QGraphicsItemPrivate::updateHelper(const QRectF &rect, bool force, bool may Propagates updates to \a item and all its children. */ -void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath) +void QGraphicsItemPrivate::fullUpdateHelper(bool childrenOnly, bool maybeDirtyClipPath, bool ignoreOpacity) { - if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, - /*ignoreVisibleBit=*/false, - /*ignoreDirtyBit=*/true)) { + if (discardUpdateRequest(/*ignoreClipping=*/maybeDirtyClipPath, /*ignoreVisibleBit=*/false, + /*ignoreDirtyBit=*/true, ignoreOpacity)) { return; } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index a5871a7..9ce1bbf 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -165,11 +165,10 @@ public: void setPosHelper(const QPointF &pos); void setVisibleHelper(bool newVisible, bool explicitly, bool update = true); void setEnabledHelper(bool newEnabled, bool explicitly, bool update = true); - bool discardUpdateRequest(bool ignoreClipping = false, - bool ignoreVisibleBit = false, - bool ignoreDirtyBit = false) const; + bool discardUpdateRequest(bool ignoreClipping = false, bool ignoreVisibleBit = false, + bool ignoreDirtyBit = false, bool ignoreOpacity = false) const; void updateHelper(const QRectF &rect = QRectF(), bool force = false, bool maybeDirtyClipPath = false); - void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false); + void fullUpdateHelper(bool childrenOnly = false, bool maybeDirtyClipPath = false, bool ignoreOpacity = false); void updateEffectiveOpacity(); void resolveEffectiveOpacity(qreal effectiveParentOpacity); void resolveDepth(int parentDepth); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index b5a1bdf..05e4907 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1071,8 +1071,12 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg QList<QGraphicsItem *> itemList(scene->items()); int i = 0; while (i < itemList.size()) { + const QGraphicsItem *item = itemList.at(i); // But we only want to include items that are visible - if (!itemList.at(i)->isVisible()) + // The following check is basically the same as item->d_ptr->isInvisible(), except + // that we don't check whether the item clips children to shape or propagates its + // opacity (we loop through all items, so those checks are wrong in this context). + if (!item->isVisible() || item->d_ptr->isClippedAway() || item->d_ptr->isFullyTransparent()) itemList.removeAt(i); else ++i; diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 5de39d9..7f36be9 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -1337,6 +1337,7 @@ QByteArray QImageReader::imageFormat(QIODevice *device) \row \o TIFF \o Tagged Image File Format \row \o XBM \o X11 Bitmap \row \o XPM \o X11 Pixmap + \row \o SVG \o Scalable Vector Graphics \endtable Reading and writing SVG files is supported through Qt's diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index bf50383..1ae3d79 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -207,7 +207,11 @@ QString QCoeFepInputContext::language() bool QCoeFepInputContext::filterEvent(const QEvent *event) { - Q_ASSERT(focusWidget()); + // The CloseSoftwareInputPanel event is not handled here, because the VK will automatically + // close when it discovers that the underlying widget does not have input capabilities. + + if (!focusWidget()) + return false; if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event); diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index c8fedfc..56a65be 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -5081,6 +5081,137 @@ bool QApplicationPrivate::shouldSetFocus(QWidget *w, Qt::FocusPolicy policy) return true; } +/*! \fn QDecoration &QApplication::qwsDecoration() + Return the QWSDecoration used for decorating windows. + + \warning This method is non-portable. It is only available in + Qt for Embedded Linux. + + \sa QDecoration +*/ + +/*! + \fn void QApplication::qwsSetDecoration(QDecoration *decoration) + + Sets the QDecoration derived class to use for decorating the + windows used by Qt for Embedded Linux to the \a decoration + specified. + + This method is non-portable. It is only available in Qt for Embedded Linux. + + \sa QDecoration +*/ + +/*! \fn QDecoration* QApplication::qwsSetDecoration(const QString &decoration) + \overload + + Requests a QDecoration object for \a decoration from the QDecorationFactory. + + The string must be one of the QDecorationFactory::keys(). Keys are + case insensitive. + + A later call to the QApplication constructor will override the + requested style when a "-style" option is passed in as a commandline + parameter. + + Returns 0 if an unknown \a decoration is passed, otherwise the QStyle object + returned is set as the application's GUI style. +*/ + +/*! + \fn bool QApplication::qwsEventFilter(QWSEvent *event) + + This virtual function is only implemented under Qt for Embedded Linux. + + If you create an application that inherits QApplication and + reimplement this function, you get direct access to all QWS (Q + Window System) events that the are received from the QWS master + process. The events are passed in the \a event parameter. + + Return true if you want to stop the event from being processed. + Return false for normal event dispatching. The default + implementation returns false. +*/ + +/*! \fn void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors) + Set Qt for Embedded Linux custom color table. + + Qt for Embedded Linux on 8-bpp displays allocates a standard 216 color cube. + The remaining 40 colors may be used by setting a custom color + table in the QWS master process before any clients connect. + + \a colorTable is an array of up to 40 custom colors. \a start is + the starting index (0-39) and \a numColors is the number of colors + to be set (1-40). + + This method is non-portable. It is available \e only in + Qt for Embedded Linux. + + \note The custom colors will not be used by the default screen + driver. To make use of the new colors, implement a custom screen + driver, or use QDirectPainter. +*/ + +/*! \fn int QApplication::qwsProcessEvent(QWSEvent* event) + \internal +*/ + +/*! \fn int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) + \internal +*/ + +/*! \fn int QApplication::x11ProcessEvent(XEvent* event) + This function does the core processing of individual X + \a{event}s, normally by dispatching Qt events to the right + destination. + + It returns 1 if the event was consumed by special handling, 0 if + the \a event was consumed by normal handling, and -1 if the \a + event was for an unrecognized widget. + + \sa x11EventFilter() +*/ + +/*! + \fn bool QApplication::x11EventFilter(XEvent *event) + + \warning This virtual function is only implemented under X11. + + If you create an application that inherits QApplication and + reimplement this function, you get direct access to all X events + that the are received from the X server. The events are passed in + the \a event parameter. + + Return true if you want to stop the event from being processed. + Return false for normal event dispatching. The default + implementation returns false. + + It is only the directly addressed messages that are filtered. + You must install an event filter directly on the event + dispatcher, which is returned by + QAbstractEventDispatcher::instance(), to handle system wide + messages. + + \sa x11ProcessEvent() +*/ + +/*! \fn void QApplication::winFocus(QWidget *widget, bool gotFocus) + \internal + \since 4.1 + + If \a gotFocus is true, \a widget will become the active window. + Otherwise the active window is reset to 0. +*/ + +/*! \fn void QApplication::winMouseButtonUp() + \internal + */ + +/*! \fn void QApplication::syncX() + Synchronizes with the X server in the X11 implementation. + This normally takes some time. Does nothing on other platforms. +*/ + QT_END_NAMESPACE #include "moc_qapplication.cpp" diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h index 64b33bf..ce8792d 100644 --- a/src/gui/kernel/qapplication.h +++ b/src/gui/kernel/qapplication.h @@ -235,6 +235,7 @@ public: #if defined(Q_WS_S60) int s60ProcessEvent(TWsEvent *event); virtual bool s60EventFilter(TWsEvent *aEvent); + void s60HandleCommandL(int command); #endif #if defined(Q_WS_QWS) virtual bool qwsEventFilter(QWSEvent *); diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 2deda8e..018440f 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -2675,9 +2675,6 @@ void QApplication::alert(QWidget *, int) { } -/*! - \internal -*/ int QApplication::qwsProcessEvent(QWSEvent* event) { Q_D(QApplication); @@ -3056,43 +3053,11 @@ int QApplication::qwsProcessEvent(QWSEvent* event) return 0; } -/*! - \fn bool QApplication::qwsEventFilter(QWSEvent *event) - - This virtual function is only implemented under Qt for Embedded Linux. - - If you create an application that inherits QApplication and - reimplement this function, you get direct access to all QWS (Q - Window System) events that the are received from the QWS master - process. The events are passed in the \a event parameter. - - Return true if you want to stop the event from being processed. - Return false for normal event dispatching. The default - implementation returns false. -*/ bool QApplication::qwsEventFilter(QWSEvent *) { return false; } -/*! - Set Qt for Embedded Linux custom color table. - - Qt for Embedded Linux on 8-bpp displays allocates a standard 216 color cube. - The remaining 40 colors may be used by setting a custom color - table in the QWS master process before any clients connect. - - \a colorTable is an array of up to 40 custom colors. \a start is - the starting index (0-39) and \a numColors is the number of colors - to be set (1-40). - - This method is non-portable. It is available \e only in - Qt for Embedded Linux. - - \note The custom colors will not be used by the default screen - driver. To make use of the new colors, implement a custom screen - driver, or use QDirectPainter. -*/ void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors) { if (start < 0 || start > 39) { @@ -3111,30 +3076,11 @@ void QApplication::qwsSetCustomColors(QRgb *colorTable, int start, int numColors } #ifndef QT_NO_QWS_MANAGER -/*! - Return the QWSDecoration used for decorating windows. - - \warning This method is non-portable. It is only available in - Qt for Embedded Linux. - - \sa QDecoration -*/ QDecoration &QApplication::qwsDecoration() { return *qws_decoration; } -/*! - \fn void QApplication::qwsSetDecoration(QDecoration *decoration) - - Sets the QDecoration derived class to use for decorating the - windows used by Qt for Embedded Linux to the \a decoration - specified. - - This method is non-portable. It is only available in Qt for Embedded Linux. - - \sa QDecoration -*/ void QApplication::qwsSetDecoration(QDecoration *dec) { if (dec) { @@ -3153,21 +3099,6 @@ void QApplication::qwsSetDecoration(QDecoration *dec) } } -/*! - \overload - - Requests a QDecoration object for \a decoration from the QDecorationFactory. - - The string must be one of the QDecorationFactory::keys(). Keys are - case insensitive. - - A later call to the QApplication constructor will override the - requested style when a "-style" option is passed in as a commandline - parameter. - - Returns 0 if an unknown \a decoration is passed, otherwise the QStyle object - returned is set as the application's GUI style. -*/ QDecoration* QApplication::qwsSetDecoration(const QString &decoration) { QDecoration *decore = QDecorationFactory::create(decoration); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 06e47a7..ea0c3a6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -27,6 +27,7 @@ #endif #include "private/qwindowsurface_s60_p.h" #include "qpaintengine.h" +#include "qmenubar.h" #include "apgwgnam.h" // For CApaWindowGroupName #include <MdaAudioTonePlayer.h> // For CMdaAudioToneUtility @@ -1028,6 +1029,21 @@ bool QApplication::s60EventFilter(TWsEvent *aEvent) return false; } +void QApplication::s60HandleCommandL(int command) +{ + switch (command) { + case EEikCmdExit: + case EAknSoftkeyBack: + case EAknSoftkeyExit: + qApp->exit(); + break; + default: + // For now assume all unknown menu items are Qt menu items + QMenuBar::symbianCommands(command); + break; + } +} + #ifndef QT_NO_WHEELEVENT int QApplication::wheelScrollLines() { diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index bc32c14..f14ad6f 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -1371,13 +1371,6 @@ QString QApplicationPrivate::appName() const extern uint qGlobalPostedEventsCount(); -/*! - \internal - \since 4.1 - - If \a gotFocus is true, \a widget will become the active window. - Otherwise the active window is reset to 0. -*/ void QApplication::winFocus(QWidget *widget, bool gotFocus) { if (d_func()->inPopupMode()) // some delayed focus event to ignore @@ -1732,6 +1725,21 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam // fall-through intended case WM_KEYUP: case WM_SYSKEYUP: +#if Q_OS_WINCE_WM + case WM_HOTKEY: + if(HIWORD(msg.lParam) == VK_TBACK) { + const bool hotKeyDown = !(LOWORD(msg.lParam) & MOD_KEYUP); + msg.lParam = 0x69 << 16; + msg.wParam = VK_BACK; + if (hotKeyDown) { + msg.message = WM_KEYDOWN; + qt_keymapper_private()->updateKeyMap(msg); + } else { + msg.message = WM_KEYUP; + } + } + // fall-through intended +#endif case WM_IME_CHAR: case WM_IME_KEYDOWN: case WM_CHAR: { @@ -2921,7 +2929,6 @@ void qt_win_eatMouseMove() // In DnD, the mouse release event never appears, so the // mouse button state machine must be manually reset -/*! \internal */ void QApplication::winMouseButtonUp() { qt_button_down = 0; diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 15149a5..a3c9406 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2976,11 +2976,6 @@ QWidget *QApplication::topLevelAt(const QPoint &p) #endif } -/*! - Synchronizes with the X server in the X11 implementation. This - normally takes some time. Does nothing on other platforms. -*/ - void QApplication::syncX() { if (X11->display) @@ -3086,9 +3081,6 @@ static QETWidget *qPRFindWidget(Window oldwin) return wPRmapper ? (QETWidget*)wPRmapper->value((int)oldwin, 0) : 0; } -/*! - \internal -*/ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) { if (w && !w->internalWinId()) @@ -3151,17 +3143,6 @@ int QApplication::x11ClientMessage(QWidget* w, XEvent* event, bool passive_only) return 0; } -/*! - This function does the core processing of individual X - \a{event}s, normally by dispatching Qt events to the right - destination. - - It returns 1 if the event was consumed by special handling, 0 if - the \a event was consumed by normal handling, and -1 if the \a - event was for an unrecognized widget. - - \sa x11EventFilter() -*/ int QApplication::x11ProcessEvent(XEvent* event) { Q_D(QApplication); @@ -3843,29 +3824,6 @@ int QApplication::x11ProcessEvent(XEvent* event) return 0; } -/*! - \fn bool QApplication::x11EventFilter(XEvent *event) - - \warning This virtual function is only implemented under X11. - - If you create an application that inherits QApplication and - reimplement this function, you get direct access to all X events - that the are received from the X server. The events are passed in - the \a event parameter. - - Return true if you want to stop the event from being processed. - Return false for normal event dispatching. The default - implementation returns false. - - It is only the directly addressed messages that are filtered. - You must install an event filter directly on the event - dispatcher, which is returned by - QAbstractEventDispatcher::instance(), to handle system wide - messages. - - \sa x11ProcessEvent() -*/ - bool QApplication::x11EventFilter(XEvent *) { return false; diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index ff36ca1..4ceae3f 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -198,6 +198,7 @@ extern "C" { } composing = false; sendKeyEvents = true; + currentCustomTypes = 0; [self setHidden:YES]; return self; } @@ -212,10 +213,16 @@ extern "C" { object:self]; } --(void)registerDragTypes:(bool)accept +-(void)registerDragTypes { QMacCocoaAutoReleasePool pool; - if (accept) { + // Calling registerForDraggedTypes is slow, so only do it once for each widget + // or when the custom types change. + const QStringList& customTypes = qEnabledDraggedTypes(); + if (currentCustomTypes == 0 || *currentCustomTypes != customTypes) { + if (currentCustomTypes == 0) + currentCustomTypes = new QStringList(); + *currentCustomTypes = customTypes; const NSString* mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; NSMutableArray *supportedTypes = [NSMutableArray arrayWithObjects:NSColorPboardType, NSFilenamesPboardType, NSStringPboardType, @@ -227,13 +234,10 @@ extern "C" { NSFilesPromisePboardType, NSInkTextPboardType, NSMultipleTextSelectionPboardType, mimeTypeGeneric, nil]; // Add custom types supported by the application. - const QStringList& customTypes = qEnabledDraggedTypes(); for (int i = 0; i < customTypes.size(); i++) { [supportedTypes addObject:reinterpret_cast<const NSString *>(QCFString::toCFStringRef(customTypes[i]))]; } [self registerForDraggedTypes:supportedTypes]; - } else { - [self unregisterDraggedTypes]; } } @@ -282,6 +286,8 @@ extern "C" { - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { + if (qwidget->testAttribute(Qt::WA_DropSiteRegistered) == false) + return NSDragOperationNone; [self addDropData:sender]; QMimeData *mimeData = dropData; if (QDragManager::self()->source()) @@ -414,6 +420,8 @@ extern "C" { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + delete currentCustomTypes; + [self unregisterDraggedTypes]; [super dealloc]; } diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h index 9de94d5..983c762 100644 --- a/src/gui/kernel/qcocoaview_mac_p.h +++ b/src/gui/kernel/qcocoaview_mac_p.h @@ -83,6 +83,7 @@ Q_GUI_EXPORT bool composing; int composingLength; bool sendKeyEvents; + QStringList *currentCustomTypes; } - (id)initWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; - (void) finishInitWithQWidget:(QWidget *)widget widgetPrivate:(QWidgetPrivate *)widgetprivate; @@ -91,7 +92,7 @@ Q_GUI_EXPORT - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender; - (void)draggingExited:(id < NSDraggingInfo >)sender; - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender; -- (void)registerDragTypes:(bool)accept; +- (void)registerDragTypes; - (void)removeDropData; - (void)addDropData:(id <NSDraggingInfo>)sender; - (void)setSupportedActions:(NSDragOperation)actions; diff --git a/src/gui/kernel/qlayout.cpp b/src/gui/kernel/qlayout.cpp index 1d5a70d..4463aab 100644 --- a/src/gui/kernel/qlayout.cpp +++ b/src/gui/kernel/qlayout.cpp @@ -1028,8 +1028,13 @@ void QLayout::freeze(int w, int h) void QLayout::setMenuBar(QWidget *widget) { Q_D(QLayout); - if (widget) - addChildWidget(widget); + +#ifdef Q_OS_WINCE_WM + if (widget && widget->size().height() > 0) +#else + if (widget) +#endif + addChildWidget(widget); d->menubar = widget; } diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index f000292..9165836 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -826,13 +826,28 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev QWidget *qwidget = [theView qt_qwidget]; QWidget *widgetToGetMouse = qwidget; QWidget *popup = qAppInstance()->activePopupWidget(); - if (popup && popup != qwidget->window()) - widgetToGetMouse = popup; NSView *tmpView = theView; - if (widgetToGetMouse != qwidget) { - tmpView = qt_mac_nativeview_for(widgetToGetMouse); + + if (popup && popup != qwidget->window()) { + widgetToGetMouse = popup; + tmpView = qt_mac_nativeview_for(popup); windowPoint = [[tmpView window] convertScreenToBase:globalPoint]; + + QPoint qWindowPoint(windowPoint.x, windowPoint.y); + if (widgetToGetMouse->rect().contains(qWindowPoint)) { + // Keeping the mouse pressed on a combobox button will make + // the popup pop in front of the mouse. But all mouse events + // will be sendt to the button. Since we want mouse events + // to be sendt to widgets inside the popup, we search for the + // widget in front of the mouse: + tmpView = [tmpView hitTest:windowPoint]; + if (!tmpView) + return false; + widgetToGetMouse = + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(tmpView) qt_qwidget]; + } } + NSPoint localPoint = [tmpView convertPoint:windowPoint fromView:nil]; QPoint qlocalPoint(localPoint.x, localPoint.y); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index f9cf7b7..06f618d 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -4823,7 +4823,7 @@ void QWidget::render(QPainter *painter, const QPoint &targetOffset, Q_ASSERT(engine); QPaintEnginePrivate *enginePriv = engine->d_func(); Q_ASSERT(enginePriv); - QPaintDevice *target = painter->worldMatrixEnabled() ? engine->paintDevice() : painter->device(); + QPaintDevice *target = engine->paintDevice(); Q_ASSERT(target); // Render via a pixmap when dealing with non-opaque painters or printers. @@ -11490,3 +11490,17 @@ void QWidget::clearMask() setMask(QRegion()); } +/*! \fn const QX11Info &QWidget::x11Info() const + Returns information about the configuration of the X display used to display + the widget. + + \warning This function is only available on X11. +*/ + +/*! \fn Qt::HANDLE QWidget::x11PictureHandle() const + Returns the X11 Picture handle of the widget for XRender + support. Use of this function is not portable. This function will + return 0 if XRender support is not compiled into Qt, if the + XRender extension is not supported on the X11 display, or if the + handle could not be created. +*/ diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 5abaaf8..b315eaf 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2162,6 +2162,7 @@ void QWidgetPrivate::finishCreateWindow_sys_Carbon(OSWindowRef windowRef) setWindowModified_sys(q->isWindowModified()); updateFrameStrut(); qt_mac_update_sizer(q); + applyMaxAndMinSizeOnWindow(); } #else // QT_MAC_USE_COCOA void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWindowRef) @@ -2247,6 +2248,7 @@ void QWidgetPrivate::finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ voidWin syncCocoaMask(); macUpdateIsOpaque(); qt_mac_update_sizer(q); + applyMaxAndMinSizeOnWindow(); } #endif // QT_MAC_USE_COCOA @@ -4001,7 +4003,7 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &oldRect) } } -void QWidgetPrivate::applyMaxAndMinSizeConstraints(int &w, int &h) +void QWidgetPrivate::adjustWithinMaxAndMinSize(int &w, int &h) { if (QWExtra *extra = extraData()) { w = qMin(w, extra->maxw); @@ -4028,6 +4030,26 @@ void QWidgetPrivate::applyMaxAndMinSizeConstraints(int &w, int &h) } } +void QWidgetPrivate::applyMaxAndMinSizeOnWindow() +{ + Q_Q(QWidget); + const float max_f(20000); +#ifndef QT_MAC_USE_COCOA +#define SF(x) ((x > max_f) ? max_f : x) + HISize max = CGSizeMake(SF(extra->maxw), SF(extra->maxh)); + HISize min = CGSizeMake(SF(extra->minw), SF(extra->minh)); +#undef SF + SetWindowResizeLimits(qt_mac_window_for(q), &min, &max); +#else +#define SF(x) ((x > max_f) ? max_f : x) + NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); + NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); +#undef SF + [qt_mac_window_for(q) setMinSize:min]; + [qt_mac_window_for(q) setMaxSize:max]; +#endif +} + void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) { Q_Q(QWidget); @@ -4039,17 +4061,18 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) QMacCocoaAutoReleasePool pool; bool realWindow = isRealWindow(); - if (realWindow && !q->testAttribute(Qt::WA_DontShowOnScreen) + if (realWindow && !q->testAttribute(Qt::WA_DontShowOnScreen)){ + adjustWithinMaxAndMinSize(w, h); #ifndef QT_MAC_USE_COCOA - && !(w == 0 && h == 0) -#endif - ){ - applyMaxAndMinSizeConstraints(w, h); - topData()->isSetGeometry = 1; - topData()->isMove = isMove; -#ifndef QT_MAC_USE_COCOA - Rect r; SetRect(&r, x, y, x + w, y + h); - SetWindowBounds(qt_mac_window_for(q), kWindowContentRgn, &r); + if (w != 0 && h != 0) { + topData()->isSetGeometry = 1; + topData()->isMove = isMove; + Rect r; SetRect(&r, x, y, x + w, y + h); + SetWindowBounds(qt_mac_window_for(q), kWindowContentRgn, &r); + topData()->isSetGeometry = 0; + } else { + setGeometry_sys_helper(x, y, w, h, isMove); + } #else NSWindow *window = qt_mac_window_for(q); const QRect &fStrut = frameStrut(); @@ -4077,7 +4100,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove) [window setFrameOrigin:cocoaFrameRect.origin]; } #endif - topData()->isSetGeometry = 0; } else { setGeometry_sys_helper(x, y, w, h, isMove); } @@ -4102,40 +4124,19 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM data.crect = QRect(x, y, w, h); if (realWindow) { - if (QWExtra *extra = extraData()) { - applyMaxAndMinSizeConstraints(w, h); - qt_mac_update_sizer(q); + adjustWithinMaxAndMinSize(w, h); + qt_mac_update_sizer(q); - if (q->windowFlags() & Qt::WindowMaximizeButtonHint) { #ifndef QT_MAC_USE_COCOA - OSWindowRef window = qt_mac_window_for(q); - if(extra->maxw && extra->maxh && extra->maxw == extra->minw - && extra->maxh == extra->minh) { - ChangeWindowAttributes(window, kWindowNoAttributes, kWindowFullZoomAttribute); - } else { - ChangeWindowAttributes(window, kWindowFullZoomAttribute, kWindowNoAttributes); - } -#endif + if (q->windowFlags() & Qt::WindowMaximizeButtonHint) { + OSWindowRef window = qt_mac_window_for(q); + if (extra->maxw && extra->maxh && extra->maxw == extra->minw + && extra->maxh == extra->minh) { + ChangeWindowAttributes(window, kWindowNoAttributes, kWindowFullZoomAttribute); + } else { + ChangeWindowAttributes(window, kWindowFullZoomAttribute, kWindowNoAttributes); } - - // Update max and min constraints: - const float max_f(20000); -#ifndef QT_MAC_USE_COCOA -#define SF(x) ((x > max_f) ? max_f : x) - HISize max = CGSizeMake(SF(extra->maxw), SF(extra->maxh)); - HISize min = CGSizeMake(SF(extra->minw), SF(extra->minh)); -#undef SF - SetWindowResizeLimits(qt_mac_window_for(q), &min, &max); -#else -#define SF(x) ((x > max_f) ? max_f : x) - NSSize max = NSMakeSize(SF(extra->maxw), SF(extra->maxh)); - NSSize min = NSMakeSize(SF(extra->minw), SF(extra->minh)); -#undef SF - [qt_mac_window_for(q) setMinSize:min]; - [qt_mac_window_for(q) setMaxSize:max]; -#endif } -#ifndef QT_MAC_USE_COCOA HIRect bounds = CGRectMake(0, 0, w, h); HIViewSetFrame(qt_mac_nativeview_for(q), &bounds); #else @@ -4181,6 +4182,7 @@ void QWidgetPrivate::setGeometry_sys_helper(int x, int y, int w, int h, bool isM void QWidgetPrivate::setConstraints_sys() { updateMaximizeButton_sys(); + applyMaxAndMinSizeOnWindow(); } void QWidgetPrivate::updateMaximizeButton_sys() @@ -4495,8 +4497,8 @@ void QWidgetPrivate::registerDropSite(bool on) SetControlDragTrackingEnabled(qt_mac_nativeview_for(q), on); #else NSView *view = qt_mac_nativeview_for(q); - if ([view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { - [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes:on]; + if (on && [view isKindOfClass:[QT_MANGLE_NAMESPACE(QCocoaView) class]]) { + [static_cast<QT_MANGLE_NAMESPACE(QCocoaView) *>(view) registerDragTypes]; } #endif } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index e26b89c..734e0bd 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -267,7 +267,8 @@ public: void macUpdateIsOpaque(); void setEnabled_helper_sys(bool enable); bool isRealWindow() const; - void applyMaxAndMinSizeConstraints(int &w, int &h); + void adjustWithinMaxAndMinSize(int &w, int &h); + void applyMaxAndMinSizeOnWindow(); #endif #ifdef Q_WS_S60 diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 76734d4..6202b35 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -2747,12 +2747,6 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal opacity) 32, PropModeReplace, (uchar*)&value, 1); } -/*! - Returns information about the configuration of the X display used to display - the widget. - - \warning This function is only available on X11. -*/ const QX11Info &QWidget::x11Info() const { Q_D(const QWidget); @@ -2789,13 +2783,6 @@ QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys() return new QX11WindowSurface(q_func()); } -/*! - Returns the X11 Picture handle of the widget for XRender - support. Use of this function is not portable. This function will - return 0 if XRender support is not compiled into Qt, if the - XRender extension is not supported on the X11 display, or if the - handle could not be created. -*/ Qt::HANDLE QWidget::x11PictureHandle() const { #ifndef QT_NO_XRENDER diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 8fb7a12..0a3a8dd 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -492,7 +492,8 @@ static inline void sendUpdateRequest(QWidget *widget, bool updateImmediately) return; #if defined(Q_WS_WIN) && !defined(Q_OS_WINCE) - if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately) { + if (QApplicationPrivate::inSizeMove && widget->internalWinId() && !updateImmediately + && !widget->testAttribute(Qt::WA_DontShowOnScreen)) { // Tell Windows to send us a paint event if we're in WM_SIZE/WM_MOVE; posted events // are blocked until the mouse button is released. See task 146849. const QRegion rgn(qt_dirtyRegion(widget)); diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index dd7b016..93f11e1 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -44,8 +44,6 @@ QT_BEGIN_NAMESPACE -static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; - struct SourceOnlyAlpha { inline uchar alpha(uchar src) const { return src; } @@ -140,14 +138,11 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha { template <typename SRC, typename T> void qt_scale_image_16bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); @@ -618,14 +613,11 @@ struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha { template <typename T> void qt_scale_image_32bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, - const QRectF &target, + const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender) { - const QRectF targetRect = target.translated(aliasedCoordinateDelta, - aliasedCoordinateDelta); - qreal sx = targetRect.width() / (qreal) srcRect.width(); qreal sy = targetRect.height() / (qreal) srcRect.height(); diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 36e4300..ed4dd57 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2527,8 +2527,7 @@ static inline int color_burn_op(int dst, int src, int da, int sa) if (src == 0 || src_da + dst_sa <= sa_da) return qt_div_255(temp); - else - return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); + return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp); } template <typename T> diff --git a/src/gui/painting/qpaintdevice_qws.cpp b/src/gui/painting/qpaintdevice_qws.cpp index 6a68d28..c67be86 100644 --- a/src/gui/painting/qpaintdevice_qws.cpp +++ b/src/gui/painting/qpaintdevice_qws.cpp @@ -81,9 +81,6 @@ int QPaintDevice::metric(PaintDeviceMetric m) const } } -/*! - \internal -*/ QWSDisplay *QPaintDevice::qwsDisplay() { return qt_fbdpy; diff --git a/src/gui/painting/qpaintdevice_win.cpp b/src/gui/painting/qpaintdevice_win.cpp index 6cae744..7cd3392 100644 --- a/src/gui/painting/qpaintdevice_win.cpp +++ b/src/gui/painting/qpaintdevice_win.cpp @@ -71,16 +71,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const return 0; } - -/*! \internal -*/ HDC QPaintDevice::getDC() const { return 0; } -/*! \internal -*/ void QPaintDevice::releaseDC(HDC) const { } diff --git a/src/gui/painting/qpaintdevice_x11.cpp b/src/gui/painting/qpaintdevice_x11.cpp index 4ea9f57..95cb115 100644 --- a/src/gui/painting/qpaintdevice_x11.cpp +++ b/src/gui/painting/qpaintdevice_x11.cpp @@ -106,33 +106,11 @@ int QPaintDevice::metric(PaintDeviceMetric) const #ifdef QT3_SUPPORT -/*! - Use QX11Info::display() instead. - - \oldcode - Display *display = widget->x11Display(); - \newcode - Display *display = QX11Info::display(); - \endcode - - \sa QWidget::x11Info(), QX11Info::display() -*/ Display *QPaintDevice::x11Display() const { return X11->display; } -/*! - Use QX11Info::screen() instead. - - \oldcode - int screen = widget->x11Screen(); - \newcode - int screen = widget->x11Info().screen(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Screen() const { const QX11Info *info = qt_x11Info(this); @@ -141,17 +119,6 @@ int QPaintDevice::x11Screen() const return QX11Info::appScreen(); } -/*! - Use QX11Info::visual() instead. - - \oldcode - void *visual = widget->x11Visual(); - \newcode - void *visual = widget->x11Info().visual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ void *QPaintDevice::x11Visual() const { const QX11Info *info = qt_x11Info(this); @@ -160,17 +127,6 @@ void *QPaintDevice::x11Visual() const return QX11Info::appVisual(); } -/*! - Use QX11Info::depth() instead. - - \oldcode - int depth = widget->x11Depth(); - \newcode - int depth = widget->x11Info().depth(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Depth() const { const QX11Info *info = qt_x11Info(this); @@ -179,17 +135,6 @@ int QPaintDevice::x11Depth() const return QX11Info::appDepth(); } -/*! - Use QX11Info::cells() instead. - - \oldcode - int cells = widget->x11Cells(); - \newcode - int cells = widget->x11Info().cells(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11Cells() const { const QX11Info *info = qt_x11Info(this); @@ -198,17 +143,6 @@ int QPaintDevice::x11Cells() const return QX11Info::appCells(); } -/*! - Use QX11Info::colormap() instead. - - \oldcode - unsigned long screen = widget->x11Colormap(); - \newcode - unsigned long screen = widget->x11Info().colormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11Colormap() const { const QX11Info *info = qt_x11Info(this); @@ -217,17 +151,6 @@ Qt::HANDLE QPaintDevice::x11Colormap() const return QX11Info::appColormap(); } -/*! - Use QX11Info::defaultColormap() instead. - - \oldcode - bool isDefault = widget->x11DefaultColormap(); - \newcode - bool isDefault = widget->x11Info().defaultColormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11DefaultColormap() const { const QX11Info *info = qt_x11Info(this); @@ -236,17 +159,6 @@ bool QPaintDevice::x11DefaultColormap() const return QX11Info::appDefaultColormap(); } -/*! - Use QX11Info::defaultVisual() instead. - - \oldcode - bool isDefault = widget->x11DefaultVisual(); - \newcode - bool isDefault = widget->x11Info().defaultVisual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11DefaultVisual() const { const QX11Info *info = qt_x11Info(this); @@ -255,176 +167,48 @@ bool QPaintDevice::x11DefaultVisual() const return QX11Info::appDefaultVisual(); } -/*! - Use QX11Info::visual() instead. - - \oldcode - void *visual = QPaintDevice::x11AppVisual(screen); - \newcode - void *visual = qApp->x11Info(screen).visual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ void *QPaintDevice::x11AppVisual(int screen) { return QX11Info::appVisual(screen); } -/*! - Use QX11Info::colormap() instead. - - \oldcode - unsigned long colormap = QPaintDevice::x11AppColormap(screen); - \newcode - unsigned long colormap = qApp->x11Info(screen).colormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11AppColormap(int screen) { return QX11Info::appColormap(screen); } -/*! - Use QX11Info::display() instead. - - \oldcode - Display *display = QPaintDevice::x11AppDisplay(); - \newcode - Display *display = qApp->x11Info().display(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Display *QPaintDevice::x11AppDisplay() { return QX11Info::display(); } -/*! - Use QX11Info::screen() instead. - - \oldcode - int screen = QPaintDevice::x11AppScreen(); - \newcode - int screen = qApp->x11Info().screen(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppScreen() { return QX11Info::appScreen(); } -/*! - Use QX11Info::depth() instead. - - \oldcode - int depth = QPaintDevice::x11AppDepth(screen); - \newcode - int depth = qApp->x11Info(screen).depth(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDepth(int screen) { return QX11Info::appDepth(screen); } -/*! - Use QX11Info::cells() instead. - - \oldcode - int cells = QPaintDevice::x11AppCells(screen); - \newcode - int cells = qApp->x11Info(screen).cells(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppCells(int screen) { return QX11Info::appCells(screen); } -/*! - Use QX11Info::appRootWindow() instead. - - \oldcode - unsigned long window = QPaintDevice::x11AppRootWindow(screen); - \newcode - unsigned long window = qApp->x11Info(screen).appRootWindow(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen) { return QX11Info::appRootWindow(screen); } -/*! - Use QX11Info::defaultColormap() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDefaultColormap(screen); - \newcode - bool isDefault = qApp->x11Info(screen).defaultColormap(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11AppDefaultColormap(int screen) { return QX11Info::appDefaultColormap(screen); } -/*! - Use QX11Info::defaultVisual() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDefaultVisual(screen); - \newcode - bool isDefault = qApp->x11Info(screen).defaultVisual(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ bool QPaintDevice::x11AppDefaultVisual(int screen) { return QX11Info::appDefaultVisual(screen); } -/*! - Use QX11Info::setAppDpiX() instead. -*/ void QPaintDevice::x11SetAppDpiX(int dpi, int screen) { QX11Info::setAppDpiX(dpi, screen); } -/*! - Use QX11Info::setAppDpiY() instead. -*/ void QPaintDevice::x11SetAppDpiY(int dpi, int screen) { QX11Info::setAppDpiY(dpi, screen); } - -/*! - Use QX11Info::appDpiX() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDpiX(screen); - \newcode - bool isDefault = qApp->x11Info(screen).appDpiX(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDpiX(int screen) { return QX11Info::appDpiX(screen); } -/*! - Use QX11Info::appDpiY() instead. - - \oldcode - bool isDefault = QPaintDevice::x11AppDpiY(screen); - \newcode - bool isDefault = qApp->x11Info(screen).appDpiY(); - \endcode - - \sa QWidget::x11Info(), QPixmap::x11Info() -*/ int QPaintDevice::x11AppDpiY(int screen) { return QX11Info::appDpiY(screen); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index ba8f2a3..1192a58 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2575,7 +2575,12 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe QRasterPaintEngineState *s = state(); const bool aa = s->flags.antialiased || s->flags.bilinear; if (!aa && sr.size() == QSize(1, 1)) { + // as fillRect will apply the aliased coordinate delta we need to + // subtract it here as we don't use it for image drawing + QTransform old = s->matrix; + s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); + s->matrix = old; return; } @@ -2609,6 +2614,18 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe return; d->image_filler_xform.setupMatrix(copy, s->flags.bilinear); + if (!aa && s->matrix.type() == QTransform::TxScale) { + QRectF rr = s->matrix.mapRect(r); + + const int x1 = qRound(rr.x()); + const int y1 = qRound(rr.y()); + const int x2 = qRound(rr.right()); + const int y2 = qRound(rr.bottom()); + + fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d); + return; + } + #ifdef QT_FAST_SPANS ensureState(); if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) { diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 4b2fbca..9cc9683 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -1543,6 +1543,8 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p QX11PaintEnginePrivate::GCMode gcMode, QPaintEngine::PolygonDrawMode mode) { + Q_Q(QX11PaintEngine); + int clippedCount = 0; qt_float_point *clippedPoints = 0; @@ -1617,7 +1619,29 @@ void QX11PaintEnginePrivate::fillPolygon_dev(const QPointF *polygonPoints, int p } else #endif if (fill.style() != Qt::NoBrush) { - if (clippedCount > 0) { + if (clippedCount > 200000) { + QPolygon poly; + for (int i = 0; i < clippedCount; ++i) + poly << QPoint(qFloor(clippedPoints[i].x), qFloor(clippedPoints[i].y)); + + const QRect bounds = poly.boundingRect(); + const QRect aligned = bounds + & QRect(QPoint(), QSize(pdev->width(), pdev->height())); + + QImage img(aligned.size(), QImage::Format_ARGB32_Premultiplied); + img.fill(0); + + QPainter painter(&img); + painter.translate(-aligned.x(), -aligned.y()); + painter.setPen(Qt::NoPen); + painter.setBrush(fill); + if (gcMode == BrushGC) + painter.setBrushOrigin(q->painter()->brushOrigin()); + painter.drawPolygon(poly); + painter.end(); + + q->drawImage(aligned, img, img.rect(), Qt::AutoColor); + } else if (clippedCount > 0) { QVarLengthArray<XPoint> xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { xpoints[i].x = qFloor(clippedPoints[i].x); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index afc4211..baa9ce3 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -8571,4 +8571,252 @@ void qt_draw_helper(QPainterPrivate *p, const QPainterPath &path, QPainterPrivat p->draw_helper(path, operation); } +/*! \fn Display *QPaintDevice::x11Display() const + Use QX11Info::display() instead. + + \oldcode + Display *display = widget->x11Display(); + \newcode + Display *display = QX11Info::display(); + \endcode + + \sa QWidget::x11Info(), QX11Info::display() +*/ + +/*! \fn int QPaintDevice::x11Screen() const + Use QX11Info::screen() instead. + + \oldcode + int screen = widget->x11Screen(); + \newcode + int screen = widget->x11Info().screen(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void *QPaintDevice::x11Visual() const + Use QX11Info::visual() instead. + + \oldcode + void *visual = widget->x11Visual(); + \newcode + void *visual = widget->x11Info().visual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11Depth() const + Use QX11Info::depth() instead. + + \oldcode + int depth = widget->x11Depth(); + \newcode + int depth = widget->x11Info().depth(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11Cells() const + Use QX11Info::cells() instead. + + \oldcode + int cells = widget->x11Cells(); + \newcode + int cells = widget->x11Info().cells(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11Colormap() const + Use QX11Info::colormap() instead. + + \oldcode + unsigned long screen = widget->x11Colormap(); + \newcode + unsigned long screen = widget->x11Info().colormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11DefaultColormap() const + Use QX11Info::defaultColormap() instead. + + \oldcode + bool isDefault = widget->x11DefaultColormap(); + \newcode + bool isDefault = widget->x11Info().defaultColormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11DefaultVisual() const + Use QX11Info::defaultVisual() instead. + + \oldcode + bool isDefault = widget->x11DefaultVisual(); + \newcode + bool isDefault = widget->x11Info().defaultVisual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void *QPaintDevice::x11AppVisual(int screen) + Use QX11Info::visual() instead. + + \oldcode + void *visual = QPaintDevice::x11AppVisual(screen); + \newcode + void *visual = qApp->x11Info(screen).visual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11AppColormap(int screen) + Use QX11Info::colormap() instead. + + \oldcode + unsigned long colormap = QPaintDevice::x11AppColormap(screen); + \newcode + unsigned long colormap = qApp->x11Info(screen).colormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Display *QPaintDevice::x11AppDisplay() + Use QX11Info::display() instead. + + \oldcode + Display *display = QPaintDevice::x11AppDisplay(); + \newcode + Display *display = qApp->x11Info().display(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppScreen() + Use QX11Info::screen() instead. + + \oldcode + int screen = QPaintDevice::x11AppScreen(); + \newcode + int screen = qApp->x11Info().screen(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppDepth(int screen) + Use QX11Info::depth() instead. + + \oldcode + int depth = QPaintDevice::x11AppDepth(screen); + \newcode + int depth = qApp->x11Info(screen).depth(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppCells(int screen) + Use QX11Info::cells() instead. + + \oldcode + int cells = QPaintDevice::x11AppCells(screen); + \newcode + int cells = qApp->x11Info(screen).cells(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn Qt::HANDLE QPaintDevice::x11AppRootWindow(int screen) + Use QX11Info::appRootWindow() instead. + + \oldcode + unsigned long window = QPaintDevice::x11AppRootWindow(screen); + \newcode + unsigned long window = qApp->x11Info(screen).appRootWindow(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11AppDefaultColormap(int screen) + Use QX11Info::defaultColormap() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDefaultColormap(screen); + \newcode + bool isDefault = qApp->x11Info(screen).defaultColormap(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn bool QPaintDevice::x11AppDefaultVisual(int screen) + Use QX11Info::defaultVisual() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDefaultVisual(screen); + \newcode + bool isDefault = qApp->x11Info(screen).defaultVisual(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn void QPaintDevice::x11SetAppDpiX(int dpi, int screen) + Use QX11Info::setAppDpiX() instead. +*/ + +/*! \fn void QPaintDevice::x11SetAppDpiY(int dpi, int screen) + Use QX11Info::setAppDpiY() instead. +*/ + +/*! \fn int QPaintDevice::x11AppDpiX(int screen) + Use QX11Info::appDpiX() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDpiX(screen); + \newcode + bool isDefault = qApp->x11Info(screen).appDpiX(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn int QPaintDevice::x11AppDpiY(int screen) + Use QX11Info::appDpiY() instead. + + \oldcode + bool isDefault = QPaintDevice::x11AppDpiY(screen); + \newcode + bool isDefault = qApp->x11Info(screen).appDpiY(); + \endcode + + \sa QWidget::x11Info(), QPixmap::x11Info() +*/ + +/*! \fn HDC QPaintDevice::getDC() const + \internal +*/ + +/*! \fn void QPaintDevice::releaseDC(HDC) const + \internal +*/ + +/*! \fn QWSDisplay *QPaintDevice::qwsDisplay() + \internal +*/ + QT_END_NAMESPACE diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index 4f3e71c..5090b3a 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -284,8 +284,8 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke to send PostScript or PDF output to the printer. As an alternative, the printProgram() function can be used to specify the command or utility to use instead of the system default. - - Note that setting parameters like paper size and resolution on an + + Note that setting parameters like paper size and resolution on an invalid printer is undefined. You can use QPrinter::isValid() to verify this before changing any parameters. @@ -744,7 +744,7 @@ void QPrinter::setOutputFormat(OutputFormat format) #ifndef QT_NO_PDF Q_D(QPrinter); - if (d->outputFormat == format) + if (d->validPrinter && d->outputFormat == format) return; d->outputFormat = format; @@ -773,8 +773,8 @@ void QPrinter::setOutputFormat(OutputFormat format) if (def_engine) delete oldPrintEngine; - d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat; - + if (d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat) + d->validPrinter = true; #else Q_UNUSED(format); #endif diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index 7a74fe0..110ba2f 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -142,8 +142,7 @@ void QRasterWindowSurface::beginPaint(const QRegion &rgn) p.fillRect(*it, blank); } } -#endif -#if defined(Q_OS_WINCE) +#else Q_UNUSED(rgn); #endif } @@ -250,6 +249,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi // d->image->image.save("flush.png"); + Q_UNUSED(offset); // Get a context for the widget. #ifndef QT_MAC_USE_COCOA CGContextRef context; diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index c973b41..7a870fe 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -549,7 +549,6 @@ extern QPaintDevice *qt_mac_safe_pdev; //qapplication_mac.cpp QMacCGStyle globals *****************************************************************************/ const int qt_mac_hitheme_version = 0; //the HITheme version we speak -const int macSpinBoxSep = 5; // distance between spinwidget and the lineedit const int macItemFrame = 2; // menu item frame width const int macItemHMargin = 3; // menu item hor text margin const int macItemVMargin = 2; // menu item ver text margin @@ -2376,7 +2375,14 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW break; case PM_SpinBoxFrameWidth: GetThemeMetric(kThemeMetricEditTextFrameOutset, &ret); - ret += 2; + switch (d->aquaSizeConstrain(opt, widget)) { + default: + ret += 2; + break; + case QAquaSizeMini: + ret += 1; + break; + } break; case PM_ButtonShiftHorizontal: case PM_ButtonShiftVertical: @@ -5017,11 +5023,10 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex bdi.kind = kThemeIncDecButton; break; case QAquaSizeMini: + bdi.kind = kThemeIncDecButtonMini; + break; case QAquaSizeSmall: - if (aquaSize == QAquaSizeMini) - bdi.kind = kThemeIncDecButtonMini; - else - bdi.kind = kThemeIncDecButtonSmall; + bdi.kind = kThemeIncDecButtonSmall; break; } if (!(sb->stepEnabled & (QAbstractSpinBox::StepUpEnabled @@ -5041,8 +5046,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex bdi.value = kThemeButtonOff; bdi.adornment = kThemeAdornmentNone; - QRect updown = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, - widget); + QRect updown = subControlRect(CC_SpinBox, sb, SC_SpinBoxUp, widget); + updown |= subControlRect(CC_SpinBox, sb, SC_SpinBoxDown, widget); HIRect newRect = qt_hirectForQRect(updown); QRect off_rct; @@ -5053,15 +5058,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex int(outRect.size.width - newRect.size.width), int(outRect.size.height - newRect.size.height)); - // HIThemeGetButtonBackgroundBounds offsets non-focused normal sized - // buttons by one in de y direction, account for that here. - if (bdi.adornment == kThemeAdornmentNone && bdi.kind == kThemeIncDecButton) - off_rct.adjust(0, 1, 0, 0); - - // Adjust the rect for small buttos also. - if (bdi.adornment == kThemeAdornmentFocus && bdi.kind == kThemeIncDecButtonSmall) - off_rct.adjust(0, 0, 0, -1); - newRect = qt_hirectForQRect(updown, off_rct); HIThemeDrawButton(&newRect, &bdi, cg, kHIThemeOrientationNormal, 0); } @@ -5726,39 +5722,61 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op break; case CC_SpinBox: if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) { - const int spinner_w = 14, - fw = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); + QAquaWidgetSize aquaSize = d->aquaSizeConstrain(spin, widget); + int spinner_w; + int spinBoxSep; + int fw = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); + switch (aquaSize) { + default: + case QAquaSizeUnknown: + case QAquaSizeLarge: + spinner_w = 14; + spinBoxSep = 2; + break; + case QAquaSizeSmall: + spinner_w = 12; + spinBoxSep = 2; + break; + case QAquaSizeMini: + spinner_w = 10; + spinBoxSep = 1; + break; + } + switch (sc) { case SC_SpinBoxUp: case SC_SpinBoxDown: { if (spin->buttonSymbols == QAbstractSpinBox::NoButtons) break; - const int frameWidth = pixelMetric(PM_SpinBoxFrameWidth, spin, widget); - const int spinner_w = 18; - const int y = frameWidth; - const int x = spin->rect.width() - spinner_w + frameWidth; + + const int y = fw; + const int x = spin->rect.width() - spinner_w; ret.setRect(x + spin->rect.x(), y + spin->rect.y(), spinner_w, spin->rect.height() - y * 2); HIThemeButtonDrawInfo bdi; bdi.version = qt_mac_hitheme_version; bdi.kind = kThemeIncDecButton; - QAquaWidgetSize aquaSize = d->aquaSizeConstrain(opt, widget); + int hackTranslateX; switch (aquaSize) { - case QAquaSizeUnknown: - case QAquaSizeLarge: - bdi.kind = kThemeIncDecButton; - break; - case QAquaSizeMini: - case QAquaSizeSmall: - if (aquaSize == QAquaSizeMini) - bdi.kind = kThemeIncDecButtonMini; - else - bdi.kind = kThemeIncDecButtonSmall; - break; + default: + case QAquaSizeUnknown: + case QAquaSizeLarge: + bdi.kind = kThemeIncDecButton; + hackTranslateX = 0; + break; + case QAquaSizeSmall: + bdi.kind = kThemeIncDecButtonSmall; + hackTranslateX = -2; + break; + case QAquaSizeMini: + bdi.kind = kThemeIncDecButtonMini; + hackTranslateX = -1; + break; } bdi.state = kThemeStateActive; bdi.value = kThemeButtonOff; bdi.adornment = kThemeAdornmentNone; HIRect hirect = qt_hirectForQRect(ret); + HIRect outRect; HIThemeGetButtonBackgroundBounds(&hirect, &bdi, &outRect); ret = qt_qrectForHIRect(outRect); @@ -5773,13 +5791,13 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op Q_ASSERT(0); break; } - ret.translate(-1, -2); // hack: position the buttons correctly (weird that we need this) + ret.translate(hackTranslateX, 0); // hack: position the buttons correctly (weird that we need this) ret = visualRect(spin->direction, spin->rect, ret); break; } case SC_SpinBoxEditField: ret.setRect(fw, fw, - spin->rect.width() - spinner_w - fw * 2 - macSpinBoxSep + 1, + spin->rect.width() - spinner_w - fw * 2 - spinBoxSep, spin->rect.height() - fw * 2); ret = visualRect(spin->direction, spin->rect, ret); break; @@ -5811,8 +5829,8 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, switch (ct) { case QStyle::CT_SpinBox: - sz.setWidth(sz.width() + macSpinBoxSep); - sz.setHeight(sz.height() - 3); // hack to work around horrible sizeHint() code in QAbstractSpinBox + // hack to work around horrible sizeHint() code in QAbstractSpinBox + sz.setHeight(sz.height() - 3); break; case QStyle::CT_TabBarTab: if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(opt)) { diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 2db73b6..9333907 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -104,6 +104,7 @@ const struct QS60StylePrivate::frameElementCenter QS60StylePrivate::m_frameEleme {SE_ToolBar, QS60StyleEnums::SP_QsnFrPopupSubCenter}, {SE_ToolBarButton, QS60StyleEnums::SP_QsnFrSctrlButtonCenter}, {SE_ToolBarButtonPressed, QS60StyleEnums::SP_QsnFrSctrlButtonCenterPressed}, + {SE_PanelBackground, QS60StyleEnums::SP_QsnFrSetOptCenter}, }; static const int frameElementsCount = int(sizeof(QS60StylePrivate::m_frameElementsData)/sizeof(QS60StylePrivate::m_frameElementsData[0])); @@ -319,7 +320,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_ToolBarButtonPressed: drawFrame(SF_ToolBarButtonPressed, painter, rect, flags | SF_PointNorth); break; - + case SE_PanelBackground: + drawFrame(SF_PanelBackground, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -826,8 +829,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom #endif // QT_NO_SLIDER #ifndef QT_NO_COMBOBOX case CC_ComboBox: - if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) - { + if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { const QRect cmbxEditField = subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget); const QRect cmbxFrame = subControlRect(CC_ComboBox, option, SC_ComboBoxFrame, widget); @@ -1098,7 +1100,6 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom } } break; - #endif //QT_NO_GROUPBOX //todo: remove non-used complex widgets in final version @@ -1125,17 +1126,62 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, Q_D(const QS60Style); const QS60StylePrivate::SkinElementFlags flags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; switch (element) { + case CE_PushButton: + if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) { + + drawControl(CE_PushButtonBevel, btn, painter, widget); + QStyleOptionButton subopt = *btn; + subopt.rect = subElementRect(SE_PushButtonContents, btn, widget); + + if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) { + if (buttonWidget->isCheckable()) { + QStyleOptionButton checkopt = subopt; + + const int indicatorHeight(pixelMetric(PM_IndicatorHeight)); + const int verticalAdjust = (option->rect.height() - indicatorHeight) >> 1; + + checkopt.rect.adjust(pixelMetric(PM_ButtonMargin), verticalAdjust, 0, 0); + checkopt.rect.setWidth(pixelMetric(PM_IndicatorWidth)); + checkopt.rect.setHeight(indicatorHeight); + + drawPrimitive(PE_IndicatorCheckBox, &checkopt, painter, widget); + } + } + + drawControl(CE_PushButtonLabel, &subopt, painter, widget); + if (btn->state & State_HasFocus) { + QStyleOptionFocusRect fropt; + fropt.QStyleOption::operator=(*btn); + fropt.rect = subElementRect(SE_PushButtonFocusRect, btn, widget); + drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + } + } + break; case CE_PushButtonBevel: - { + if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { const bool isPressed = option->state & QStyle::State_Sunken; - const QS60StylePrivate::SkinElements skinElement = - isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; - QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); + if (button->features & QStyleOptionButton::Flat) { + const QS60StyleEnums::SkinParts skinPart = + isPressed ? QS60StyleEnums::SP_QsnFrButtonTbCenterPressed : QS60StyleEnums::SP_QsnFrButtonTbCenter; + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, flags); + } else { + const QS60StylePrivate::SkinElements skinElement = + isPressed ? QS60StylePrivate::SE_ButtonPressed : QS60StylePrivate::SE_ButtonNormal; + QS60StylePrivate::drawSkinElement(skinElement, painter, option->rect, flags); + } } break; case CE_PushButtonLabel: if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(option)) { QStyleOptionButton optionButton = *button; + + if (const QAbstractButton *buttonWidget = (qobject_cast<const QAbstractButton *>(widget))) { + if (buttonWidget->isCheckable()) { + // space for check box. + optionButton.rect.adjust(pixelMetric(PM_IndicatorWidth) + + pixelMetric(PM_ButtonMargin) + pixelMetric(PM_CheckBoxLabelSpacing), 0, 0, 0); + } + } QCommonStyle::drawControl(element, &optionButton, painter, widget); } break; @@ -1665,7 +1711,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, painter->restore(); } break; - case CE_HeaderEmptyArea: { QS60StylePrivate::SkinElementFlags adjFlags = flags; @@ -1704,7 +1749,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QCommonStyle::drawControl(element, header, painter, widget); } break; - #ifndef QT_NO_TOOLBAR case CE_ToolBar: if (const QStyleOptionToolBar *toolBar = qstyleoption_cast<const QStyleOptionToolBar *>(option)) { @@ -1756,7 +1800,6 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_MenuTearoff: #endif //QT_NO_MENU - case CE_PushButton: case CE_CheckBox: case CE_RadioButton: #ifndef QT_NO_TABBAR @@ -1993,7 +2036,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti } } break; - case PE_Widget: if (QS60StylePrivate::isSkinnableDialog(widget) || qobject_cast<const QComboBoxListView *>(widget) || @@ -2004,19 +2046,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; case PE_FrameWindow: case PE_FrameTabWidget: - { if (const QStyleOptionTabWidgetFrame *tabFrame = qstyleoption_cast<const QStyleOptionTabWidgetFrame *>(option)) { QStyleOptionTabWidgetFrame optionTabFrame = *tabFrame; - - const QColor baseColor(QS60StylePrivate::lighterColor( - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option))); - const QPalette tabPalette(baseColor); - optionTabFrame.palette = tabPalette; - QCommonStyle::drawPrimitive(element, &optionTabFrame, painter, widget); - } + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_PanelBackground, painter, optionTabFrame.rect, flags); } break; - case PE_IndicatorHeaderArrow: if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) { if (header->sortIndicator & QStyleOptionHeader::SortUp) @@ -2025,7 +2059,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti drawPrimitive(PE_IndicatorArrowDown, header, painter, widget); } // QStyleOptionHeader::None is not drawn => not needed break; - #ifndef QT_NO_GROUPBOX case PE_FrameGroupBox: if (const QStyleOptionFrameV2 *frame = qstyleoption_cast<const QStyleOptionFrameV2 *>(option)) @@ -2041,12 +2074,10 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_Q3Separator: Q_ASSERT(false); break; - case PE_Frame: if (const QStyleOptionFrameV3 *frame = qstyleoption_cast<const QStyleOptionFrameV3 *>(option)) drawPrimitive(PE_FrameFocusRect, frame, painter, widget); break; - #ifndef QT_NO_ITEMVIEWS case PE_PanelItemViewItem: case PE_PanelItemViewRow: // ### Qt 5: remove @@ -2063,7 +2094,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti drawPrimitive(PE_IndicatorCheckBox, &optionCheckBox, painter, widget); } break; - #ifndef QT_NO_TOOLBAR case PE_IndicatorToolBarHandle: // no toolbar handles in S60/AVKON UI @@ -2076,9 +2106,53 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti case PE_FrameMenu: break; //disable frame in menu + case PE_IndicatorBranch: + { +#if defined(Q_WS_S60) + if (QSysInfo::s60Version() == QSysInfo::SV_S60_3_1) { +#else + if (true) { +#endif + QCommonStyle::drawPrimitive(element, option, painter, widget); + } else { + if (option->state & State_Children) { + QS60StyleEnums::SkinParts skinPart = + (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; + int minDimension = qMin(option->rect.width(), option->rect.height()); + const int resizeValue = minDimension >> 1; + minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. + QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); + iconRect.translate(3, 2 - resizeValue); + QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); + } + + const bool rightLine = option->state & State_Item; + const bool downLine = option->state & State_Sibling; + const bool upLine = option->state & (State_Open | State_Children | State_Item | State_Sibling); + + QS60StyleEnums::SkinParts skinPart; + bool drawSkinPart = false; + if (rightLine && downLine && upLine) { + skinPart = QS60StyleEnums::SP_QgnIndiHlLineBranch; + drawSkinPart = true; + } else if (rightLine && upLine) { + skinPart = QS60StyleEnums::SP_QgnIndiHlLineEnd; + drawSkinPart = true; + } else if (upLine && downLine) { + skinPart = QS60StyleEnums::SP_QgnIndiHlLineStraight; + drawSkinPart = true; + } + + if ( drawSkinPart ) { + QS60StylePrivate::drawSkinPart(skinPart, painter, option->rect, + (flags | QS60StylePrivate::SF_ColorSkinned)); + } + } + } + break; + // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: - case PE_IndicatorBranch: case PE_IndicatorButtonDropDown: case PE_IndicatorDockWidgetResizeHandle: case PE_PanelTipLabel: @@ -2494,35 +2568,33 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con } break; case SE_ItemViewItemCheckIndicator: - { - if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) { - const QListWidget *listItem = qobject_cast<const QListWidget *>(widget); - - const bool singleSelection = listItem && - (listItem->selectionMode() == QAbstractItemView::SingleSelection || - listItem->selectionMode() == QAbstractItemView::NoSelection); - const bool checkBoxOnly = (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) && - listItem && - singleSelection; - - // Selection check mark rect. - const int indicatorWidth = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorWidth); - const int indicatorHeight = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorHeight); - const int spacing = QS60StylePrivate::pixelMetric(QStyle::PM_CheckBoxLabelSpacing); - - const int itemHeight = opt->rect.height(); - int heightOffset = 0; - if (indicatorHeight < itemHeight) - heightOffset = ((itemHeight - indicatorHeight)>>1); - if (checkBoxOnly) { - // Move rect and make it slightly smaller, so that - // a) highlight border does not cross the rect - // b) in s60 list checkbox is smaller than normal checkbox - ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3); - } else { - ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, - indicatorWidth, indicatorHeight); - } + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) { + const QListWidget *listItem = qobject_cast<const QListWidget *>(widget); + + const bool singleSelection = listItem && + (listItem->selectionMode() == QAbstractItemView::SingleSelection || + listItem->selectionMode() == QAbstractItemView::NoSelection); + const bool checkBoxOnly = (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) && + listItem && + singleSelection; + + // Selection check mark rect. + const int indicatorWidth = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorWidth); + const int indicatorHeight = QS60StylePrivate::pixelMetric(QStyle::PM_IndicatorHeight); + const int spacing = QS60StylePrivate::pixelMetric(QStyle::PM_CheckBoxLabelSpacing); + + const int itemHeight = opt->rect.height(); + int heightOffset = 0; + if (indicatorHeight < itemHeight) + heightOffset = ((itemHeight - indicatorHeight)>>1); + if (checkBoxOnly) { + // Move rect and make it slightly smaller, so that + // a) highlight border does not cross the rect + // b) in s60 list checkbox is smaller than normal checkbox + ret.setRect(opt->rect.left()+3, opt->rect.top() + heightOffset, indicatorWidth-3, indicatorHeight-3); + } else { + ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, + indicatorWidth, indicatorHeight); } } break; @@ -2575,8 +2647,7 @@ QIcon QS60Style::standardIconImplementation(StandardPixmap standardIcon, if (option) adjustedFlags = (option->state & State_Enabled) ? QS60StylePrivate::SF_StateEnabled : QS60StylePrivate::SF_StateDisabled; - switch(standardIcon) - { + switch(standardIcon) { case QStyle::SP_MessageBoxWarning: part = QS60StyleEnums::SP_QgnNoteWarning; break; diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index aafbe00..8fe1c5d 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -87,6 +87,11 @@ public: SP_QgnGrafTabPassiveR, SP_QgnIndiCheckboxOff, SP_QgnIndiCheckboxOn, + SP_QgnIndiHlColSuper, // Available in S60 release 3.2 and later. + SP_QgnIndiHlExpSuper, // Available in S60 release 3.2 and later. + SP_QgnIndiHlLineBranch, // Available in S60 release 3.2 and later. + SP_QgnIndiHlLineEnd, // Available in S60 release 3.2 and later. + SP_QgnIndiHlLineStraight, // Available in S60 release 3.2 and later. SP_QgnIndiMarkedAdd, SP_QgnIndiNaviArrowLeft, SP_QgnIndiNaviArrowRight, @@ -276,7 +281,8 @@ public: SE_ToolTip, //own graphic available on 3.2+ releases, SE_ToolBar, SE_ToolBarButton, - SE_ToolBarButtonPressed + SE_ToolBarButtonPressed, + SE_PanelBackground }; enum SkinFrameElements { @@ -291,7 +297,8 @@ public: SF_ToolTip, SF_ToolBar, SF_ToolBarButton, - SF_ToolBarButtonPressed + SF_ToolBarButtonPressed, + SF_PanelBackground }; enum SkinElementFlag { diff --git a/src/gui/styles/qs60style_symbian.cpp b/src/gui/styles/qs60style_symbian.cpp index 89a0354..b54f819 100644 --- a/src/gui/styles/qs60style_symbian.cpp +++ b/src/gui/styles/qs60style_symbian.cpp @@ -43,6 +43,7 @@ enum TDrawType { }; enum TSupportRelease { + ES60_None = 0x0000, //indicates that the commonstyle should draw the graphics ES60_3_1 = 0x0001, ES60_3_2 = 0x0002, ES60_5_0 = 0x0004, @@ -54,11 +55,21 @@ typedef struct { const TAknsItemID &skinID; TDrawType drawType; int supportInfo; - int fallbackGraphicID; int newMajorSkinId; int newMinorSkinId; } partMapEntry; +enum TFallbackMbmFile { + EAvkonMbm = 0, + ELastMbm +}; + +typedef struct { + const QS60StyleEnums::SkinParts partID; + TFallbackMbmFile fallbackFileID; //to avoid putting large char strings to table, lets only have a mapping value + int fallbackGraphicID; +} fallbackMapEntry; + class QS60StyleModeSpecifics { public: @@ -77,184 +88,235 @@ private: static QPixmap colorSkinnedGraphicsL(const QS60StyleEnums::SkinParts &stylepart, const QSize &size, QS60StylePrivate::SkinElementFlags flags); static void frameIdAndCenterId(QS60StylePrivate::SkinFrameElements frameElement, TAknsItemID &frameId, TAknsItemID ¢erId); + static TRect innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect); static void checkAndUnCompressBitmapL(CFbsBitmap*& aOriginalBitmap); static void checkAndUnCompressBitmap(CFbsBitmap*& aOriginalBitmap); static void unCompressBitmapL(const TRect& aTrgRect, CFbsBitmap* aTrgBitmap, CFbsBitmap* aSrcBitmap); static void colorGroupAndIndex(QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex); + static const TDesC& mapFallBackFileName(const int fileID); static bool checkSupport(const int supportedRelease); static TAknsItemID checkAndUpdateReleaseSpecificGraphics(int part); // Array to match the skin ID, fallback graphics and Qt widget graphics. static const partMapEntry m_partMap[]; + static const fallbackMapEntry m_fallbackMap[]; }; -const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { - /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_wait_1 ,-1,-1}, - /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_center ,-1,-1}, - /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_side_l ,-1,-1}, - /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_frame_side_r ,-1,-1}, - /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_bar_progress ,-1,-1}, - /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_active_l ,-1,-1}, - /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_active_m ,-1,-1}, - /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_active_r ,-1,-1}, - /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_passive_l ,-1,-1}, - /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_passive_m ,-1,-1}, - /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_graf_tab_passive_r ,-1,-1}, - /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_checkbox_off ,-1,-1}, - /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_checkbox_on ,-1,-1}, - /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_marked_add ,-1,-1}, - /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_navi_arrow_left ,-1,-1}, - /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_navi_arrow_right ,-1,-1}, - /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_radiobutt_off ,-1,-1}, - /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_radiobutt_on ,-1,-1}, - /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_slider_edit ,-1,-1}, - /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_indi_submenu ,-1,-1}, - /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_erased ,-1,-1}, - /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_error ,-1,-1}, - /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_info ,-1,-1}, - /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_ok ,-1,-1}, - /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_query ,-1,-1}, - /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_note_warning ,-1,-1}, - /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_prop_file_small ,-1,-1}, - /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_prop_folder_current ,-1,-1}, - /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_prop_folder_small ,-1,-1}, - /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_prop_folder_small_new ,-1,-1}, - /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, EMbmAvkonQgn_prop_phone_memc_large ,-1,-1}, - +//FallbackMap has fallback graphics from various mbm-files in case that the requested icon is not in +//active or root skin. // No fallback graphics for screen elements (it is guaranteed that the root skin contains these). - /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, - - /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, +const fallbackMapEntry QS60StyleModeSpecifics::m_fallbackMap[] = { + {QS60StyleEnums::SP_QgnGrafBarWait, EAvkonMbm, EMbmAvkonQgn_graf_bar_wait_1}, + {QS60StyleEnums::SP_QgnGrafBarFrameCenter, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_center}, + {QS60StyleEnums::SP_QgnGrafBarFrameSideL, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_side_l}, + {QS60StyleEnums::SP_QgnGrafBarFrameSideR, EAvkonMbm, EMbmAvkonQgn_graf_bar_frame_side_r}, + {QS60StyleEnums::SP_QgnGrafBarProgress, EAvkonMbm, EMbmAvkonQgn_graf_bar_progress}, + {QS60StyleEnums::SP_QgnGrafTabActiveL, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_l}, + {QS60StyleEnums::SP_QgnGrafTabActiveM, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_m}, + {QS60StyleEnums::SP_QgnGrafTabActiveR, EAvkonMbm, EMbmAvkonQgn_graf_tab_active_r}, + {QS60StyleEnums::SP_QgnGrafTabPassiveL, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_l}, + {QS60StyleEnums::SP_QgnGrafTabPassiveM, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_m}, + {QS60StyleEnums::SP_QgnGrafTabPassiveR, EAvkonMbm, EMbmAvkonQgn_graf_tab_passive_r}, + {QS60StyleEnums::SP_QgnIndiCheckboxOff, EAvkonMbm, EMbmAvkonQgn_indi_checkbox_off}, + {QS60StyleEnums::SP_QgnIndiCheckboxOn, EAvkonMbm, EMbmAvkonQgn_indi_checkbox_on}, + {QS60StyleEnums::SP_QgnIndiHlColSuper, EAvkonMbm, 0x4456 }, /* EMbmAvkonQgn_indi_hl_col_super */ + {QS60StyleEnums::SP_QgnIndiHlExpSuper, EAvkonMbm, 0x4458 }, /* EMbmAvkonQgn_indi_hl_exp_super */ + {QS60StyleEnums::SP_QgnIndiHlLineBranch, EAvkonMbm, 0x445A }, /* EMbmAvkonQgn_indi_hl_line_branch */ + {QS60StyleEnums::SP_QgnIndiHlLineEnd, EAvkonMbm, 0x445C }, /* EMbmAvkonQgn_indi_hl_line_end */ + {QS60StyleEnums::SP_QgnIndiHlLineStraight, EAvkonMbm, 0x445E }, /* EMbmAvkonQgn_indi_hl_line_straight */ + {QS60StyleEnums::SP_QgnIndiMarkedAdd, EAvkonMbm, EMbmAvkonQgn_indi_marked_add }, + {QS60StyleEnums::SP_QgnIndiNaviArrowLeft, EAvkonMbm, EMbmAvkonQgn_indi_navi_arrow_left }, + {QS60StyleEnums::SP_QgnIndiNaviArrowRight, EAvkonMbm, EMbmAvkonQgn_indi_navi_arrow_right}, + {QS60StyleEnums::SP_QgnIndiRadiobuttOff, EAvkonMbm, EMbmAvkonQgn_indi_radiobutt_off }, + {QS60StyleEnums::SP_QgnIndiRadiobuttOn, EAvkonMbm, EMbmAvkonQgn_indi_radiobutt_on }, + {QS60StyleEnums::SP_QgnIndiSliderEdit, EAvkonMbm, EMbmAvkonQgn_indi_slider_edit }, + {QS60StyleEnums::SP_QgnIndiSubMenu, EAvkonMbm, EMbmAvkonQgn_indi_submenu }, + {QS60StyleEnums::SP_QgnNoteErased, EAvkonMbm, EMbmAvkonQgn_note_erased }, + {QS60StyleEnums::SP_QgnNoteError, EAvkonMbm, EMbmAvkonQgn_note_error }, + {QS60StyleEnums::SP_QgnNoteInfo, EAvkonMbm, EMbmAvkonQgn_note_info }, + {QS60StyleEnums::SP_QgnNoteOk, EAvkonMbm, EMbmAvkonQgn_note_ok }, + {QS60StyleEnums::SP_QgnNoteQuery, EAvkonMbm, EMbmAvkonQgn_note_query }, + {QS60StyleEnums::SP_QgnNoteWarning, EAvkonMbm, EMbmAvkonQgn_note_warning }, + {QS60StyleEnums::SP_QgnPropFileSmall, EAvkonMbm, EMbmAvkonQgn_prop_file_small }, + {QS60StyleEnums::SP_QgnPropFolderCurrent, EAvkonMbm, EMbmAvkonQgn_prop_folder_current }, + {QS60StyleEnums::SP_QgnPropFolderSmall, EAvkonMbm, EMbmAvkonQgn_prop_folder_small }, + {QS60StyleEnums::SP_QgnPropFolderSmallNew, EAvkonMbm, EMbmAvkonQgn_prop_folder_small_new}, + {QS60StyleEnums::SP_QgnPropPhoneMemcLarge, EAvkonMbm, EMbmAvkonQgn_prop_phone_memc_large} +}; + +const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { + /* SP_QgnGrafBarWait */ {KAknsIIDQgnGrafBarWaitAnim, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameCenter */ {KAknsIIDQgnGrafBarFrameCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveL */ {KAknsIIDQgnGrafTabActiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveM */ {KAknsIIDQgnGrafTabActiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabActiveR */ {KAknsIIDQgnGrafTabActiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveL */ {KAknsIIDQgnGrafTabPassiveL, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveM */ {KAknsIIDQgnGrafTabPassiveM, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnGrafTabPassiveR */ {KAknsIIDQgnGrafTabPassiveR, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOff */ {KAknsIIDQgnIndiCheckboxOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiCheckboxOn */ {KAknsIIDQgnIndiCheckboxOn, EDrawIcon, ES60_AllReleases, -1,-1}, + // Following 5 items (SP_QgnIndiHlColSuper - SP_QgnIndiHlLineStraight) are available starting from S60 release 3.2. + // In 3.1 CommonStyle drawing is used for these QTreeView elements, since no similar icons in AVKON UI. + /* SP_QgnIndiHlColSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d5 /* KAknsIIDQgnIndiHlColSuper */}, + /* SP_QgnIndiHlExpSuper */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d6 /* KAknsIIDQgnIndiHlExpSuper */}, + /* SP_QgnIndiHlLineBranch */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d7 /* KAknsIIDQgnIndiHlLineBranch */}, + /* SP_QgnIndiHlLineEnd */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d8 /* KAknsIIDQgnIndiHlLineEnd */}, + /* SP_QgnIndiHlLineStraight */ {KAknsIIDNone, EDrawIcon, ES60_None, EAknsMajorGeneric, 0x17d9 /* KAknsIIDQgnIndiHlLineStraight */}, + /* SP_QgnIndiMarkedAdd */ {KAknsIIDQgnIndiMarkedAdd, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiNaviArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOff */ {KAknsIIDQgnIndiRadiobuttOff, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiRadiobuttOn */ {KAknsIIDQgnIndiRadiobuttOn, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSliderEdit */ {KAknsIIDQgnIndiSliderEdit, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnIndiSubMenu */ {KAknsIIDQgnIndiSubmenu, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteErased */ {KAknsIIDQgnNoteErased, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteError */ {KAknsIIDQgnNoteError, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteInfo */ {KAknsIIDQgnNoteInfo, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteOk */ {KAknsIIDQgnNoteOk, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteQuery */ {KAknsIIDQgnNoteQuery, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnNoteWarning */ {KAknsIIDQgnNoteWarning, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFileSmall */ {KAknsIIDQgnPropFileSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderCurrent */ {KAknsIIDQgnPropFolderCurrent, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmall */ {KAknsIIDQgnPropFolderSmall, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropFolderSmallNew */ {KAknsIIDQgnPropFolderSmallNew, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QgnPropPhoneMemcLarge */ {KAknsIIDQgnPropPhoneMemcLarge, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnBgScreen */ {KAknsIIDQsnBgScreen, EDrawBackground, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollBgBottom */ {KAknsIIDQsnCpScrollBgBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgMiddle */ {KAknsIIDQsnCpScrollBgMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollBgTop */ {KAknsIIDQsnCpScrollBgTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnCpScrollHandleBottom */ {KAknsIIDQsnCpScrollHandleBottom, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleMiddle */ {KAknsIIDQsnCpScrollHandleMiddle, EDrawIcon, ES60_AllReleases, -1,-1}, + /* SP_QsnCpScrollHandleTop */ {KAknsIIDQsnCpScrollHandleTop, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenter */ {KAknsIIDQsnFrButtonTbCenter, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrButtonTbCornerTlPressed */{KAknsIIDQsnFrButtonTbCornerTlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerTrPressed */{KAknsIIDQsnFrButtonTbCornerTrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBlPressed */{KAknsIIDQsnFrButtonTbCornerBlPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCornerBrPressed */{KAknsIIDQsnFrButtonTbCornerBrPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideTPressed */ {KAknsIIDQsnFrButtonTbSideTPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideBPressed */ {KAknsIIDQsnFrButtonTbSideBPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideLPressed */ {KAknsIIDQsnFrButtonTbSideLPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbSideRPressed */ {KAknsIIDQsnFrButtonTbSideRPressed, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrButtonTbCenterPressed */ {KAknsIIDQsnFrButtonTbCenterPressed, EDrawIcon, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleCornerTl */ {KAknsIIDQsnFrCaleCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerTr */ {KAknsIIDQsnFrCaleCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBl */ {KAknsIIDQsnFrCaleCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCornerBr */ {KAknsIIDQsnFrCaleCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideT */ {KAknsIIDQsnFrCaleSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideB */ {KAknsIIDQsnFrCaleSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideL */ {KAknsIIDQsnFrCaleSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleGSideR */ {KAknsIIDQsnFrCaleSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleCenter */ {KAknsIIDQsnFrCaleCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrCaleHeadingCornerTl */ {KAknsIIDQsnFrCaleHeadingCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerTr */ {KAknsIIDQsnFrCaleHeadingCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBl */ {KAknsIIDQsnFrCaleHeadingCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCornerBr */ {KAknsIIDQsnFrCaleHeadingCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideT */ {KAknsIIDQsnFrCaleHeadingSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideB */ {KAknsIIDQsnFrCaleHeadingSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideL */ {KAknsIIDQsnFrCaleHeadingSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingSideR */ {KAknsIIDQsnFrCaleHeadingSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrCaleHeadingCenter */ {KAknsIIDQsnFrCaleHeadingCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrInputCornerTl */ {KAknsIIDQsnFrInputCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerTr */ {KAknsIIDQsnFrInputCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBl */ {KAknsIIDQsnFrInputCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCornerBr */ {KAknsIIDQsnFrInputCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideT */ {KAknsIIDQsnFrInputSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideB */ {KAknsIIDQsnFrInputSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideL */ {KAknsIIDQsnFrInputSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputSideR */ {KAknsIIDQsnFrInputSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrInputCenter */ {KAknsIIDQsnFrInputCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrListCornerTl */ {KAknsIIDQsnFrListCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerTr */ {KAknsIIDQsnFrListCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBl */ {KAknsIIDQsnFrListCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCornerBr */ {KAknsIIDQsnFrListCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideT */ {KAknsIIDQsnFrListSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideB */ {KAknsIIDQsnFrListSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideL */ {KAknsIIDQsnFrListSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListSideR */ {KAknsIIDQsnFrListSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrListCenter */ {KAknsIIDQsnFrListCenter, ENoDraw, ES60_AllReleases, -1,-1}, + + /* SP_QsnFrPopupCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_AllReleases, -1,-1}, // ToolTip graphics different in 3.1 vs. 3.2+. - /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ - /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c6}, - /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c3}, - /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c4}, - /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19ca}, - /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c7}, - /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c8}, - /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c9}, - /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, -1, EAknsMajorSkin, 0x19c2}, - - /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1,-1}, - /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1,-1}, + /* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */ + /* SP_QsnFrPopupPreviewCornerTr */ {KAknsIIDQsnFrPopupCornerTr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c6}, + /* SP_QsnFrPopupPreviewCornerBl */ {KAknsIIDQsnFrPopupCornerBl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c3}, + /* SP_QsnFrPopupPreviewCornerBr */ {KAknsIIDQsnFrPopupCornerBr, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c4}, + /* SP_QsnFrPopupPreviewSideT */ {KAknsIIDQsnFrPopupSideT, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19ca}, + /* SP_QsnFrPopupPreviewSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c7}, + /* SP_QsnFrPopupPreviewSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c8}, + /* SP_QsnFrPopupPreviewSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c9}, + /* SP_QsnFrPopupPreviewCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c2}, + + /* SP_QsnFrSetOptCornerTl */ {KAknsIIDQsnFrSetOptCornerTl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerTr */ {KAknsIIDQsnFrSetOptCornerTr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBl */ {KAknsIIDQsnFrSetOptCornerBl, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCornerBr */ {KAknsIIDQsnFrSetOptCornerBr, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideT */ {KAknsIIDQsnFrSetOptSideT, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideB */ {KAknsIIDQsnFrSetOptSideB, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideL */ {KAknsIIDQsnFrSetOptSideL, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptSideR */ {KAknsIIDQsnFrSetOptSideR, ENoDraw, ES60_AllReleases, -1,-1}, + /* SP_QsnFrSetOptCenter */ {KAknsIIDQsnFrSetOptCenter, ENoDraw, ES60_AllReleases, -1,-1}, // No toolbar frame for 5.0+ releases. - /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, - /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1,-1}, + /* SP_QsnFrPopupSubCornerTl */ {KAknsIIDQsnFrPopupSubCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerTr */ {KAknsIIDQsnFrPopupSubCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBl */ {KAknsIIDQsnFrPopupSubCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCornerBr */ {KAknsIIDQsnFrPopupSubCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideT */ {KAknsIIDQsnFrPopupSubSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideB */ {KAknsIIDQsnFrPopupSubSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideL */ {KAknsIIDQsnFrPopupSubSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubSideR */ {KAknsIIDQsnFrPopupSubSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, + /* SP_QsnFrPopupSubCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_3_1 | ES60_3_2, -1,-1}, // Toolbar graphics is different in 3.1/3.2 vs. 5.0 - /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ - /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2302}, - /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2303}, - /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2304}, - /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2305}, - /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2306}, - /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2307}, - /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2308}, - /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ + /* SP_QsnFrSctrlButtonCornerTl */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2301}, /* KAknsIIDQgnFrSctrlButtonCornerTl*/ + /* SP_QsnFrSctrlButtonCornerTr */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2302}, + /* SP_QsnFrSctrlButtonCornerBl */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2303}, + /* SP_QsnFrSctrlButtonCornerBr */ {KAknsIIDQsnFrButtonTbCornerBr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2304}, + /* SP_QsnFrSctrlButtonSideT */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2305}, + /* SP_QsnFrSctrlButtonSideB */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2306}, + /* SP_QsnFrSctrlButtonSideL */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2307}, + /* SP_QsnFrSctrlButtonSideR */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2308}, + /* SP_QsnFrSctrlButtonCenter */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2309}, /*KAknsIIDQgnFrSctrlButtonCenter*/ // No pressed state for toolbar button in 3.1/3.2. - /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ - /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2622}, - /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2623}, - /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2624}, - /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2625}, - /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2626}, - /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2627}, - /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2628}, - /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, -1,EAknsMajorSkin,0x2629} + /* SP_QsnFrSctrlButtonCornerTlPressed */ {KAknsIIDQsnFrButtonTbCornerTl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2621}, /*KAknsIIDQsnFrSctrlButtonCornerTlPressed*/ + /* SP_QsnFrSctrlButtonCornerTrPressed */ {KAknsIIDQsnFrButtonTbCornerTr, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2622}, + /* SP_QsnFrSctrlButtonCornerBlPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2623}, + /* SP_QsnFrSctrlButtonCornerBrPressed */ {KAknsIIDQsnFrButtonTbCornerBl, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2624}, + /* SP_QsnFrSctrlButtonSideTPressed */ {KAknsIIDQsnFrButtonTbSideT, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2625}, + /* SP_QsnFrSctrlButtonSideBPressed */ {KAknsIIDQsnFrButtonTbSideB, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2626}, + /* SP_QsnFrSctrlButtonSideLPressed */ {KAknsIIDQsnFrButtonTbSideL, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2627}, + /* SP_QsnFrSctrlButtonSideRPressed */ {KAknsIIDQsnFrButtonTbSideR, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2628}, + /* SP_QsnFrSctrlButtonCenterPressed */ {KAknsIIDQsnFrButtonTbCenter, ENoDraw, ES60_3_1 | ES60_3_2, EAknsMajorSkin, 0x2629} }; QPixmap QS60StyleModeSpecifics::skinnedGraphics( @@ -293,13 +355,27 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphics( return error ? QPixmap() : colorGraphics; } +const TDesC& QS60StyleModeSpecifics::mapFallBackFileName(const int fileID) +{ + switch(fileID){ + case ELastMbm: + return KNullDesC(); + case EAvkonMbm: + default: + return KAvkonBitmapFile(); + } +} + QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( const QS60StyleEnums::SkinParts &stylepart, const QSize &size, QS60StylePrivate::SkinElementFlags flags) { const int stylepartIndex = (int)stylepart; const TAknsItemID skinId = m_partMap[stylepartIndex].skinID; - const TInt fallbackGraphicID = m_partMap[stylepartIndex].fallbackGraphicID; + const TDesC& fallbackFileName = mapFallBackFileName(m_fallbackMap[stylepartIndex].fallbackGraphicID); + const TInt fallbackGraphicID = + (fallbackFileName!=KNullDesC) ? m_fallbackMap[stylepartIndex].fallbackGraphicID : KErrNotFound; + TAknsItemID colorGroup = KAknsIIDQsnIconColors; int colorIndex = 0; colorGroupAndIndex(stylepart, colorGroup, colorIndex); @@ -314,7 +390,7 @@ QPixmap QS60StyleModeSpecifics::colorSkinnedGraphicsL( fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance(); AknsUtils::CreateColorIconLC( - skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, KAvkonBitmapFile, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); + skinInstance, skinId, colorGroup, colorIndex, icon, iconMask, fallbackFileName, fallbackGraphicID , fallbackGraphicsMaskID, KRgbBlack); User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); QPixmap result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); @@ -449,7 +525,6 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( const int stylepartIndex = (int)part; const TDrawType drawType = m_partMap[stylepartIndex].drawType; Q_ASSERT(drawType != ENoDraw); - const TInt fallbackGraphicID = m_partMap[stylepartIndex].fallbackGraphicID; const bool rotatedBy90or270 = (flags & (QS60StylePrivate::SF_PointEast | QS60StylePrivate::SF_PointWest)); TSize targetSize = @@ -462,12 +537,16 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL( switch (drawType) { case EDrawIcon: { + const TDesC& fallbackFileName = mapFallBackFileName(m_fallbackMap[stylepartIndex].fallbackGraphicID); + const TInt fallbackGraphicID = + (fallbackFileName!=KNullDesC) ? m_fallbackMap[stylepartIndex].fallbackGraphicID : KErrNotFound; + CFbsBitmap *icon = 0; CFbsBitmap *iconMask = 0; const TInt fallbackGraphicsMaskID = fallbackGraphicID == KErrNotFound?KErrNotFound:fallbackGraphicID+1; //masks are auto-generated as next in mif files // QS60WindowSurface::unlockBitmapHeap(); - AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, KAvkonBitmapFile, fallbackGraphicID , fallbackGraphicsMaskID); + AknsUtils::CreateIconLC(skinInstance, skinId, icon, iconMask, fallbackFileName, fallbackGraphicID , fallbackGraphicsMaskID); User::LeaveIfError(AknIconUtils::SetSize(icon, targetSize, EAspectRatioNotPreserved)); User::LeaveIfError(AknIconUtils::SetSize(iconMask, targetSize, EAspectRatioNotPreserved)); result = fromFbsBitmap(icon, iconMask, flags, qt_TDisplayMode2Format(icon->DisplayMode())); @@ -551,11 +630,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsL(QS60StylePrivate::SkinFra frame->UnlockHeap(); const TRect outerRect(TPoint(0, 0), targetSize); - TRect innerRect = outerRect; - innerRect.Shrink( - QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth), - QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight) - ); + const TRect innerRect = innerRectFromElement(frameElement, outerRect); TAknsItemID frameSkinID, centerSkinID; frameSkinID = centerSkinID = checkAndUpdateReleaseSpecificGraphics(QS60StylePrivate::m_frameElementsData[frameElement].center); @@ -633,6 +708,11 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme frameId.Set(KAknsIIDQsnFrPopupSub); } break; + case QS60StylePrivate::SF_PanelBackground: + // remove center piece for panel graphics, so that only border is drawn + centerId.Set(KAknsIIDNone); + frameId.Set(KAknsIIDQsnFrSetOpt); + break; default: // center should be correct here frameId.iMinor = centerId.iMinor - 9; @@ -640,6 +720,26 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme } } +TRect QS60StyleModeSpecifics::innerRectFromElement(QS60StylePrivate::SkinFrameElements frameElement, const TRect &outerRect) +{ + TInt widthShrink = 0; + TInt heightShrink = 0; + switch(frameElement) { + case QS60StylePrivate::SF_PanelBackground: + // panel should have slightly slimmer border to enable thin line of background graphics between closest component + widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)-2; + heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight)-2; + break; + default: + widthShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth); + heightShrink = QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerHeight); + break; + } + TRect innerRect(outerRect); + innerRect.Shrink(widthShrink, heightShrink); + return innerRect; +} + bool QS60StyleModeSpecifics::checkSupport(const int supportedRelease) { const QSysInfo::S60Version currentRelease = QSysInfo::s60Version(); @@ -994,6 +1094,12 @@ void QS60StyleModeSpecifics::colorGroupAndIndex( QS60StyleEnums::SkinParts skinID, TAknsItemID &colorGroup, int colorIndex) { switch(skinID) { + case QS60StyleEnums::SP_QgnIndiSubMenu: + case QS60StyleEnums::SP_QgnIndiHlColSuper: + case QS60StyleEnums::SP_QgnIndiHlExpSuper: + case QS60StyleEnums::SP_QgnIndiHlLineBranch: + case QS60StyleEnums::SP_QgnIndiHlLineEnd: + case QS60StyleEnums::SP_QgnIndiHlLineStraight: case QS60StyleEnums::SP_QgnIndiRadiobuttOff: case QS60StyleEnums::SP_QgnIndiRadiobuttOn: case QS60StyleEnums::SP_QgnIndiCheckboxOff: diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 058660e..714b8c5 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4926,7 +4926,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op case CT_LineEdit: #ifndef QT_NO_SPINBOX // ### hopelessly broken QAbstractSpinBox (part 2) - if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w->parentWidget())) { + if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0)) { QRenderRule rule = renderRule(spinBox, opt); if (rule.hasBox() || !rule.hasNativeBorder()) return csz; diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index dac01c7..5a97086 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -279,19 +279,15 @@ static const QCssKnownValue values[NumKnownValues - 1] = { { "xx-large", Value_XXLarge } }; +//Map id to strings as they appears in the 'values' array above +static const int indexOfId[NumKnownValues] = { 0, 40, 47, 41, 48, 53, 34, 26, 68, 69, 25, 42, 5, 62, 46, + 29, 57, 58, 27, 50, 60, 6, 10, 38, 55, 19, 13, 17, 18, 20, 21, 49, 24, 45, 65, 36, 3, 2, 39, 61, 16, + 11, 56, 14, 32, 63, 54, 64, 33, 67, 8, 28, 37, 12, 35, 59, 7, 9, 4, 66, 52, 22, 23, 30, 31, 1, 15, 0, + 51, 44, 43 }; + QString Value::toString() const { - static int indexOfId[NumKnownValues - 1]; - static bool hasCachedIndexes = false; - if (type == KnownIdentifier) { - if (!hasCachedIndexes) { - for (int i = 0; i < NumKnownValues - 1; ++i) - indexOfId[values[i].id] = i; - - hasCachedIndexes = true; - } - return QLatin1String(values[indexOfId[variant.toInt()]].name); } else { return variant.toString(); diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index d691f93..6ee1d03 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -927,7 +927,7 @@ void QFont::setPointSize(int pointSize) void QFont::setPointSizeF(qreal pointSize) { if (pointSize <= 0) { - qWarning("QFont::setPointSizeF: Point size <= 0 (%d), must be greater than 0", pointSize); + qWarning("QFont::setPointSizeF: Point size <= 0 (%f), must be greater than 0", pointSize); return; } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 5a8977d..c2c23ee 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -624,6 +624,45 @@ QImage QFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int /* margin */, const Q return rgbMask; } +QImage QFontEngine::alphaMapForGlyph(glyph_t glyph) +{ + glyph_metrics_t gm = boundingBox(glyph); + int glyph_x = qFloor(gm.x.toReal()); + int glyph_y = qFloor(gm.y.toReal()); + int glyph_width = qCeil((gm.x + gm.width).toReal()) - glyph_x; + int glyph_height = qCeil((gm.y + gm.height).toReal()) - glyph_y; + + if (glyph_width <= 0 || glyph_height <= 0) + return QImage(); + QFixedPoint pt; + pt.x = 0; + pt.y = -glyph_y; // the baseline + QPainterPath path; + QImage im(glyph_width + qAbs(glyph_x) + 4, glyph_height, QImage::Format_ARGB32_Premultiplied); + im.fill(Qt::transparent); + QPainter p(&im); + p.setRenderHint(QPainter::Antialiasing); + addGlyphsToPath(&glyph, &pt, 1, &path, 0); + p.setPen(Qt::NoPen); + p.setBrush(Qt::black); + p.drawPath(path); + p.end(); + + QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); + QVector<QRgb> colors(256); + for (int i=0; i<256; ++i) + colors[i] = qRgba(0, 0, 0, i); + indexed.setColorTable(colors); + + for (int y=0; y<im.height(); ++y) { + uchar *dst = (uchar *) indexed.scanLine(y); + uint *src = (uint *) im.scanLine(y); + for (int x=0; x<im.width(); ++x) + dst[x] = qAlpha(src[x]); + } + + return indexed; +} void QFontEngine::removeGlyphFromCache(glyph_t) { diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index cb0b436..7a236fd 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1521,6 +1521,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs return false; } +#if !defined(QT_NO_FONTCONFIG) + extern QMutex *qt_fontdatabase_mutex(); + QMutex *mtx = 0; +#endif + bool mirrored = flags & QTextEngine::RightToLeft; int glyph_pos = 0; if (freetype->symbol_map) { @@ -1533,6 +1538,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs if ( !glyphs->glyphs[glyph_pos] ) { glyph_t glyph; #if !defined(QT_NO_FONTCONFIG) + if (!mtx) { + mtx = qt_fontdatabase_mutex(); + mtx->lock(); + } + if (FcCharSetHasChar(freetype->charset, uc)) { #else if (false) { @@ -1561,20 +1571,26 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs if (mirrored) uc = QChar::mirroredChar(uc); glyphs->glyphs[glyph_pos] = uc < QFreetypeFace::cmapCacheSize ? freetype->cmapCache[uc] : 0; - if (!glyphs->glyphs[glyph_pos] + if (!glyphs->glyphs[glyph_pos]) { #if !defined(QT_NO_FONTCONFIG) - && FcCharSetHasChar(freetype->charset, uc) + if (!mtx) { + mtx = qt_fontdatabase_mutex(); + mtx->lock(); + } + + if (FcCharSetHasChar(freetype->charset, uc)) #endif - ) { - redo: - glyph_t glyph = FT_Get_Char_Index(face, uc); - if (!glyph && (uc == 0xa0 || uc == 0x9)) { - uc = 0x20; - goto redo; + { + redo: + glyph_t glyph = FT_Get_Char_Index(face, uc); + if (!glyph && (uc == 0xa0 || uc == 0x9)) { + uc = 0x20; + goto redo; + } + glyphs->glyphs[glyph_pos] = glyph; + if (uc < QFreetypeFace::cmapCacheSize) + freetype->cmapCache[uc] = glyph; } - glyphs->glyphs[glyph_pos] = glyph; - if (uc < QFreetypeFace::cmapCacheSize) - freetype->cmapCache[uc] = glyph; } ++glyph_pos; } @@ -1583,6 +1599,11 @@ bool QFontEngineFT::stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs *nglyphs = glyph_pos; glyphs->numGlyphs = glyph_pos; +#if !defined(QT_NO_FONTCONFIG) + if (mtx) + mtx->unlock(); +#endif + if (flags & QTextEngine::GlyphIndicesOnly) return true; @@ -1788,9 +1809,11 @@ QImage QFontEngineFT::alphaMapForGlyph(glyph_t g) GlyphFormat glyph_format = antialias ? Format_A8 : Format_Mono; - Glyph *glyph = loadGlyph(g, glyph_format); - if (!glyph) - return QImage(); + Glyph *glyph = defaultGlyphSet.outline_drawing ? 0 : loadGlyph(g, glyph_format); + if (!glyph) { + unlockFace(); + return QFontEngine::alphaMapForGlyph(g); + } const int pitch = antialias ? (glyph->width + 3) & ~3 : ((glyph->width + 31)/32) * 4; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 7382b39..a5aa097 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -182,7 +182,7 @@ public: * Create a qimage with the alpha values for the glyph. * Returns an image indexed_8 with index values ranging from 0=fully transparant to 255=opaque */ - virtual QImage alphaMapForGlyph(glyph_t) = 0; + virtual QImage alphaMapForGlyph(glyph_t); virtual QImage alphaMapForGlyph(glyph_t, const QTransform &t); virtual QImage alphaRGBMapForGlyph(glyph_t, int margin, const QTransform &t); diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp index c327b9f..48963bb 100644 --- a/src/gui/text/qtextcursor.cpp +++ b/src/gui/text/qtextcursor.cpp @@ -1074,7 +1074,10 @@ QTextCursor::QTextCursor(const QTextCursor &cursor) } /*! - Makes a copy of \a cursor and assigns it to this QTextCursor. + Makes a copy of \a cursor and assigns it to this QTextCursor. Note + that QTextCursor is an \l{Implicitly Shared Classes}{implicitly + shared} class. + */ QTextCursor &QTextCursor::operator=(const QTextCursor &cursor) { diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index e84b324..873f846 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -287,7 +287,7 @@ QTextCodec *Qt::codecForHtml(const QByteArray &ba) that inform connected editor widgets about the state of the undo/redo system. - \sa QTextCursor QTextEdit \link richtext.html Rich Text Processing\endlink + \sa QTextCursor, QTextEdit, \link richtext.html Rich Text Processing\endlink , {Text Object Example} */ /*! diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index 3f4c8e5..71b68e0 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE objects, you will also need to reimplement QTextDocument::createObject() which acts as a factory method for creating text objects. - \sa QTextDocument + \sa QTextDocument, {Text Object Example} */ /*! diff --git a/src/gui/util/qcompleter.cpp b/src/gui/util/qcompleter.cpp index e6bc80a..8410a69 100644 --- a/src/gui/util/qcompleter.cpp +++ b/src/gui/util/qcompleter.cpp @@ -824,7 +824,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted) Q_Q(QCompleter); QString completion; - if (!index.isValid() || (index.row() >= proxy->engine->matchCount())) { + if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) { completion = prefix; } else { QModelIndex si = proxy->mapToSource(index); diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 2abc9e8..502c1e9 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -480,9 +480,6 @@ void QMainWindow::setMenuBar(QMenuBar *menuBar) oldMenuBar->hide(); oldMenuBar->deleteLater(); } -#ifdef Q_OS_WINCE - if (menuBar && menuBar->size().height() > 0) -#endif d->layout->setMenuBar(menuBar); } diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index ea58d46..847a623 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -58,6 +58,9 @@ #include <QtCore/qlibrary.h> #include <commctrl.h> +#if Q_OS_WINCE_WM +# include <windowsm.h> +#endif #include "qguifunctions_wince.h" @@ -71,6 +74,12 @@ #define SHCMBM_GETSUBMENU (WM_USER + 401) #endif +#ifdef Q_OS_WINCE_WM +# define SHMBOF_NODEFAULT 0x00000001 +# define SHMBOF_NOTIFY 0x00000002 +# define SHCMBM_OVERRIDEKEY (WM_USER + 0x193) +#endif + extern bool qt_wince_is_smartphone();//defined in qguifunctions_wce.cpp extern bool qt_wince_is_pocket_pc(); //defined in qguifunctions_wce.cpp @@ -204,8 +213,13 @@ static HWND qt_wce_create_menubar(HWND parentHandle, HINSTANCE resourceHandle, i mbi.dwFlags = flags; mbi.nToolBarId = toolbarID; - if (ptrCreateMenuBar(&mbi)) + if (ptrCreateMenuBar(&mbi)) { + // Tell the menu bar that we want to override hot key behaviour. + LPARAM lparam = MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, + SHMBOF_NODEFAULT | SHMBOF_NOTIFY); + SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_TBACK, lparam); return mbi.hwndMB; + } } return 0; } diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp index 2e9201d..e563fa1 100644 --- a/src/gui/widgets/qplaintextedit.cpp +++ b/src/gui/widgets/qplaintextedit.cpp @@ -624,7 +624,7 @@ void QPlainTextEditPrivate::setTopBlock(int blockNumber, int lineNumber, int dx) if (viewport->updatesEnabled() && viewport->isVisible()) { int dy = 0; - if (doc->findBlockByLineNumber(control->topBlock).isValid()) { + if (doc->findBlockByNumber(control->topBlock).isValid()) { dy = (int)(-q->blockBoundingGeometry(block).y()) + verticalOffset() - verticalOffset(blockNumber, lineNumber); } diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index b562b1f..69221ba 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1085,7 +1085,7 @@ void QTabBar::setTabData(int index, const QVariant & data) } /*! - Returns the datad of the tab at position \a index, or a null + Returns the data of the tab at position \a index, or a null variant if \a index is out of range. */ QVariant QTabBar::tabData(int index) const @@ -2222,6 +2222,7 @@ void QTabBar::setTabButton(int index, ButtonPosition position, QWidget *widget) d->tabList[index].rightWidget = widget; } d->layoutTabs(); + d->refresh(); update(); } diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index e921318..e31621c 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -950,6 +950,17 @@ static QDateTime parseDateString(const QByteArray &dateString) */ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieString) { + // cookieString can be a number of set-cookie header strings joined together + // by \n, parse each line separately. + QList<QNetworkCookie> cookies; + QList<QByteArray> list = cookieString.split('\n'); + for (int a = 0; a < list.size(); a++) + cookies += QNetworkCookiePrivate::parseSetCookieHeaderLine(list.at(a)); + return cookies; +} + +QList<QNetworkCookie> QNetworkCookiePrivate::parseSetCookieHeaderLine(const QByteArray &cookieString) +{ // According to http://wp.netscape.com/newsref/std/cookie_spec.html,< // the Set-Cookie response header is of the format: // @@ -967,12 +978,6 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin while (position < length) { QNetworkCookie cookie; - // When there are multiple SetCookie headers they are join with a new line - // \n will always be the start of a new cookie - int endOfSetCookie = cookieString.indexOf('\n', position); - if (endOfSetCookie == -1) - endOfSetCookie = length; - // The first part is always the "NAME=VALUE" part QPair<QByteArray,QByteArray> field = nextField(cookieString, position); if (field.first.isEmpty() || field.second.isNull()) @@ -983,7 +988,7 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin position = nextNonWhitespace(cookieString, position); bool endOfCookie = false; - while (!endOfCookie && position < endOfSetCookie) + while (!endOfCookie && position < length) { switch (cookieString.at(position++)) { case ',': // end of the cookie @@ -1006,9 +1011,7 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin position = end; QDateTime dt = parseDateString(dateString.toLower()); if (!dt.isValid()) { - cookie = QNetworkCookie(); - endOfCookie = true; - continue; + return result; } cookie.setExpirationDate(dt); } else if (field.first == "domain") { @@ -1025,8 +1028,7 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin bool ok = false; int secs = field.second.toInt(&ok); if (!ok) - // invalid cookie string - return QList<QNetworkCookie>(); + return result; cookie.setExpirationDate(now.addSecs(secs)); } else if (field.first == "path") { QString path = QUrl::fromPercentEncoding(field.second); @@ -1040,9 +1042,7 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin } else if (field.first == "version") { if (field.second != "1") { // oops, we don't know how to handle this cookie - cookie = QNetworkCookie(); - endOfCookie = true; - continue; + return result; } } else { // got an unknown field in the cookie @@ -1050,9 +1050,8 @@ QList<QNetworkCookie> QNetworkCookie::parseCookies(const QByteArray &cookieStrin } position = nextNonWhitespace(cookieString, position); - if (position > endOfSetCookie) - endOfCookie = true; } + } if (!cookie.name().isEmpty()) result += cookie; diff --git a/src/network/access/qnetworkcookie_p.h b/src/network/access/qnetworkcookie_p.h index 83ef14a..0c41322 100644 --- a/src/network/access/qnetworkcookie_p.h +++ b/src/network/access/qnetworkcookie_p.h @@ -61,6 +61,7 @@ class QNetworkCookiePrivate: public QSharedData { public: inline QNetworkCookiePrivate() : secure(false), httpOnly(false) { } + static QList<QNetworkCookie> parseSetCookieHeaderLine(const QByteArray &cookieString); QDateTime expirationDate; QString domain; diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp index 93360c8..892929e 100644 --- a/src/network/access/qnetworkdiskcache.cpp +++ b/src/network/access/qnetworkdiskcache.cpp @@ -191,7 +191,11 @@ QIODevice *QNetworkDiskCache::prepare(const QNetworkCacheMetaData &metaData) } else { QString templateName = d->tmpCacheFileName(); cacheItem->file = new QTemporaryFile(templateName, &cacheItem->data); - cacheItem->file->open(); + if (!cacheItem->file->open()) { + qWarning() << "QNetworkDiskCache::prepare() unable to open temporary file"; + delete cacheItem; + return 0; + } cacheItem->writeHeader(cacheItem->file); device = cacheItem->file; } @@ -229,7 +233,7 @@ void QNetworkDiskCachePrivate::storeItem(QCacheItem *cacheItem) if (QFile::exists(fileName)) { if (!QFile::remove(fileName)) { - qWarning() << "QNetworkDiskCache: could't remove the cache file " << fileName; + qWarning() << "QNetworkDiskCache: couldn't remove the cache file " << fileName; return; } } diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index f4ece97..62bdfc7 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -86,10 +86,11 @@ The SOCKS5 support in Qt 4 is based on \l{RFC 1928} and \l{RFC 1929}. The supported authentication methods are no authentication and username/password authentication. Both IPv4 and IPv6 are - supported, but domain name resolution via the SOCKS server is not - supported; i.e. all domain names are resolved locally. There are - several things to remember when using SOCKS5 with QUdpSocket and - QTcpServer: + supported. Domain names are resolved through the SOCKS5 server if + the QNetworkProxy::HostNameLookupCapability is enabled, otherwise + they are resolved locally and the IP address is sent to the + server. There are several things to remember when using SOCKS5 + with QUdpSocket and QTcpServer: With QUdpSocket, a call to \l {QUdpSocket::bind()}{bind()} may fail with a timeout error. If a port number other than 0 is passed to @@ -365,7 +366,8 @@ static QNetworkProxy::Capabilities defaultCapabilitiesForType(QNetworkProxy::Pro int(QNetworkProxy::HostNameLookupCapability)), }; - Q_ASSERT(int(type) >= 0 && int(type) <= int(QNetworkProxy::FtpCachingProxy)); + if (int(type) < 0 && int(type) > int(QNetworkProxy::FtpCachingProxy)) + type = QNetworkProxy::DefaultProxy; return QNetworkProxy::Capabilities(defaults[int(type)]); } @@ -378,6 +380,7 @@ public: QNetworkProxy::Capabilities capabilities; quint16 port; QNetworkProxy::ProxyType type; + bool capabilitiesSet; inline QNetworkProxyPrivate(QNetworkProxy::ProxyType t = QNetworkProxy::DefaultProxy, const QString &h = QString(), quint16 p = 0, @@ -387,7 +390,8 @@ public: password(pw), capabilities(defaultCapabilitiesForType(t)), port(p), - type(t) + type(t), + capabilitiesSet(false) { } inline bool operator==(const QNetworkProxyPrivate &other) const @@ -490,13 +494,16 @@ QNetworkProxy &QNetworkProxy::operator=(const QNetworkProxy &other) Sets the proxy type for this instance to be \a type. Note that changing the type of a proxy does not change - the set of capabilities this QNetworkProxy object holds. + the set of capabilities this QNetworkProxy object holds if any + capabilities have been set with setCapabilities(). \sa type(), setCapabilities() */ void QNetworkProxy::setType(QNetworkProxy::ProxyType type) { d->type = type; + if (!d->capabilitiesSet) + d->capabilities = defaultCapabilitiesForType(type); } /*! @@ -519,6 +526,7 @@ QNetworkProxy::ProxyType QNetworkProxy::type() const void QNetworkProxy::setCapabilities(Capabilities capabilities) { d->capabilities = capabilities; + d->capabilitiesSet = true; } /*! diff --git a/src/network/ssl/qsslcipher.cpp b/src/network/ssl/qsslcipher.cpp index 505c662..7fec2df 100644 --- a/src/network/ssl/qsslcipher.cpp +++ b/src/network/ssl/qsslcipher.cpp @@ -64,9 +64,9 @@ #ifndef QT_NO_DEBUG_STREAM #include <QtCore/qdebug.h> +#endif QT_BEGIN_NAMESPACE -#endif /*! Constructs an empty QSslCipher object. diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index e09e764..42c09f5 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -364,11 +364,14 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() // DT_RPATH tags on our library header as well as other system-specific search // paths. See the man page for dlopen(3) on your system for more information. +#ifdef Q_OS_OPENBSD + libcrypto->setLoadHints(QLibrary::ExportExternalSymbolsHint); +#endif #ifdef SHLIB_VERSION_NUMBER // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER> libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found return pair; } else { @@ -380,7 +383,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() // second attempt: find the development files libssl.so and libcrypto.so libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so.0 and libcrypto.so.0 found return pair; } else { @@ -395,7 +398,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() crypto.replace(QLatin1String("ssl"), QLatin1String("crypto")); libssl->setFileNameAndVersion(ssl, -1); libcrypto->setFileNameAndVersion(crypto, -1); - if (libssl->load() && libcrypto->load()) { + if (libcrypto->load() && libssl->load()) { // libssl.so.0 and libcrypto.so.0 found return pair; } else { diff --git a/src/opengl/qglpixelbuffer_mac.mm b/src/opengl/qglpixelbuffer_mac.mm index 9a679b1..e95e36b 100644 --- a/src/opengl/qglpixelbuffer_mac.mm +++ b/src/opengl/qglpixelbuffer_mac.mm @@ -299,9 +299,8 @@ void QGLPixelBuffer::releaseFromDynamicTexture() GLuint QGLPixelBuffer::generateDynamicTexture() const { - Q_D(const QGLPixelBuffer); - #ifdef QT_MAC_USE_COCOA + Q_D(const QGLPixelBuffer); NSOpenGLContext *oldContext = [NSOpenGLContext currentContext]; if (d->share_ctx != oldContext) [static_cast<NSOpenGLContext *>(d->share_ctx) makeCurrentContext]; diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index ec6e33b..5a212f5 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5068,9 +5068,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte // fall back to drawing a polygon if the scale factor is large, or // we use a gradient pen - if (ti.fontEngine->fontDef.pixelSize >= 64 - || (d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern - && d->pen_brush_style <= Qt::ConicalGradientPattern)) { + if ((d->matrix.det() > 1) || (d->pen_brush_style >= Qt::LinearGradientPattern + && d->pen_brush_style <= Qt::ConicalGradientPattern)) { QPaintEngine::drawTextItem(p, textItem); return; } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 6d8f617..91a60e7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -80,7 +80,7 @@ template <typename T> inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr<bool>(const bool &) { return 0; } template <typename device, typename T1, typename T2, typename T3> static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, - QDirectFBPaintEnginePrivate::Scale scale, bool matrixRotShear, bool simplePen, + int scale, bool matrixRotShear, bool simplePen, bool dfbHandledClip, bool forceRasterPrimitives, const char *nameOne, const T1 &one, const char *nameTwo, const T2 &two, @@ -211,6 +211,8 @@ static QCache<qint64, CachedImage> imageCache(4*1024*1024); // 4 MB class QDirectFBPaintEnginePrivate : public QRasterPaintEnginePrivate { public: + enum Scale { NoScale, Scaled, NegativeScale }; + QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p); ~QDirectFBPaintEnginePrivate(); @@ -266,7 +268,7 @@ private: bool simplePen; bool matrixRotShear; - enum Scale { NoScale, Scaled, NegativeScale } scale; + Scale scale; SurfaceCache *surfaceCache; QTransform transform; diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 25e24fd..f571d1b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -818,7 +818,7 @@ static const QByteArray flagDescriptions(uint mask, const FlagDescription *flags -static void printDirectFBInfo(IDirectFB *fb) +static void printDirectFBInfo(IDirectFB *fb, IDirectFBSurface *primarySurface) { DFBResult result; DFBGraphicsDeviceDescription dev; @@ -829,10 +829,14 @@ static void printDirectFBInfo(IDirectFB *fb) return; } - qDebug("Device: %s (%s), Driver: %s v%i.%i (%s)\n" + DFBSurfacePixelFormat pixelFormat; + primarySurface->GetPixelFormat(primarySurface, &pixelFormat); + + qDebug("Device: %s (%s), Driver: %s v%i.%i (%s) Pixelformat: %d (%d)\n" "acceleration: 0x%x%s\nblit: 0x%x%s\ndraw: 0x%0x%s\nvideo: %iKB\n", dev.name, dev.vendor, dev.driver.name, dev.driver.major, - dev.driver.minor, dev.driver.vendor, dev.acceleration_mask, + dev.driver.minor, dev.driver.vendor, DFB_PIXELFORMAT_INDEX(pixelFormat), + QDirectFBScreen::getImageFormat(primarySurface), dev.acceleration_mask, ::flagDescriptions(dev.acceleration_mask, accelerationDescriptions).constData(), dev.blitting_flags, ::flagDescriptions(dev.blitting_flags, blitDescriptions).constData(), dev.drawing_flags, ::flagDescriptions(dev.drawing_flags, drawDescriptions).constData(), @@ -883,9 +887,6 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } - if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) - printDirectFBInfo(d_ptr->dfb); - if (displayArgs.contains(QLatin1String("videoonly"), Qt::CaseInsensitive)) d_ptr->directFBFlags |= VideoOnly; @@ -952,6 +953,9 @@ bool QDirectFBScreen::connect(const QString &displaySpec) return false; } + if (displayArgs.contains(QLatin1String("debug"), Qt::CaseInsensitive)) + printDirectFBInfo(d_ptr->dfb, d_ptr->dfbSurface); + // Work out what format we're going to use for surfaces with an alpha channel d_ptr->alphaPixmapFormat = QDirectFBScreen::getImageFormat(d_ptr->dfbSurface); setPixelFormat(d_ptr->alphaPixmapFormat); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index f1e3c84..cd8796b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -178,15 +178,7 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask) "Unable to get DirectFB handle!"); } - DFBSurfaceDescription description; - description.flags = DFBSurfaceDescriptionFlags(DSDESC_WIDTH | - DSDESC_HEIGHT | - DSDESC_PIXELFORMAT); - description.width = rect.width(); - description.height = rect.height(); - QDirectFBScreen::initSurfaceDescriptionPixelFormat(&description, - screen->pixelFormat()); - dfbSurface = screen->createDFBSurface(description, false); + dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface); forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { Q_ASSERT(dfbSurface); @@ -340,7 +332,7 @@ inline bool isWidgetOpaque(const QWidget *w) return false; } void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, - const QPoint &offset) + const QPoint &offset) { Q_UNUSED(widget); #ifdef QT_NO_DIRECTFB_WM diff --git a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip Binary files differindex ab96b1b..923cca4 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip +++ b/src/plugins/sqldrivers/sqlite_symbian/SQLite3_v9.2.zip diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby new file mode 100644 index 0000000..dc702f9 --- /dev/null +++ b/src/s60installs/qt.iby @@ -0,0 +1,94 @@ +#ifndef QT_IBY +#define QT_IBY + +#include <bldvariant.hrh> + +// Dependancies for more than one module +#include <base.iby> +#include <openenv.iby> // QtCore, QtGui, QtNetwork, QtOpenGL, QSvgIconEngine, +#include <cone.iby> // QtGui, QtOpenGL + +// QtGui dependancies +#include <bafl.iby> +#include <store.iby> +#include <fntstore.iby> +#include <ecom.iby> +#include <fontutils.iby> +#include <fepbase.iby> +#include <fbserv.iby> +#include <bitgdi.iby> +#include <gdi.iby> +#include <wserv.iby> +#include <apparc.iby> +#include <uikon.iby> +#include <etext.iby> +#include <emime.iby> +#include <eikstd.iby> +#include <mmf.iby> +#include <avkon.iby> +#include <commonui.iby> +#include <platformenv.iby> +#include <senduiservices.iby> +#include <aknicon.iby> +#include <aknskins.iby> + +// QtNetwork dependancies +#include <esock_core.iby> +#include <insock.iby> + +// QtOpenGL dependancies +///@todo Problem here as we need libegl.dll and libglesv2.dll but they may come from a variety of places +/// depending on the platform we're on + +#warning("qt.iby: hack - BINARY_SELECTION_ORDER really needs to be at the baseport/device level as it depends on the device type"); +BINARY_SELECTION_ORDER ARMV6,ARMV5 // hack - this really needs to be at the baseport/device level as it depends on the device type + +file=ABI_DIR\BUILD_DIR\QtCore.dll SHARED_LIB_DIR\QtCore.dll PAGED +file=ABI_DIR\BUILD_DIR\QtGui.dll SHARED_LIB_DIR\QtGui.dll PAGED +file=ABI_DIR\BUILD_DIR\QtOpenGL.dll SHARED_LIB_DIR\QtOpenGL.dll PAGED +file=ABI_DIR\BUILD_DIR\QtSvg.dll SHARED_LIB_DIR\QtSvg.dll PAGED +file=ABI_DIR\BUILD_DIR\QtXml.dll SHARED_LIB_DIR\QtXml.dll PAGED +file=ABI_DIR\BUILD_DIR\QtNetwork.dll SHARED_LIB_DIR\QtNetwork.dll PAGED +file=ABI_DIR\BUILD_DIR\QtScript.dll SHARED_LIB_DIR\QtScript.dll PAGED +file=ABI_DIR\BUILD_DIR\QtTest.dll SHARED_LIB_DIR\QtTest.dll PAGED + +// imageformats +file=ABI_DIR\BUILD_DIR\qgif.dll SHARED_LIB_DIR\qgif.dll PAGED +file=ABI_DIR\BUILD_DIR\qico.dll SHARED_LIB_DIR\qico.dll PAGED +file=ABI_DIR\BUILD_DIR\qjpeg.dll SHARED_LIB_DIR\qjpeg.dll PAGED +file=ABI_DIR\BUILD_DIR\qmng.dll SHARED_LIB_DIR\qmng.dll PAGED +file=ABI_DIR\BUILD_DIR\qsvg.dll SHARED_LIB_DIR\qsvg.dll PAGED +file=ABI_DIR\BUILD_DIR\qtiff.dll SHARED_LIB_DIR\qtiff.dll PAGED + +// codecs +file=ABI_DIR\BUILD_DIR\qcncodecs.dll SHARED_LIB_DIR\qcncodecs.dll PAGED +file=ABI_DIR\BUILD_DIR\qjpcodecs.dll SHARED_LIB_DIR\qjpcodecs.dll PAGED +file=ABI_DIR\BUILD_DIR\qkrcodecs.dll SHARED_LIB_DIR\qkrcodecs.dll PAGED +file=ABI_DIR\BUILD_DIR\qtwcodecs.dll SHARED_LIB_DIR\qtwcodecs.dll PAGED + +// iconengines +file=ABI_DIR\BUILD_DIR\qsvgicon.dll SHARED_LIB_DIR\qsvgicon.dll PAGED + +S60_APP_RESOURCE(s60main) + +// imageformats stubs +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin + +// codecs stubs +data=\epoc32\winscw\c\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=\epoc32\winscw\c\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin + +// iconengines stubs +data=\epoc32\winscw\c\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin + +// Stub sis file +data=ZSYSTEM\install\qt.sis System\Install\qt.sis + +#endif // __QT_IBY__ diff --git a/src/s60installs/qt_libs.pro b/src/s60installs/qt_libs.pro index 064d6a5..99fde62 100644 --- a/src/s60installs/qt_libs.pro +++ b/src/s60installs/qt_libs.pro @@ -69,4 +69,7 @@ symbian: { qtlibraries.sources += QtPhonon.dll } + BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" + BLD_INF_RULES.prj_exports += "qtvggraphicssystem.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qtvggraphicssystem.iby)" + BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" } diff --git a/src/s60installs/qtdemoapps.iby b/src/s60installs/qtdemoapps.iby new file mode 100644 index 0000000..d888135 --- /dev/null +++ b/src/s60installs/qtdemoapps.iby @@ -0,0 +1,15 @@ +#ifndef QTDEMOAPPS_IBY +#define QTDEMOAPPS_IBY + +// A subset of Qt demo & example applications + +// Note that star requires OpenVG and the Qt OpenVG paint engine +S60_APP_EXE(star) +S60_APP_RESOURCE(star) +data=\epoc32\data\Z\private\10003a3f\import\Apps\star_reg.rsc \private\10003a3f\import\apps\star_reg.rsc + +S60_APP_EXE(wiggly) +S60_APP_RESOURCE(wiggly) +data=\epoc32\data\Z\private\10003a3f\import\Apps\wiggly_reg.rsc \private\10003a3f\import\apps\wiggly_reg.rsc + +#endif // QTDEMOAPPS_IBY diff --git a/src/s60installs/qtvggraphicssystem.iby b/src/s60installs/qtvggraphicssystem.iby new file mode 100644 index 0000000..6aec404 --- /dev/null +++ b/src/s60installs/qtvggraphicssystem.iby @@ -0,0 +1,9 @@ +#ifndef QTVGGRAPHICSSYSTEM_IBY +#define QTVGGRAPHICSSYSTEM_IBY + +#include <qt.iby> + +file=ABI_DIR\BUILD_DIR\qvggraphicssystem.dll qvggraphicssystem.dll +data=\epoc32\winscw\c\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin + +#endif // QTVGGRAPHICSSYSTEM_IBY diff --git a/src/s60main/qts60mainappui.cpp b/src/s60main/qts60mainappui.cpp index 016d49b..dafbe96 100644 --- a/src/s60main/qts60mainappui.cpp +++ b/src/s60main/qts60mainappui.cpp @@ -20,7 +20,6 @@ #include "qts60mainappui.h" #include <QtGui/qapplication.h> #include <QtGui/qmenu.h> -#include <QtGui/qmenubar.h> #include <QtGui/private/qt_s60_p.h> // ============================ MEMBER FUNCTIONS =============================== @@ -73,18 +72,8 @@ CQtS60MainAppUi::~CQtS60MainAppUi() // void CQtS60MainAppUi::HandleCommandL( TInt aCommand ) { - switch (aCommand) { - case EEikCmdExit: - case EAknSoftkeyBack: - case EAknSoftkeyExit: - if (qApp) - qApp->exit(); - break; - default: - // For now assume all unknown menu items are Qt menu items - QMenuBar::symbianCommands(aCommand); - break; - } + if (qApp) + qApp->s60HandleCommandL(aCommand); } void CQtS60MainAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl *control) diff --git a/src/sql/drivers/ibase/qsql_ibase.cpp b/src/sql/drivers/ibase/qsql_ibase.cpp index 9eeb41d..6834d9a 100644 --- a/src/sql/drivers/ibase/qsql_ibase.cpp +++ b/src/sql/drivers/ibase/qsql_ibase.cpp @@ -871,7 +871,7 @@ QIBaseResult::~QIBaseResult() bool QIBaseResult::prepare(const QString& query) { - //qDebug("prepare: %s\n", qPrintable(query)); +// qDebug("prepare: %s", qPrintable(query)); if (!driver() || !driver()->isOpen() || driver()->isOpenError()) return false; d->cleanup(); @@ -1025,7 +1025,7 @@ bool QIBaseResult::exec() } if (ok) { - if (colCount()) { + if (colCount() && d->queryType != isc_info_sql_stmt_exec_procedure) { isc_dsql_free_statement(d->status, &d->stmt, DSQL_close); if (d->isError(QT_TRANSLATE_NOOP("QIBaseResult", "Unable to close statement"))) return false; @@ -1039,7 +1039,7 @@ bool QIBaseResult::exec() return false; // Not all stored procedures necessarily return values. - if (d->queryType == isc_info_sql_stmt_exec_procedure && d->sqlda->sqld == 0) + if (d->queryType == isc_info_sql_stmt_exec_procedure && d->sqlda && d->sqlda->sqld == 0) delDA(d->sqlda); if (d->sqlda) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9932463..ee500a0 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -563,7 +563,6 @@ QChar QODBCDriverPrivate::quoteChar() const static QChar quote = QChar::fromLatin1('"'); if (!isQuoteInitialized) { char driverResponse[4]; - SQLUSMALLINT casing; SQLSMALLINT length; int r = SQLGetInfo(hDbc, SQL_IDENTIFIER_QUOTE_CHAR, diff --git a/src/xmlpatterns/expr/qapplytemplate.cpp b/src/xmlpatterns/expr/qapplytemplate.cpp index 95f4fdf..b91c2f0 100644 --- a/src/xmlpatterns/expr/qapplytemplate.cpp +++ b/src/xmlpatterns/expr/qapplytemplate.cpp @@ -160,8 +160,7 @@ Item::Iterator::Ptr ApplyTemplate::evaluateSequence(const DynamicContext::Ptr &c focus->setFocusIterator(focusIterator); return makeSequenceMappingIterator<Item>(ConstPtr(this), focusIterator, focus); } - else - return CommonValues::emptyIterator; + return CommonValues::emptyIterator; } } diff --git a/src/xmlpatterns/functions/qsequencefns.cpp b/src/xmlpatterns/functions/qsequencefns.cpp index f6d5391..faa787e 100644 --- a/src/xmlpatterns/functions/qsequencefns.cpp +++ b/src/xmlpatterns/functions/qsequencefns.cpp @@ -246,8 +246,7 @@ Item::Iterator::Ptr SubsequenceFN::evaluateSequence(const DynamicContext::Ptr &c if(length < 1 && length != -1) return CommonValues::emptyIterator; - else - return Item::Iterator::Ptr(new SubsequenceIterator(it, startingLoc, length)); + return Item::Iterator::Ptr(new SubsequenceIterator(it, startingLoc, length)); } Item SubsequenceFN::evaluateSingleton(const DynamicContext::Ptr &context) const |