summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/itemviews/qtableview.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp5
-rw-r--r--src/gui/kernel/qwidget_x11.cpp7
-rw-r--r--src/gui/widgets/qtabbar.cpp4
-rw-r--r--src/gui/widgets/qtabbar_p.h3
-rw-r--r--src/gui/widgets/qtoolbararealayout_p.h2
-rw-r--r--src/openvg/qpaintengine_vg.cpp28
-rw-r--r--src/openvg/qpaintengine_vg_p.h2
-rw-r--r--src/openvg/qwindowsurface_vg.cpp14
10 files changed, 58 insertions, 11 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 3f6dff2..710048e 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1240,7 +1240,7 @@ void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, con
const QTransform reverseMap = worldTransform.inverted();
const QVector<QRect> exposedRects(exposedRegion.rects());
for (int i = 0; i < exposedRects.size(); ++i) {
- option->exposedRect |= reverseMap.mapRect(exposedRects.at(i));
+ option->exposedRect |= reverseMap.mapRect(QRectF(exposedRects.at(i)));
if (option->exposedRect.contains(brect))
break;
}
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index a3877b7..d27e693 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -114,7 +114,7 @@ void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)
}
} else if (old_height > span->height()) {
//remove the span from all the subspans lists that intersect the columns not covered anymore
- Index::iterator it_y = index.lowerBound(-span->bottom());
+ Index::iterator it_y = index.lowerBound(qMin(-span->bottom(), 0));
Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list
while (-it_y.key() <= span->top() + old_height -1) {
if (-it_y.key() > span->bottom()) {
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 709f6f3..fbb9115 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -8248,7 +8248,8 @@ bool QWidget::event(QEvent *event)
QList<QObject*> childList = d->children;
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
- QApplication::sendEvent(o, event);
+ if (o)
+ QApplication::sendEvent(o, event);
}
}
update();
@@ -8277,7 +8278,7 @@ bool QWidget::event(QEvent *event)
QList<QObject*> childList = d->children;
for (int i = 0; i < childList.size(); ++i) {
QObject *o = childList.at(i);
- if (o != QApplication::activeModalWidget()) {
+ if (o && o != QApplication::activeModalWidget()) {
if (qobject_cast<QWidget *>(o) && static_cast<QWidget *>(o)->isWindow()) {
// do not forward the event to child windows,
// QApplication does this for us
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 7461637..0bc9cbc 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -527,8 +527,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
xinfo.setX11Data(xd);
} else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
- || parentXinfo->visual() != xinfo.visual()))
+ || (parentXinfo->visual() != xinfo.visual()
+ && !q->inherits("QGLWidget"))))
{
+ // QGLWidgets have to be excluded here as they have a
+ // specially crafted QX11Info structure which can't be swapped
+ // out with the parent widgets QX11Info. The parent visual,
+ // for instance, might not even be GL capable.
xinfo = *parentXinfo;
}
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index 3935c55..8ef6017 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1948,7 +1948,8 @@ void QTabBar::changeEvent(QEvent *event)
Q_D(QTabBar);
if (event->type() == QEvent::StyleChange) {
d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this));
- d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
+ if (!d->useScrollButtonsSetByUser)
+ d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
d->refresh();
} else if (event->type() == QEvent::FontChange) {
d->refresh();
@@ -2003,6 +2004,7 @@ bool QTabBar::usesScrollButtons() const
void QTabBar::setUsesScrollButtons(bool useButtons)
{
Q_D(QTabBar);
+ d->useScrollButtonsSetByUser = true;
if (d->useScrollButtons == useButtons)
return;
d->useScrollButtons = useButtons;
diff --git a/src/gui/widgets/qtabbar_p.h b/src/gui/widgets/qtabbar_p.h
index 9f3285b..2e8fb6d 100644
--- a/src/gui/widgets/qtabbar_p.h
+++ b/src/gui/widgets/qtabbar_p.h
@@ -75,7 +75,7 @@ class QTabBarPrivate : public QWidgetPrivate
public:
QTabBarPrivate()
:currentIndex(-1), pressedIndex(-1), shape(QTabBar::RoundedNorth), layoutDirty(false),
- drawBase(true), scrollOffset(0), expanding(true), closeButtonOnTabs(false),
+ drawBase(true), scrollOffset(0), useScrollButtonsSetByUser(false) , expanding(true), closeButtonOnTabs(false),
selectionBehaviorOnRemove(QTabBar::SelectRightTab), paintWithOffsets(true), movable(false),
dragInProgress(false), documentMode(false), movingTab(0)
#ifdef Q_WS_MAC
@@ -187,6 +187,7 @@ public:
QSize iconSize;
Qt::TextElideMode elideMode;
bool useScrollButtons;
+ bool useScrollButtonsSetByUser;
bool expanding;
bool closeButtonOnTabs;
diff --git a/src/gui/widgets/qtoolbararealayout_p.h b/src/gui/widgets/qtoolbararealayout_p.h
index f0ab80c..134e95a 100644
--- a/src/gui/widgets/qtoolbararealayout_p.h
+++ b/src/gui/widgets/qtoolbararealayout_p.h
@@ -118,7 +118,7 @@ public:
void extendSize(Qt::Orientation o, int extent)
{
- int newSize = qMax(pick(o, minimumSize()), (preferredSize > 0 ? preferredSize : size) + extent);
+ int newSize = qMax(pick(o, minimumSize()), (preferredSize > 0 ? preferredSize : pick(o, sizeHint())) + extent);
int sizeh = pick(o, sizeHint());
if (newSize == sizeh) {
preferredSize = -1;
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 75b7fa5..fda4b10 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3407,6 +3407,34 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty)
#endif
}
+void QVGPaintEngine::fillRegion
+ (const QRegion& region, const QColor& color, const QSize& surfaceSize)
+{
+ Q_D(QVGPaintEngine);
+ if (d->clearColor != color || d->clearOpacity != 1.0f) {
+ VGfloat values[4];
+ values[0] = color.redF();
+ values[1] = color.greenF();
+ values[2] = color.blueF();
+ values[3] = color.alphaF();
+ vgSetfv(VG_CLEAR_COLOR, 4, values);
+ d->clearColor = color;
+ d->clearOpacity = 1.0f;
+ }
+ if (region.rectCount() == 1) {
+ QRect r = region.boundingRect();
+ vgClear(r.x(), surfaceSize.height() - r.y() - r.height(),
+ r.width(), r.height());
+ } else {
+ const QVector<QRect> rects = region.rects();
+ for (int i = 0; i < rects.size(); ++i) {
+ QRect r = rects.at(i);
+ vgClear(r.x(), surfaceSize.height() - r.y() - r.height(),
+ r.width(), r.height());
+ }
+ }
+}
+
#if !defined(QVG_NO_SINGLE_CONTEXT) && !defined(QT_NO_EGL)
QVGCompositionHelper::QVGCompositionHelper()
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 1202b55..86a522a 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -151,6 +151,8 @@ public:
QVGPaintEnginePrivate *vgPrivate() { Q_D(QVGPaintEngine); return d; }
+ void fillRegion(const QRegion& region, const QColor& color, const QSize& surfaceSize);
+
protected:
QVGPaintEngine(QVGPaintEnginePrivate &data);
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index f8486a6..a1301e3 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -48,6 +48,7 @@
#if !defined(QT_NO_EGL)
#include <QtGui/private/qegl_p.h>
+#include <QtGui/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -71,7 +72,6 @@ QVGWindowSurface::~QVGWindowSurface()
QPaintDevice *QVGWindowSurface::paintDevice()
{
- d_ptr->beginPaint(window());
return this;
}
@@ -94,8 +94,16 @@ bool QVGWindowSurface::scroll(const QRegion &area, int dx, int dy)
void QVGWindowSurface::beginPaint(const QRegion &region)
{
- // Nothing to do here.
- Q_UNUSED(region);
+ d_ptr->beginPaint(window());
+
+ // If the window is not opaque, then fill the region we are about
+ // to paint with the transparent color.
+ if (!qt_widget_private(window())->isOpaque &&
+ window()->testAttribute(Qt::WA_TranslucentBackground)) {
+ QVGPaintEngine *engine = static_cast<QVGPaintEngine *>
+ (d_ptr->paintEngine());
+ engine->fillRegion(region, Qt::transparent, d_ptr->surfaceSize());
+ }
}
void QVGWindowSurface::endPaint(const QRegion &region)