diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 9 | ||||
-rw-r--r-- | src/gui/image/qpixmap.cpp | 4 | ||||
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qsoftkeymanager.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_s60.cpp | 13 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 6 | ||||
-rw-r--r-- | src/gui/s60framework/qs60mainappui.cpp | 12 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qfontengine_s60.cpp | 36 | ||||
-rw-r--r-- | src/gui/text/qfontengine_s60_p.h | 3 |
11 files changed, 48 insertions, 44 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index ed2d676..d7653e5 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -888,7 +888,14 @@ bool QDialog::s60AdjustedPosition() if (doS60Positioning) { // naive way to deduce screen orientation if (S60->screenHeightInPixels > S60->screenWidthInPixels) { - p.setY(S60->screenHeightInPixels-height()-qt_TSize2QSize(S60->buttonGroupContainer()->Size()).height()); + int cbaHeight; + const CEikButtonGroupContainer* bgContainer = S60->buttonGroupContainer(); + if (!bgContainer) { + cbaHeight = 0; + } else { + cbaHeight = qt_TSize2QSize(bgContainer->Size()).height(); + } + p.setY(S60->screenHeightInPixels-height()-cbaHeight); p.setX(0); } else { const int scrollbarWidth = style()->pixelMetric(QStyle::PM_ScrollBarExtent); diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 30eb788..0a208bb 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -357,7 +357,9 @@ QPixmap QPixmap::copy(const QRect &rect) const if (isNull()) return QPixmap(); - const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect; + QRect r(0, 0, width(), height()); + if (!rect.isEmpty()) + r = r.intersected(rect); QPixmapData *d = data->createCompatiblePixmapData(); d->copy(data.data(), r); diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index bcf9cfb..bf88a75 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -3064,6 +3064,8 @@ QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect &rect) cons { Q_Q(const QTreeView); QPixmap pixmap(rect.size()); + if (rect.size().isEmpty()) + return pixmap; pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels. QPainter painter(&pixmap); painter.fillRect(QRect(QPoint(0,0), rect.size()), q->palette().base()); diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 27f2644..aee4324 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -930,7 +930,7 @@ void QSymbianControl::PositionChanged() void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) { - if (m_ignoreFocusChanged) + if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop) return; // Popups never get focused, but still receive the FocusChanged when they are hidden. diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index 0e98f39..b09ab8f 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -211,7 +211,8 @@ bool QSoftKeyManager::event(QEvent *e) void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys) { // lets not update softkeys if s60 native dialog or menu is shown - if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) + if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) + || CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) return; CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer(); diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp index 6f4f398..c5840f1 100644 --- a/src/gui/painting/qpaintengine_s60.cpp +++ b/src/gui/painting/qpaintengine_s60.cpp @@ -47,18 +47,25 @@ QT_BEGIN_NAMESPACE class QS60PaintEnginePrivate : public QRasterPaintEnginePrivate { public: - QS60PaintEnginePrivate(QS60PaintEngine *engine) { Q_UNUSED(engine); } + QS60PaintEnginePrivate() {} }; QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data) - : QRasterPaintEngine(*(new QS60PaintEnginePrivate(this)), device), pixmapData(data) + : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), pixmapData(data) { } bool QS60PaintEngine::begin(QPaintDevice *device) { + Q_D(QS60PaintEngine); + pixmapData->beginDataAccess(); - return QRasterPaintEngine::begin(device); + bool ret = QRasterPaintEngine::begin(device); + // Make sure QPaintEngine::paintDevice() returns the proper device. + // QRasterPaintEngine changes pdev to QImage in case of RasterClass QPixmapData + // which is incorrect in Symbian. + d->pdev = device; + return ret; } bool QS60PaintEngine::end() diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 46fbaa9..27dbcf9 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -47,6 +47,10 @@ #include "private/qnativeimage_p.h" #include "private/qfontengine_ft_p.h" +#ifndef QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH +#define QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH 256 +#endif + QT_BEGIN_NAMESPACE // #define CACHE_DEBUG @@ -112,7 +116,7 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, rowHeight += margin * 2; if (isNull()) - createCache(256, rowHeight); + createCache(QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH, rowHeight); // now actually use the coords and paint the wanted glyps into cache. QHash<glyph_t, Coord>::iterator iter = listItemCoordinates.begin(); diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp index 4c4c994..4813fb2 100644 --- a/src/gui/s60framework/qs60mainappui.cpp +++ b/src/gui/s60framework/qs60mainappui.cpp @@ -104,10 +104,16 @@ void QS60MainAppUi::ConstructL() // ENoAppResourceFile and ENonStandardResourceFile makes UI to work without // resource files in most SDKs. S60 3rd FP1 public seems to require resource file // even these flags are defined - BaseConstructL(CAknAppUi::EAknEnableSkin); + TInt flags = CAknAppUi::EAknEnableSkin; + if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) { + flags |= CAknAppUi::ENoScreenFurniture | CAknAppUi::ENonStandardResourceFile; + } + BaseConstructL(flags); - CEikButtonGroupContainer* nativeContainer = Cba(); - nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) { + CEikButtonGroupContainer* nativeContainer = Cba(); + nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS); + } } /*! diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index bcc993a..d78ea21 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1363,7 +1363,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } } - int rightValue = widget ? widget->contentsRect().right() : 0; + int rightValue = widget ? widget->contentsRect().right() : voptAdj.rect.right(); if (isScrollBarVisible) rightValue -= scrollBarWidth; diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index e279ad2..7fad188 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -45,12 +45,11 @@ #include <private/qapplication_p.h> #include "qimage.h" #include "qt_s60_p.h" -#include "qpixmap_s60_p.h" #include <e32base.h> #include <e32std.h> -#include <EIKENV.H> -#include <GDI.H> +#include <eikenv.h> +#include <gdi.h> QT_BEGIN_NAMESPACE @@ -135,42 +134,21 @@ QFontEngineS60::QFontEngineS60(const QFontDef &request, const QFontEngineS60Exte { QFontEngine::fontDef = request; m_fontSizeInPixels = (request.pixelSize >= 0)? - request.pixelSize:pointsToPixels(request.pointSize); - - QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - - m_textRenderBitmap = q_check_ptr(new CFbsBitmap()); // CBase derived object needs check on new - const TSize bitmapSize(1, 1); // It is just a dummy bitmap that I need to keep the font alive (or maybe not) - qt_symbian_throwIfError(m_textRenderBitmap->Create(bitmapSize, EGray256)); - QT_TRAP_THROWING(m_textRenderBitmapDevice = CFbsBitmapDevice::NewL(m_textRenderBitmap)); - qt_symbian_throwIfError(m_textRenderBitmapDevice->CreateContext(m_textRenderBitmapGc)); - cache_cost = sizeof(QFontEngineS60) + bitmapSize.iHeight * bitmapSize.iWidth * 4; + request.pixelSize:pointsToPixels(request.pointSize); TFontSpec fontSpec(qt_QString2TPtrC(request.family), m_fontSizeInPixels); fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap); fontSpec.iFontStyle.SetPosture(request.style == QFont::StyleNormal?EPostureUpright:EPostureItalic); fontSpec.iFontStyle.SetStrokeWeight(request.weight > QFont::Normal?EStrokeWeightBold:EStrokeWeightNormal); - const TInt errorCode = m_textRenderBitmapDevice->GetNearestFontInPixels(m_font, fontSpec); + const TInt errorCode = S60->screenDevice()->GetNearestFontToDesignHeightInPixels(m_font, fontSpec); Q_ASSERT(errorCode == 0); - m_textRenderBitmapGc->UseFont(m_font); - - lock.relock(); + + cache_cost = sizeof(QFontEngineS60); } QFontEngineS60::~QFontEngineS60() { - QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); - - m_textRenderBitmapGc->DiscardFont(); - delete m_textRenderBitmapGc; - m_textRenderBitmapGc = NULL; - m_textRenderBitmapDevice->ReleaseFont(m_font); - delete m_textRenderBitmapDevice; - m_textRenderBitmapDevice = NULL; - delete m_textRenderBitmap; - m_textRenderBitmap = NULL; - - lock.relock(); + S60->screenDevice()->ReleaseFont(m_font); } bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const diff --git a/src/gui/text/qfontengine_s60_p.h b/src/gui/text/qfontengine_s60_p.h index 9e22245..b21f1c8 100644 --- a/src/gui/text/qfontengine_s60_p.h +++ b/src/gui/text/qfontengine_s60_p.h @@ -126,9 +126,6 @@ private: QFixed glyphAdvance(HB_Glyph glyph) const; - CFbsBitmap *m_textRenderBitmap; - CFbsBitmapDevice *m_textRenderBitmapDevice; - CFbsBitGc *m_textRenderBitmapGc; CFont* m_font; const QFontEngineS60Extensions *m_extensions; qreal m_fontSizeInPixels; |