diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 25 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_p.h | 2 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_wince.cpp | 24 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadersource_p.h | 11 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp | 3 | ||||
-rw-r--r-- | src/plugins/sqldrivers/sqlite/sqlite.pro | 2 |
6 files changed, 40 insertions, 27 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 028ec48..d05c7e4 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -70,13 +70,13 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget) // We create empty CFbsBitmap here -> it will be resized in setGeometry CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) ); - + QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType); if (data) { data->fromSymbianBitmap(bitmap, true); d_ptr->device = QPixmap(data); } - + setStaticContentsSupport(true); } QS60WindowSurface::~QS60WindowSurface() @@ -89,24 +89,15 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn) if (!qt_widget_private(window())->isOpaque) { QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data()); pixmapData->beginDataAccess(); - QImage &image = pixmapData->image; - QRgb *data = reinterpret_cast<QRgb *>(image.bits()); - const int row_stride = image.bytesPerLine() / 4; + QPainter p(&pixmapData->image); + p.setCompositionMode(QPainter::CompositionMode_Source); const QVector<QRect> rects = rgn.rects(); + const QColor blank = Qt::transparent; for (QVector<QRect>::const_iterator it = rects.begin(); it != rects.end(); ++it) { - const int x_start = it->x(); - const int width = it->width(); - - const int y_start = it->y(); - const int height = it->height(); - - QRgb *row = data + row_stride * y_start; - for (int y = 0; y < height; ++y) { - qt_memfill(row + x_start, 0U, width); - row += row_stride; - } + p.fillRect(*it, blank); } + pixmapData->endDataAccess(); } } @@ -128,7 +119,7 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget) const QPoint off = offset(widget); QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image); - + QRect rect(off, widget->size()); rect &= QRect(QPoint(), img->size()); diff --git a/src/gui/widgets/qmenu_p.h b/src/gui/widgets/qmenu_p.h index aaed6b1..495872c 100644 --- a/src/gui/widgets/qmenu_p.h +++ b/src/gui/widgets/qmenu_p.h @@ -347,7 +347,7 @@ public: void syncAction(QWceMenuAction *); inline void syncAction(QAction *a) { syncAction(findAction(a)); } void removeAction(QWceMenuAction *); - void rebuild(bool reCreate = false); + void rebuild(); inline void removeAction(QAction *a) { removeAction(findAction(a)); } inline QWceMenuAction *findAction(QAction *a) { for(int i = 0; i < actionItems.size(); i++) { diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index edef466..1577f0a 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -253,6 +253,12 @@ static void qt_wce_insert_action(HMENU menu, QWceMenuAction *action, bool create } } +// Removes all items from the menu without destroying the handles. +static void qt_wce_clear_menu(HMENU hMenu) +{ + while (RemoveMenu(hMenu, 0, MF_BYPOSITION)); +} + /*! \internal @@ -403,7 +409,8 @@ QMenuPrivate::QWceMenuPrivate::QWceMenuPrivate() { QMenuPrivate::QWceMenuPrivate::~QWceMenuPrivate() { qt_wce_delete_action_list(&actionItems); - menuHandle = 0; + if (menuHandle) + DestroyMenu(menuHandle); } void QMenuPrivate::QWceMenuPrivate::addAction(QAction *a, QWceMenuAction *before) { @@ -438,14 +445,17 @@ HMENU QMenuPrivate::wceMenu(bool create) { if (!wce_menu) wce_menu = new QWceMenuPrivate; if (!wce_menu->menuHandle || create) - wce_menu->rebuild(create); + wce_menu->rebuild(); return wce_menu->menuHandle; } -void QMenuPrivate::QWceMenuPrivate::rebuild(bool reCreate) { - if (menuHandle && !reCreate) - DestroyMenu(menuHandle); - menuHandle = CreatePopupMenu(); +void QMenuPrivate::QWceMenuPrivate::rebuild() +{ + if (!menuHandle) + menuHandle = CreatePopupMenu(); + else + qt_wce_clear_menu(menuHandle); + for (int i = 0; i < actionItems.size(); ++i) { QWceMenuAction *action = actionItems.at(i); action->menuHandle = menuHandle; @@ -521,6 +531,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { resourceHandle = IDR_MAIN_MENU5; } Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), resourceHandle); Q_ASSERT_X(menubarHandle, "rebuild classic menu", "cannot create menubar from resource"); @@ -562,6 +573,7 @@ void QMenuBarPrivate::QWceMenuBarPrivate::rebuild() { leftButtonIsMenu = (leftButtonAction && leftButtonAction->menu()); Q_ASSERT_X(menubarHandle, "rebuild !created", "menubar already deleted"); + qt_wce_clear_menu(menuHandle); DestroyWindow(menubarHandle); if (leftButtonIsMenu) { menubarHandle = qt_wce_create_menubar(parentWindowHandle, qt_wce_get_module_handle(), IDR_MAIN_MENU2); diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index ee04166..c88c041 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -331,9 +331,14 @@ static const char* const qglslImageSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ uniform lowp sampler2D imageTexture; \n\ lowp vec4 srcPixel() \n\ - { \n\ - return texture2D(imageTexture, textureCoords); \n\ - }\n"; + { \n" +#ifdef QT_OPENGL_ES_2 + // work-around for driver bug + "return 1.0 * texture2D(imageTexture, textureCoords); \n" +#else + "return texture2D(imageTexture, textureCoords); \n" +#endif + "}\n"; static const char* const qglslCustomSrcFragmentShader = "\n\ varying highp vec2 textureCoords; \n\ diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp index e78fec1..f5ad70c 100644 --- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp +++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp @@ -2163,6 +2163,9 @@ bool QVNCScreen::connect(const QString &displaySpec) if (QScreenDriverFactory::keys().contains(driver, Qt::CaseInsensitive)) { const int id = getDisplayId(dspec); QScreen *s = qt_get_screen(id, dspec.toLatin1().constData()); + if (s->pixelFormat() == QImage::Format_Indexed8 + || s->pixelFormat() == QImage::Format_Invalid && s->depth() == 8) + qFatal("QVNCScreen: unsupported screen format"); setScreen(s); } else { // create virtual screen #if Q_BYTE_ORDER == Q_BIG_ENDIAN diff --git a/src/plugins/sqldrivers/sqlite/sqlite.pro b/src/plugins/sqldrivers/sqlite/sqlite.pro index c609a9e..fb31233 100644 --- a/src/plugins/sqldrivers/sqlite/sqlite.pro +++ b/src/plugins/sqldrivers/sqlite/sqlite.pro @@ -14,4 +14,6 @@ SOURCES = smain.cpp \ QMAKE_CXXFLAGS *= $$QT_CFLAGS_SQLITE } +wince*: DEFINES += HAVE_LOCALTIME_S=0 + include(../qsqldriverbase.pri) |