diff options
Diffstat (limited to 'src')
30 files changed, 194 insertions, 145 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 59a601e..c9fbec8 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -105,7 +105,7 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_TEXTCODECPLUGIN +#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_TEXTCODECPLUGIN) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QTextCodecFactoryInterface_iid, QLatin1String("/codecs"))) #endif @@ -149,7 +149,7 @@ static bool nameMatch(const QByteArray &name, const QByteArray &test) static QTextCodec *createForName(const QByteArray &name) { -#ifndef QT_NO_TEXTCODECPLUGIN +#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_TEXTCODECPLUGIN) QFactoryLoader *l = loader(); QStringList keys = l->keys(); for (int i = 0; i < keys.size(); ++i) { @@ -1141,7 +1141,7 @@ QList<QByteArray> QTextCodec::availableCodecs() locker.unlock(); #endif -#ifndef QT_NO_TEXTCODECPLUGIN +#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_TEXTCODECPLUGIN) QFactoryLoader *l = loader(); QStringList keys = l->keys(); for (int i = 0; i < keys.size(); ++i) { @@ -1181,7 +1181,7 @@ QList<int> QTextCodec::availableMibs() locker.unlock(); #endif -#ifndef QT_NO_TEXTCODECPLUGIN +#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_TEXTCODECPLUGIN) QFactoryLoader *l = loader(); QStringList keys = l->keys(); for (int i = 0; i < keys.size(); ++i) { diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index a60f206..4e580dd 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2997,7 +2997,9 @@ bool qt_check_std3rules(const QChar *uc, int len) // only LDH is present if (c == '-' || (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z')) + || (c >= 'a' && c <= 'z') + //underscore is not supposed to be allowed, but other browser accept it (QTBUG-7434) + || c == '_') continue; return false; diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index bf2e2e4..609e6b3 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -514,7 +514,7 @@ QCoreApplication::QCoreApplication(int &argc, char **argv) { init(); QCoreApplicationPrivate::eventDispatcher->startingUp(); -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_LIBRARY) // Refresh factoryloader, as text codecs are requested during lib path // resolving process and won't be therefore properly loaded. // Unknown if this is symbian specific issue. @@ -2189,7 +2189,7 @@ QString QCoreApplication::applicationVersion() return coreappdata()->applicationVersion; } -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive)) @@ -2291,13 +2291,11 @@ QStringList QCoreApplication::libraryPaths() */ void QCoreApplication::setLibraryPaths(const QStringList &paths) { -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) QMutexLocker locker(libraryPathMutex()); if (!coreappdata()->app_libpaths) coreappdata()->app_libpaths = new QStringList; *(coreappdata()->app_libpaths) = paths; QFactoryLoader::refreshAll(); -#endif } /*! @@ -2318,7 +2316,6 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths) */ void QCoreApplication::addLibraryPath(const QString &path) { -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) if (path.isEmpty()) return; @@ -2333,7 +2330,6 @@ void QCoreApplication::addLibraryPath(const QString &path) coreappdata()->app_libpaths->prepend(canonicalPath); QFactoryLoader::refreshAll(); } -#endif } /*! @@ -2344,7 +2340,6 @@ void QCoreApplication::addLibraryPath(const QString &path) */ void QCoreApplication::removeLibraryPath(const QString &path) { -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) if (path.isEmpty()) return; @@ -2356,7 +2351,6 @@ void QCoreApplication::removeLibraryPath(const QString &path) QString canonicalPath = QDir(path).canonicalPath(); coreappdata()->app_libpaths->removeAll(canonicalPath); QFactoryLoader::refreshAll(); -#endif } #endif //QT_NO_LIBRARY diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 87decc6..62d565a 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -41,7 +41,7 @@ #include "qfactoryloader_p.h" -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY #include "qfactoryinterface.h" #include "qmap.h" #include <qdir.h> diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index 51426ba..10e6e2a 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -57,7 +57,7 @@ #include "QtCore/qstringlist.h" #include "private/qlibrary_p.h" -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QT_BEGIN_NAMESPACE diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index a55a061..0921bdb 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -389,7 +389,7 @@ QT_BEGIN_NAMESPACE \internal */ -#if !defined(QT_NO_LIBRARY) && (!defined(QT_NO_SETTINGS) || !defined(Q_OS_WIN)) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QAccessibleFactoryInterface_iid, QLatin1String("/accessible"))) #endif @@ -532,7 +532,7 @@ QAccessibleInterface *QAccessible::queryAccessibleInterface(QObject *object) if (iface) return iface; } -#if !defined(QT_NO_LIBRARY) && (!defined(QT_NO_SETTINGS) || !defined(Q_OS_WIN)) +#ifndef QT_NO_LIBRARY QAccessibleFactoryInterface *factory = qobject_cast<QAccessibleFactoryInterface*>(loader()->instance(cn)); if (factory) { iface = factory->create(cn, object); diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 8cee021..0d4e48a 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -297,6 +297,7 @@ QGraphicsScenePrivate::QGraphicsScenePrivate() scenePosDescendantsUpdatePending(false), stickyFocus(false), hasFocus(false), + rectAdjust(2), focusItem(0), lastFocusItem(0), tabFocusFirst(0), @@ -3217,7 +3218,10 @@ void QGraphicsScene::update(const QRectF &rect) // Update all views. for (int i = 0; i < d->views.size(); ++i) { QGraphicsView *view = d->views.at(i); - view->d_func()->updateRegion(QRegion(view->mapFromScene(rect).boundingRect())); + if (view->isTransformed()) + view->d_func()->updateRectF(view->viewportTransform().mapRect(rect)); + else + view->d_func()->updateRectF(rect); } } else { d->updatedRects << rect; @@ -4701,11 +4705,11 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (drawItem) { const QRectF brect = adjustedItemEffectiveBoundingRect(item); ENSURE_TRANSFORM_PTR - QRect viewBoundingRect = translateOnlyTransform ? brect.translated(transformPtr->dx(), transformPtr->dy()).toRect() - : transformPtr->mapRect(brect).toRect(); + QRect viewBoundingRect = translateOnlyTransform ? brect.translated(transformPtr->dx(), transformPtr->dy()).toAlignedRect() + : transformPtr->mapRect(brect).toAlignedRect(); + viewBoundingRect.adjust(-rectAdjust, -rectAdjust, rectAdjust, rectAdjust); if (widget) item->d_ptr->paintedViewBoundingRects.insert(widget, viewBoundingRect); - viewBoundingRect.adjust(-1, -1, 1, 1); drawItem = exposedRegion ? exposedRegion->intersects(viewBoundingRect) : !viewBoundingRect.normalized().isEmpty(); if (!drawItem) { @@ -4954,34 +4958,29 @@ static inline bool updateHelper(QGraphicsViewPrivate *view, QGraphicsItemPrivate if (itemIsUntransformable) { const QTransform xform = itemq->deviceTransform(viewq->viewportTransform()); if (!item->hasBoundingRegionGranularity) - return view->updateRect(xform.mapRect(rect).toRect()); - return view->updateRegion(xform.map(QRegion(rect.toRect()))); + return view->updateRectF(xform.mapRect(rect)); + return view->updateRegion(rect, xform); } if (item->sceneTransformTranslateOnly && view->identityMatrix) { const qreal dx = item->sceneTransform.dx(); const qreal dy = item->sceneTransform.dy(); - if (!item->hasBoundingRegionGranularity) { - QRectF r(rect); - r.translate(dx - view->horizontalScroll(), dy - view->verticalScroll()); - return view->updateRect(r.toRect()); - } - QRegion r(rect.toRect()); - r.translate(qRound(dx) - view->horizontalScroll(), qRound(dy) - view->verticalScroll()); - return view->updateRegion(r); + QRectF r(rect); + r.translate(dx - view->horizontalScroll(), dy - view->verticalScroll()); + return view->updateRectF(r); } if (!viewq->isTransformed()) { if (!item->hasBoundingRegionGranularity) - return view->updateRect(item->sceneTransform.mapRect(rect).toRect()); - return view->updateRegion(item->sceneTransform.map(QRegion(rect.toRect()))); + return view->updateRectF(item->sceneTransform.mapRect(rect)); + return view->updateRegion(rect, item->sceneTransform); } QTransform xform = item->sceneTransform; xform *= viewq->viewportTransform(); if (!item->hasBoundingRegionGranularity) - return view->updateRect(xform.mapRect(rect).toRect()); - return view->updateRegion(xform.map(QRegion(rect.toRect()))); + return view->updateRectF(xform.mapRect(rect)); + return view->updateRegion(rect, xform); } void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool dirtyAncestorContainsChildren, @@ -5197,8 +5196,14 @@ void QGraphicsScene::drawItems(QPainter *painter, // Determine view, expose and flags. QGraphicsView *view = widget ? qobject_cast<QGraphicsView *>(widget->parentWidget()) : 0; QRegion *expose = 0; - if (view) + const quint32 oldRectAdjust = d->rectAdjust; + if (view) { expose = &view->d_func()->exposedRegion; + if (view->d_func()->optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) + d->rectAdjust = 1; + else + d->rectAdjust = 2; + } // Find all toplevels, they are already sorted. QList<QGraphicsItem *> topLevelItems; @@ -5211,6 +5216,7 @@ void QGraphicsScene::drawItems(QPainter *painter, } } + d->rectAdjust = oldRectAdjust; // Reset discovery bits. for (int i = 0; i < topLevelItems.size(); ++i) topLevelItems.at(i)->d_ptr->itemDiscovered = 0; diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h index 11e250e..0a85f0e 100644 --- a/src/gui/graphicsview/qgraphicsscene_p.h +++ b/src/gui/graphicsview/qgraphicsscene_p.h @@ -136,8 +136,10 @@ public: QBrush backgroundBrush; QBrush foregroundBrush; - bool stickyFocus; - bool hasFocus; + quint32 stickyFocus : 1; + quint32 hasFocus : 1; + quint32 padding : 30; + quint32 rectAdjust; QGraphicsItem *focusItem; QGraphicsItem *lastFocusItem; QGraphicsWidget *tabFocusFirst; diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index c951dce..0bba7e9 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -854,10 +854,7 @@ void QGraphicsViewPrivate::processPendingUpdates() if (fullUpdatePending) { viewport->update(); } else if (viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) { - if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) - viewport->update(dirtyBoundingRect.adjusted(-1, -1, 1, 1)); - else - viewport->update(dirtyBoundingRect.adjusted(-2, -2, 2, 2)); + viewport->update(dirtyBoundingRect); } else { viewport->update(dirtyRegion); // Already adjusted in updateRect/Region. } @@ -882,46 +879,44 @@ static inline void QRect_unite(QRect *rect, const QRect &other) } } -bool QGraphicsViewPrivate::updateRegion(const QRegion &r) +bool QGraphicsViewPrivate::updateRegion(const QRectF &rect, const QTransform &xform) { - if (fullUpdatePending || viewportUpdateMode == QGraphicsView::NoViewportUpdate || r.isEmpty()) + if (rect.isEmpty()) return false; - const QRect boundingRect = r.boundingRect(); - if (!intersectsViewport(boundingRect, viewport->width(), viewport->height())) - return false; // Update region outside viewport. - - switch (viewportUpdateMode) { - case QGraphicsView::FullViewportUpdate: - fullUpdatePending = true; - viewport->update(); - break; - case QGraphicsView::BoundingRectViewportUpdate: - QRect_unite(&dirtyBoundingRect, boundingRect); - if (containsViewport(dirtyBoundingRect, viewport->width(), viewport->height())) { - fullUpdatePending = true; - viewport->update(); - } - break; - case QGraphicsView::SmartViewportUpdate: // ### DEPRECATE - case QGraphicsView::MinimalViewportUpdate: - { - const QVector<QRect> &rects = r.rects(); - for (int i = 0; i < rects.size(); ++i) { - if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) - dirtyRegion += rects.at(i).adjusted(-1, -1, 1, 1); - else - dirtyRegion += rects.at(i).adjusted(-2, -2, 2, 2); - } - break; + if (viewportUpdateMode != QGraphicsView::MinimalViewportUpdate + && viewportUpdateMode != QGraphicsView::SmartViewportUpdate) { + // No point in updating with QRegion granularity; use the rect instead. + return updateRectF(xform.mapRect(rect)); } - default: - break; + + // Update mode is either Minimal or Smart, so we have to do a potentially slow operation, + // which is clearly documented here: QGraphicsItem::setBoundingRegionGranularity. + const QRegion region = xform.map(QRegion(rect.toAlignedRect())); + QRect viewRect = region.boundingRect(); + const bool dontAdjustForAntialiasing = optimizationFlags & QGraphicsView::DontAdjustForAntialiasing; + if (dontAdjustForAntialiasing) + viewRect.adjust(-1, -1, 1, 1); + else + viewRect.adjust(-2, -2, 2, 2); + if (!intersectsViewport(viewRect, viewport->width(), viewport->height())) + return false; // Update region for sure outside viewport. + + const QVector<QRect> &rects = region.rects(); + for (int i = 0; i < rects.size(); ++i) { + viewRect = rects.at(i); + if (dontAdjustForAntialiasing) + viewRect.adjust(-1, -1, 1, 1); + else + viewRect.adjust(-2, -2, 2, 2); + dirtyRegion += viewRect; } return true; } +// NB! Assumes the rect 'r' is already aligned and adjusted for antialiasing. +// For QRectF use updateRectF(const QRectF &) to ensure proper adjustments. bool QGraphicsViewPrivate::updateRect(const QRect &r) { if (fullUpdatePending || viewportUpdateMode == QGraphicsView::NoViewportUpdate @@ -943,10 +938,7 @@ bool QGraphicsViewPrivate::updateRect(const QRect &r) break; case QGraphicsView::SmartViewportUpdate: // ### DEPRECATE case QGraphicsView::MinimalViewportUpdate: - if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) - dirtyRegion += r.adjusted(-1, -1, 1, 1); - else - dirtyRegion += r.adjusted(-2, -2, 2, 2); + dirtyRegion += r; break; default: break; @@ -3403,8 +3395,14 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Items if (!(d->optimizationFlags & IndirectPainting)) { + const quint32 oldRectAdjust = d->scene->d_func()->rectAdjust; + if (d->optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) + d->scene->d_func()->rectAdjust = 1; + else + d->scene->d_func()->rectAdjust = 2; d->scene->d_func()->drawItems(&painter, viewTransformed ? &viewTransform : 0, &d->exposedRegion, viewport()); + d->scene->d_func()->rectAdjust = oldRectAdjust; // Make sure the painter's world transform is restored correctly when // drawing without painter state protection (DontSavePainterState). // We only change the worldTransform() so there's no need to do a full-blown diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h index 80e3ec1..aeff28a 100644 --- a/src/gui/graphicsview/qgraphicsview_p.h +++ b/src/gui/graphicsview/qgraphicsview_p.h @@ -192,8 +192,17 @@ public: #endif } + inline bool updateRectF(const QRectF &rect) + { + if (rect.isEmpty()) + return false; + if (optimizationFlags & QGraphicsView::DontAdjustForAntialiasing) + return updateRect(rect.toAlignedRect().adjusted(-1, -1, 1, 1)); + return updateRect(rect.toAlignedRect().adjusted(-2, -2, 2, 2)); + } + bool updateRect(const QRect &rect); - bool updateRegion(const QRegion ®ion); + bool updateRegion(const QRectF &rect, const QTransform &xform); bool updateSceneSlotReimplementedChecked; QRegion exposedRegion; diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index bc52e99..891b1db 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -441,7 +441,7 @@ void QPixmapIconEngine::virtual_hook(int id, void *data) } } -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QIconEngineFactoryInterface_iid, QLatin1String("/iconengines"), Qt::CaseInsensitive)) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loaderV2, diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 27f9627..93d5cd3 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -144,7 +144,7 @@ QT_BEGIN_NAMESPACE -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats"))) #endif @@ -205,7 +205,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, QByteArray form = format.toLower(); QImageIOHandler *handler = 0; -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY // check if we have plugins that support the image format QFactoryLoader *l = loader(); QStringList keys = l->keys(); @@ -217,7 +217,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, << keys.size() << "plugins available: " << keys; #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY int suffixPluginIndex = -1; if (device && format.isEmpty() && autoDetectImageFormat && !ignoresFormatAndExtension) { // if there's no format, see if \a device is a file, and if so, find @@ -246,7 +246,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, if (ignoresFormatAndExtension) testFormat = QByteArray(); -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (suffixPluginIndex != -1) { // check if the plugin that claims support for this format can load // from this device with this format. @@ -331,7 +331,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, #endif } -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) { // check if any of our plugins recognize the file from its contents. const qint64 pos = device ? device->pos() : 0; @@ -350,7 +350,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, if (device && !device->isSequential()) device->seek(pos); } -#endif +#endif // QT_NO_LIBRARY if (!handler && (autoDetectImageFormat || ignoresFormatAndExtension)) { // check if any of our built-in handlers recognize the file from its @@ -1414,7 +1414,7 @@ QList<QByteArray> QImageReader::supportedImageFormats() for (int i = 0; i < _qt_NumFormats; ++i) formats << _qt_BuiltInFormats[i].extension; -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QFactoryLoader *l = loader(); QStringList keys = l->keys(); diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 503a1b2..552729f 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -117,7 +117,7 @@ QT_BEGIN_NAMESPACE -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QImageIOHandlerFactoryInterface_iid, QLatin1String("/imageformats"))) #endif @@ -129,7 +129,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, QByteArray suffix; QImageIOHandler *handler = 0; -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY // check if any plugins can write the image QFactoryLoader *l = loader(); QStringList keys = l->keys(); @@ -142,7 +142,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, // this allows plugins to override our built-in handlers. if (QFile *file = qobject_cast<QFile *>(device)) { if (!(suffix = QFileInfo(file->fileName()).suffix().toLower().toLatin1()).isEmpty()) { -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY int index = keys.indexOf(QString::fromLatin1(suffix)); if (index != -1) suffixPluginIndex = index; @@ -153,7 +153,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, QByteArray testFormat = !form.isEmpty() ? form : suffix; -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (suffixPluginIndex != -1) { // when format is missing, check if we can find a plugin for the // suffix. @@ -161,7 +161,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, if (plugin && (plugin->capabilities(device, suffix) & QImageIOPlugin::CanWrite)) handler = plugin->create(device, suffix); } -#endif // Q_NO_LIBRARY +#endif // QT_NO_LIBRARY // check if any built-in handlers can write the image if (!handler && !testFormat.isEmpty()) { @@ -192,7 +192,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, } } -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (!testFormat.isEmpty()) { for (int i = 0; i < keys.size(); ++i) { QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i))); @@ -203,7 +203,7 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device, } } } -#endif +#endif // QT_NO_LIBRARY if (!handler) return 0; @@ -670,7 +670,7 @@ QList<QByteArray> QImageWriter::supportedImageFormats() formats << "png"; #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QFactoryLoader *l = loader(); QStringList keys = l->keys(); for (int i = 0; i < keys.count(); ++i) { diff --git a/src/gui/inputmethod/qinputcontextfactory.cpp b/src/gui/inputmethod/qinputcontextfactory.cpp index d47e343..ec8d8e2 100644 --- a/src/gui/inputmethod/qinputcontextfactory.cpp +++ b/src/gui/inputmethod/qinputcontextfactory.cpp @@ -81,7 +81,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QInputContextFactoryInterface_iid, QLatin1String("/inputmethods"))) #endif @@ -153,7 +153,7 @@ QInputContext *QInputContextFactory::create( const QString& key, QObject *parent result = new QCoeFepInputContext; } #endif -#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) +#ifdef QT_NO_LIBRARY Q_UNUSED(key); #else if (QInputContextFactoryInterface *factory = @@ -193,7 +193,7 @@ QStringList QInputContextFactory::keys() #if defined(Q_WS_S60) result << QLatin1String("coefep"); #endif -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY result += loader()->keys(); #endif // QT_NO_LIBRARY return result; diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 80334a6..4492e53 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -2145,8 +2145,8 @@ int QTableView::sizeHintForRow(int row) const ensurePolished(); - int left = qMax(0, columnAt(0)); - int right = columnAt(d->viewport->width()); + int left = qMax(0, d->horizontalHeader->visualIndexAt(0)); + int right = d->horizontalHeader->visualIndexAt(d->viewport->width()); if (right == -1) // the table don't have enough columns to fill the viewport right = d->model->columnCount(d->root) - 1; @@ -2204,8 +2204,8 @@ int QTableView::sizeHintForColumn(int column) const ensurePolished(); - int top = qMax(0, rowAt(0)); - int bottom = rowAt(d->viewport->height()); + int top = qMax(0, d->verticalHeader->visualIndexAt(0)); + int bottom = d->verticalHeader->visualIndexAt(d->viewport->height()); if (!isVisible() || bottom == -1) // the table don't have enough rows to fill the viewport bottom = d->model->rowCount(d->root) - 1; diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp index c4119af..2dd251b 100644 --- a/src/gui/kernel/qguiplatformplugin.cpp +++ b/src/gui/kernel/qguiplatformplugin.cpp @@ -81,7 +81,7 @@ QGuiPlatformPlugin *qt_guiPlatformPlugin() static QGuiPlatformPlugin *plugin; if (!plugin) { -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN")); #ifdef Q_WS_X11 diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp index 29f24a3..3c09894 100644 --- a/src/gui/painting/qgraphicssystemfactory.cpp +++ b/src/gui/painting/qgraphicssystemfactory.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QGraphicsSystemFactoryInterface_iid, QLatin1String("/graphicssystems"), Qt::CaseInsensitive)) #endif @@ -79,7 +79,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) else if (system.isEmpty() || system == QLatin1String("native")) return 0; -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (!ret) { if (QGraphicsSystemFactoryInterface *factory = qobject_cast<QGraphicsSystemFactoryInterface*>(loader()->instance(system))) ret = factory->create(system); @@ -100,7 +100,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) */ QStringList QGraphicsSystemFactory::keys() { -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QStringList list = loader()->keys(); #else QStringList list; diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index ac2fcf4..14ba94e 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -118,9 +118,10 @@ QMacCGContext::QMacCGContext(QPainter *p) QRegion clip = p->paintEngine()->systemClip(); QTransform native = p->deviceTransform(); QTransform logical = p->combinedTransform(); + if (p->hasClipping()) { QRegion r = p->clipRegion(); - r.translate(native.dx() - logical.dx(), native.dy() - logical.dy()); + r.translate(native.dx(), native.dy()); if (clip.isEmpty()) clip = r; else @@ -128,10 +129,7 @@ QMacCGContext::QMacCGContext(QPainter *p) } qt_mac_clip_cg(context, clip, 0); - QPainterState *state = static_cast<QPainterState *>(pe->state); - Q_ASSERT(state); - if (!state->redirectionMatrix.isIdentity()) - CGContextTranslateCTM(context, state->redirectionMatrix.dx(), state->redirectionMatrix.dy()); + CGContextTranslateCTM(context, native.dx(), native.dy()); } } CGContextRetain(context); diff --git a/src/gui/styles/qstylefactory.cpp b/src/gui/styles/qstylefactory.cpp index 0dbb21f..9009878 100644 --- a/src/gui/styles/qstylefactory.cpp +++ b/src/gui/styles/qstylefactory.cpp @@ -81,7 +81,7 @@ QT_BEGIN_INCLUDE_NAMESPACE QT_END_INCLUDE_NAMESPACE #endif -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QStyleFactoryInterface_iid, QLatin1String("/styles"), Qt::CaseInsensitive)) #endif diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 0bfdbc0..a6510cb 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -226,8 +226,19 @@ bool QCoreTextFontEngineMulti::stringToCMap(const QChar *str, int len, QGlyphLay QFixed *outAdvances_y = glyphs->advances_y; glyph_t *initialGlyph = outGlyphs; - if (arraySize == 0) - return false; + if (arraySize == 0) { + // CoreText failed to shape the text we gave it, so we assume one glyph + // per character and build a list of invalid glyphs with zero advance + *nglyphs = len; + for (int i = 0; i < len; ++i) { + outGlyphs[i] = 0; + logClusters[i] = i; + outAdvances_x[i] = QFixed(); + outAdvances_y[i] = QFixed(); + outAttributes[i].clusterStart = true; + } + return true; + } const bool rtl = (CTRunGetStatus(static_cast<CTRunRef>(CFArrayGetValueAtIndex(array, 0))) & kCTRunStatusRightToLeft); diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 3c596e5..a2ee659 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -885,8 +885,10 @@ void QTextControl::processEvent(QEvent *e, const QPointF &coordinateOffset, QWid void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *contextWidget) { Q_D(QTextControl); - if (d->interactionFlags & Qt::NoTextInteraction) + if (d->interactionFlags == Qt::NoTextInteraction) { + e->ignore(); return; + } d->contextWidget = contextWidget; diff --git a/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp index 74add64..96545b4 100644 --- a/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp +++ b/src/multimedia/multimedia/audio/qaudiodevicefactory.cpp @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QAudioEngineFactoryInterface_iid, QLatin1String("/audio"), Qt::CaseInsensitive)) #endif @@ -139,7 +139,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) #endif #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QFactoryLoader* l = loader(); foreach (QString const& key, l->keys()) { @@ -158,7 +158,7 @@ QList<QAudioDeviceInfo> QAudioDeviceFactory::availableDevices(QAudio::Mode mode) QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() { -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default"))); if (plugin) { @@ -178,7 +178,7 @@ QAudioDeviceInfo QAudioDeviceFactory::defaultInputDevice() QAudioDeviceInfo QAudioDeviceFactory::defaultOutputDevice() { -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(QLatin1String("default"))); if (plugin) { @@ -207,7 +207,7 @@ QAbstractAudioDeviceInfo* QAudioDeviceFactory::audioDeviceInfo(const QString &re #endif #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(realm)); @@ -238,7 +238,7 @@ QAbstractAudioInput* QAudioDeviceFactory::createInputDevice(QAudioDeviceInfo con return new QAudioInputPrivate(deviceInfo.handle(), format); #endif #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm())); @@ -260,7 +260,7 @@ QAbstractAudioOutput* QAudioDeviceFactory::createOutputDevice(QAudioDeviceInfo c #endif #endif -#if !defined (QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY QAudioEngineFactoryInterface* plugin = qobject_cast<QAudioEngineFactoryInterface*>(loader()->instance(deviceInfo.realm())); diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index a7bd2d5..471927a 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -54,8 +54,10 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QBearerEngineFactoryInterface_iid, QLatin1String("/bearer"))) +#endif QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate() : pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true) @@ -354,6 +356,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() updating = false; +#ifndef QT_NO_LIBRARY QFactoryLoader *l = loader(); QBearerEngine *generic = 0; @@ -387,6 +390,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() if (generic) sessionEngines.append(generic); +#endif // QT_NO_LIBRARY } QBearerEngine *engine = qobject_cast<QBearerEngine *>(sender()); diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 3379296..8dba951 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -282,7 +282,7 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\n\ uniform mediump vec2 halfViewportSize; \n\ uniform highp vec2 invertedTextureSize; \n\ uniform highp mat3 brushTransform; \n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ void setPosition(void) \n\ { \n\ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\ @@ -292,7 +292,7 @@ static const char* const qglslPositionWithTextureBrushVertexShader = "\n\ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\ - textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\ + brushTextureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\ }\n"; static const char* const qglslAffinePositionWithTextureBrushVertexShader @@ -303,28 +303,28 @@ static const char* const qglslAffinePositionWithTextureBrushVertexShader // we emulate GL_REPEAT by only taking the fractional part of the texture coords. // TODO: Special case POT textures which don't need this emulation static const char* const qglslTextureBrushSrcFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() { \n\ - return texture2D(brushTexture, fract(textureCoords)); \n\ + return texture2D(brushTexture, fract(brushTextureCoords)); \n\ }\n"; #else static const char* const qglslTextureBrushSrcFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() \n\ { \n\ - return texture2D(brushTexture, textureCoords); \n\ + return texture2D(brushTexture, brushTextureCoords); \n\ }\n"; #endif static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\ - varying highp vec2 textureCoords; \n\ + varying highp vec2 brushTextureCoords; \n\ uniform lowp vec4 patternColor; \n\ uniform lowp sampler2D brushTexture; \n\ lowp vec4 srcPixel() \n\ { \n\ - return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \n\ + return patternColor * (1.0 - texture2D(brushTexture, brushTextureCoords).r); \n\ }\n"; // Solid Fill Brush diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 8460430..4461358 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1337,9 +1337,12 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem) d->drawCachedGlyphs(glyphType, textItem, true); } -void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src) +bool QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src) { Q_D(QGL2PaintEngineEx); + if (!d->shaderManager) + return false; + ensureActive(); d->transferMode(ImageDrawingMode); @@ -1354,6 +1357,7 @@ void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, textureId); d->drawTexture(dest, srcRect, size, false); + return true; } void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 30f6634..6ba0c42 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -123,7 +123,6 @@ public: virtual void renderHintsChanged(); virtual void transformChanged(); - virtual void drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr); virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr); virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, QPainter::PixmapFragmentHints hints); @@ -136,6 +135,8 @@ public: virtual void drawStaticTextItem(QStaticTextItem *textItem); + bool drawTexture(const QRectF &r, GLuint textureId, const QSize &size, const QRectF &sr); + Type type() const { return OpenGL2; } virtual void setState(QPainterState *s); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index bf77eda..cfacf26 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1259,11 +1259,24 @@ QGLFormat::OpenGLVersionFlags Q_AUTOTEST_EXPORT qOpenGLVersionFlagsFromString(co versionFlags |= QGLFormat::OpenGL_Version_3_2; case '1': versionFlags |= QGLFormat::OpenGL_Version_3_1; + case '0': + break; default: + versionFlags |= QGLFormat::OpenGL_Version_3_1 | + QGLFormat::OpenGL_Version_3_2; break; } } else { - qWarning("Unrecognised OpenGL version"); + versionFlags |= QGLFormat::OpenGL_Version_1_1 | + QGLFormat::OpenGL_Version_1_2 | + QGLFormat::OpenGL_Version_1_3 | + QGLFormat::OpenGL_Version_1_4 | + QGLFormat::OpenGL_Version_1_5 | + QGLFormat::OpenGL_Version_2_0 | + QGLFormat::OpenGL_Version_2_1 | + QGLFormat::OpenGL_Version_3_0 | + QGLFormat::OpenGL_Version_3_1 | + QGLFormat::OpenGL_Version_3_2; } } return versionFlags; @@ -2782,8 +2795,8 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text if (!eng->isNativePaintingActive()) { QRectF src(0, 0, target.width(), target.height()); QSize size(target.width(), target.height()); - eng->drawTexture(target, textureId, size, src); - return; + if (eng->drawTexture(target, textureId, size, src)) + return; } } @@ -2858,8 +2871,8 @@ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum text QRectF dest(point, QSizeF(textureWidth, textureHeight)); QRectF src(0, 0, textureWidth, textureHeight); QSize size(textureWidth, textureHeight); - eng->drawTexture(dest, textureId, size, src); - return; + if (eng->drawTexture(dest, textureId, size, src)) + return; } } @@ -5169,11 +5182,17 @@ Q_OPENGL_EXPORT void qt_set_gl_library_name(const QString& name) Q_OPENGL_EXPORT const QString qt_gl_library_name() { if (qt_gl_lib_name()->isNull()) { -#if defined(Q_WS_X11) || defined(Q_WS_QWS) - return QLatin1String("GL"); -#else // Q_WS_MAC +#ifdef Q_WS_MAC return QLatin1String("/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"); -#endif +#else +# if defined(QT_OPENGL_ES_1) + return QLatin1String("GLES_CM"); +# elif defined(QT_OPENGL_ES_2) + return QLatin1String("GLESv2"); +# else + return QLatin1String("GL"); +# endif +#endif // defined Q_WS_MAC } return *qt_gl_lib_name(); } diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 92a347b..7efa9bc 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -97,7 +97,6 @@ extern Q_GUI_EXPORT bool qt_win_owndc_required; QGLGraphicsSystem::QGLGraphicsSystem(bool useX11GL) : QGraphicsSystem(), m_useX11GL(useX11GL) { - QGLWindowSurface::surfaceFormat.setSampleBuffers(true); #if defined(Q_WS_X11) && !defined(QT_OPENGL_ES) // only override the system defaults if the user hasn't already // picked a visual diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index 1416ee3..76bc2b0 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -98,7 +98,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QSqlDriverFactoryInterface_iid, QLatin1String("/sqldrivers"))) @@ -576,7 +576,7 @@ QStringList QSqlDatabase::drivers() list << QLatin1String("QIBASE"); #endif -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (QFactoryLoader *fl = loader()) { QStringList keys = fl->keys(); for (QStringList::const_iterator i = keys.constBegin(); i != keys.constEnd(); ++i) { @@ -774,7 +774,7 @@ void QSqlDatabasePrivate::init(const QString &type) } } -#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) +#ifndef QT_NO_LIBRARY if (!driver && loader()) { if (QSqlDriverFactoryInterface *factory = qobject_cast<QSqlDriverFactoryInterface*>(loader()->instance(type))) driver = factory->create(type); diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index b6e771f..d545440 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3751,7 +3751,7 @@ bool QSvgHandler::characters(const QStringRef &str) QCss::Parser(css).parse(&sheet); m_selector->styleSheets.append(sheet); return true; - } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown) + } else if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown || m_nodes.isEmpty()) return true; if (m_nodes.top()->type() == QSvgNode::TEXT || m_nodes.top()->type() == QSvgNode::TEXTAREA) { |