summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-10 19:34:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-10 19:34:57 (GMT)
commite6e06e7ffc7a08368af79e1d2ed442e3c0df936c (patch)
tree731d8c8521a5f859a183fc9443fbf6c286b39389 /src/gui
parent497da277770ccf37e05a7b519afd5206601a7cf1 (diff)
parent9385f050620f14e3c3e4616906cf1999bf166041 (diff)
downloadQt-e6e06e7ffc7a08368af79e1d2ed442e3c0df936c.zip
Qt-e6e06e7ffc7a08368af79e1d2ed442e3c0df936c.tar.gz
Qt-e6e06e7ffc7a08368af79e1d2ed442e3c0df936c.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (42 commits) Replaced redundant "!contains" scopes in "contains(A, B) {...} !contains(A, B) {...}" constructions with "else" Updated leading whitespace to make indentation more consistent Updated project files so it is now possible to use "-system-zlib" configuration option on Windows and Symbian platforms. make postgresql support sensitive to PSQL_LIBS support for cross building Qt for MinGW (win32-g++) on Unix use "win32-g++*" scope to match all MinGW makespecs Demos: Fix compilation with namespace. actually fix namespaced compile Attempt to fix build failure on Linux introduced by 09c6a81109 minor cosmetic improvements designer: add sorting in signal-slot editor window deprecate header files in $$QT_BUILD_TREE/include/Qt syncqt: change tabs to spaces I10n: Update German translations for 4.7.0 Fix a freetype link failure. Fix configure test for DirectFB Split Symbian bearer plugin into three platform specfic plugins Doc: Fixed whitespace in the other configuration file for zh_CN. Doc: Fixed whitespace in the Simplified Chinese doc configuration. Unbreak Linux build when qendian.h is included before qglobal.h ...
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp9
-rw-r--r--src/gui/image/image.pri14
-rw-r--r--src/gui/image/qpixmap.cpp3
-rw-r--r--src/gui/image/qpixmap_x11.cpp6
-rw-r--r--src/gui/kernel/qapplication.cpp1
-rw-r--r--src/gui/kernel/qgesturemanager.cpp8
-rw-r--r--src/gui/kernel/qstandardgestures.cpp3
-rw-r--r--src/gui/kernel/qwidget.cpp2
-rw-r--r--src/gui/painting/painting.pri9
-rw-r--r--src/gui/styles/qcommonstyle.cpp4
-rw-r--r--src/gui/styles/qgtkstyle.cpp3
-rw-r--r--src/gui/text/qtextoption.cpp10
-rw-r--r--src/gui/text/qtextoption.h2
-rw-r--r--src/gui/text/text.pri2
14 files changed, 56 insertions, 20 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 7b0722e..6c5623e 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -6100,8 +6100,15 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
if (ev.isAccepted() || ev.isAccepted(g)) {
conflictedGestures.remove(g);
// mark the item as a gesture target
- if (item)
+ if (item) {
gestureTargets.insert(g, item.data());
+ QHash<QGraphicsObject *, QSet<QGesture *> >::iterator it, e;
+ it = cachedItemGestures.begin();
+ e = cachedItemGestures.end();
+ for(; it != e; ++it)
+ it.value().remove(g);
+ cachedItemGestures[item.data()].insert(g);
+ }
DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:"
<< "override was accepted:"
<< g << item.data();
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 8d75fdd..c4eac95 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -93,12 +93,12 @@ SOURCES += \
SOURCES += image/qpnghandler.cpp
contains(QT_CONFIG, system-png) {
- unix:LIBS_PRIVATE += -lpng
- win32:LIBS += libpng.lib
+ unix|win32-g++*:LIBS_PRIVATE += -lpng
+ win32:!win32-g++*:LIBS += libpng.lib
} else {
DEFINES *= QT_USE_BUNDLED_LIBPNG
!isEqual(QT_ARCH, i386):!isEqual(QT_ARCH, x86_64):DEFINES += PNG_NO_ASSEMBLER_CODE
- INCLUDEPATH += ../3rdparty/libpng ../3rdparty/zlib
+ INCLUDEPATH += ../3rdparty/libpng
SOURCES += ../3rdparty/libpng/png.c \
../3rdparty/libpng/pngerror.c \
../3rdparty/libpng/pngget.c \
@@ -114,6 +114,14 @@ SOURCES += \
../3rdparty/libpng/pngwrite.c \
../3rdparty/libpng/pngwtran.c \
../3rdparty/libpng/pngwutil.c
+
+ contains(QT_CONFIG, system-zlib) {
+ symbian:LIBS_PRIVATE += -llibz
+ else:if(unix|win32-g++*):LIBS_PRIVATE += -lz
+ else:LIBS += zdll.lib
+ } else {
+ INCLUDEPATH += ../3rdparty/zlib
+ }
}
} else {
DEFINES *= QT_NO_IMAGEFORMAT_PNG
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 20e4b50..fd2c139 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -1766,6 +1766,9 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode)
function returns the actual matrix used for transforming the
pixmap.
+ \note When using the native X11 graphics system, the pixmap
+ becomes invalid when the QApplication instance is destroyed.
+
\sa QBitmap, QImage, QImageReader, QImageWriter
*/
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 6bebefc..e8dc5ae 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1250,10 +1250,8 @@ void QX11PixmapData::release()
pengine = 0;
if (!X11) {
-#ifndef QT_NO_DEBUG
- qWarning("~QX11PixmapData(): QPixmap objects must be destroyed before the QApplication"
- " object, otherwise the native pixmap object will be leaked.");
-#endif
+ // At this point, the X server will already have freed our resources,
+ // so there is nothing to do.
return;
}
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index c9a3e8b..438a17e 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -5313,6 +5313,7 @@ void QApplication::setInputContext(QInputContext *inputContext)
}
delete QApplicationPrivate::inputContext;
QApplicationPrivate::inputContext = inputContext;
+ QApplicationPrivate::inputContext->setParent(this);
}
/*!
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 2af031b..e43a560 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -286,6 +286,9 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
// check if a running gesture switched back to maybe state
QSet<QGesture *> activeToMaybeGestures = m_activeGestures & newMaybeGestures;
+ // check if a maybe gesture switched to canceled - reset it but don't send an event
+ QSet<QGesture *> maybeToCanceledGestures = m_maybeGestures & notGestures;
+
// check if a running gesture switched back to not gesture state,
// i.e. were canceled
QSet<QGesture *> canceledGestures = m_activeGestures & notGestures;
@@ -345,7 +348,8 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
<< "\n\tstarted:" << startedGestures
<< "\n\ttriggered:" << triggeredGestures
<< "\n\tfinished:" << finishedGestures
- << "\n\tcanceled:" << canceledGestures;
+ << "\n\tcanceled:" << canceledGestures
+ << "\n\tmaybe-canceled:" << maybeToCanceledGestures;
}
QSet<QGesture *> undeliveredGestures;
@@ -366,7 +370,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
// reset gestures that ended
QSet<QGesture *> endedGestures =
- finishedGestures + canceledGestures + undeliveredGestures;
+ finishedGestures + canceledGestures + undeliveredGestures + maybeToCanceledGestures;
foreach (QGesture *gesture, endedGestures) {
recycle(gesture);
m_gestureTargets.remove(gesture);
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 6960838..8a3e89e 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -112,6 +112,7 @@ QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state,
p1.pos().y() - p1.startPos().y() + p2.pos().y() - p2.startPos().y()) / 2;
if (d->offset.x() > 10 || d->offset.y() > 10 ||
d->offset.x() < -10 || d->offset.y() < -10) {
+ q->setHotSpot(p1.startScreenPos());
result = QGestureRecognizer::TriggerGesture;
} else {
result = QGestureRecognizer::MayBeGesture;
@@ -441,6 +442,7 @@ QGestureRecognizer::Result QTapGestureRecognizer::recognize(QGesture *state,
switch (event->type()) {
case QEvent::TouchBegin: {
d->position = ev->touchPoints().at(0).pos();
+ q->setHotSpot(ev->touchPoints().at(0).screenPos());
result = QGestureRecognizer::TriggerGesture;
break;
}
@@ -523,6 +525,7 @@ QTapAndHoldGestureRecognizer::recognize(QGesture *state, QObject *object,
if (d->timerId)
q->killTimer(d->timerId);
d->timerId = q->startTimer(TimerInterval);
+ q->setHotSpot(ev->touchPoints().at(0).startScreenPos());
result = QGestureRecognizer::TriggerGesture;
break;
case QEvent::TouchEnd:
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 895c85d..cd623db 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -379,6 +379,8 @@ void QWidget::setInputContext(QInputContext *context)
if (d->ic)
delete d->ic;
d->ic = context;
+ if (d->ic)
+ d->ic->setParent(this);
#endif
}
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index 123af1c..a5cfb84 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -234,7 +234,7 @@ contains(QMAKE_MAC_XARCH, no) {
IWMMXT_SOURCES += painting/qdrawhelper_iwmmxt.cpp
}
- win32-g++|!win32:!*-icc* {
+ win32-g++*|!win32:!*-icc* {
mmx {
mmx_compiler.commands = $$QMAKE_CXX -c -Winline
@@ -403,9 +403,10 @@ neon:*-g++* {
}
contains(QT_CONFIG, zlib) {
- INCLUDEPATH += ../3rdparty/zlib
+ INCLUDEPATH += ../3rdparty/zlib
} else:!contains(QT_CONFIG, no-zlib) {
- unix:LIBS_PRIVATE += -lz
-# win32:LIBS += libz.lib
+ symbian:LIBS_PRIVATE += -llibz
+ else:if(unix|win32-g++*):LIBS_PRIVATE += -lz
+ else:LIBS += zdll.lib
}
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 4978565..039a6da 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -762,7 +762,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
#ifndef QT_NO_ITEMVIEWS
case PE_PanelItemViewRow:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
- QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled
+ QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled))
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
cg = QPalette::Inactive;
@@ -775,7 +775,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
break;
case PE_PanelItemViewItem:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
- QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled
+ QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled))
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
cg = QPalette::Inactive;
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index b59a033..c989bd3 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -855,9 +855,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
key = QLS("a");
GTK_WIDGET_SET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);
}
+ bool isEnabled = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled));
gtkPainter.paintFlatBox(gtkTreeView, detail, option->rect,
option->state & State_Selected ? GTK_STATE_SELECTED :
- option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
+ isEnabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
GTK_SHADOW_OUT, gtkTreeView->style, key);
if (isActive )
GTK_WIDGET_UNSET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index c1e254c..527b603 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -145,7 +145,7 @@ QTextOption &QTextOption::operator=(const QTextOption &o)
\sa tabArray(), setTabStop(), setTabs()
*/
-void QTextOption::setTabArray(QList<qreal> tabStops)
+void QTextOption::setTabArray(QList<qreal> tabStops) // Qt5: const ref
{
if (!d)
d = new QTextOptionPrivate;
@@ -165,7 +165,7 @@ void QTextOption::setTabArray(QList<qreal> tabStops)
\sa tabStops()
*/
-void QTextOption::setTabs(QList<QTextOption::Tab> tabStops)
+void QTextOption::setTabs(QList<QTextOption::Tab> tabStops) // Qt5: const ref
{
if (!d)
d = new QTextOptionPrivate;
@@ -391,6 +391,12 @@ QList<QTextOption::Tab> QTextOption::tabs() const
*/
/*!
+ \fn Tab::Tab(qreal pos, TabType tabType, QChar delim = QChar())
+ Creates a tab with the given position, tab type, and (for DelimiterTab) delimiter
+ \since 4.7
+*/
+
+/*!
\fn bool Tab::operator==(const Tab &other) const
Returns true if tab \a other is equal to this tab;
diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h
index 1381ed1..5af7834 100644
--- a/src/gui/text/qtextoption.h
+++ b/src/gui/text/qtextoption.h
@@ -68,6 +68,8 @@ public:
struct Q_GUI_EXPORT Tab {
inline Tab() : position(80), type(QTextOption::LeftTab) { }
+ inline Tab(qreal pos, TabType tabType, QChar delim = QChar())
+ : position(pos), type(tabType), delimiter(delim) {}
inline bool operator==(const Tab &other) const {
return type == other.type
diff --git a/src/gui/text/text.pri b/src/gui/text/text.pri
index d5a9c74..34311a9 100644
--- a/src/gui/text/text.pri
+++ b/src/gui/text/text.pri
@@ -139,7 +139,7 @@ contains(QT_CONFIG, freetype) {
../3rdparty/freetype/src/base/ftmm.c \
../3rdparty/freetype/src/base/fttype1.c \
../3rdparty/freetype/src/base/ftsynth.c \
- ../3rdparty/freetype/src/base/ftbitmap.c\
+ ../3rdparty/freetype/src/base/ftbitmap.c \
../3rdparty/freetype/src/bdf/bdf.c \
../3rdparty/freetype/src/cache/ftcache.c \
../3rdparty/freetype/src/cff/cff.c \