summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
committerBill King <bill.king@nokia.com>2009-08-05 03:45:19 (GMT)
commitbd51c3010e78925a2074122b281de53f01be9ef9 (patch)
tree23ac1bb378caebd0072b54fd191932ac65ac1b35
parenta4ede01350b506c9908241f0b9002f560cc0949f (diff)
parent7e8e53cded4622ac35ff115e26e074de6722d1a0 (diff)
downloadQt-bd51c3010e78925a2074122b281de53f01be9ef9.zip
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.gz
Qt-bd51c3010e78925a2074122b281de53f01be9ef9.tar.bz2
Merge branch '4.5'
Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
-rw-r--r--doc/src/qsqldatatype-table.qdoc2
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.h1
-rw-r--r--examples/itemviews/frozencolumn/main.cpp1
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp25
-rw-r--r--src/gui/painting/qoutlinemapper.cpp2
-rw-r--r--src/gui/painting/qtransform.cpp1
-rw-r--r--src/gui/styles/gtksymbols.cpp19
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp16
-rw-r--r--tests/auto/qsqldatabase/tst_databases.h12
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp10
11 files changed, 71 insertions, 19 deletions
diff --git a/doc/src/qsqldatatype-table.qdoc b/doc/src/qsqldatatype-table.qdoc
index 2055e6a..bc88c30 100644
--- a/doc/src/qsqldatatype-table.qdoc
+++ b/doc/src/qsqldatatype-table.qdoc
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
diff --git a/examples/itemviews/frozencolumn/freezetablewidget.h b/examples/itemviews/frozencolumn/freezetablewidget.h
index e22660e..f7b8e43 100644
--- a/examples/itemviews/frozencolumn/freezetablewidget.h
+++ b/examples/itemviews/frozencolumn/freezetablewidget.h
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
#ifndef FREEZETABLEWIDGET_H
#define FREEZETABLEWIDGET_H
diff --git a/examples/itemviews/frozencolumn/main.cpp b/examples/itemviews/frozencolumn/main.cpp
index 8ed9d3b..9f6a637 100644
--- a/examples/itemviews/frozencolumn/main.cpp
+++ b/examples/itemviews/frozencolumn/main.cpp
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
#include <QApplication>
#include <QStandardItemModel>
#include <QFile>
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 7610631..2bbe560 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -263,6 +263,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
(void) new (&timerSource->timerList) QTimerInfoList();
timerSource->processEventsFlags = QEventLoop::AllEvents;
g_source_set_can_recurse(&timerSource->source, true);
+ g_source_set_priority(&timerSource->source, G_PRIORITY_DEFAULT_IDLE);
g_source_attach(&timerSource->source, mainContext);
}
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 6a21e99..beaf42b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -675,19 +675,22 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch
return;
}
- // Inherit the enabled-state from our parents.
- if ((parent && ((parent->d_ptr->ancestorFlags & flag)
- || (int(parent->d_ptr->flags & childFlag) == childFlag)
+ if (parent) {
+ // Inherit the enabled-state from our parents.
+ if ((parent->d_ptr->ancestorFlags & flag)
+ || (int(parent->d_ptr->flags & childFlag) == childFlag)
|| (childFlag == -1 && parent->d_ptr->handlesChildEvents)
- || (childFlag == -2 && parent->d_ptr->filtersDescendantEvents)))) {
- enabled = true;
- ancestorFlags |= flag;
- }
-
- // Top-level root items don't have any ancestors, so there are no
- // ancestor flags either.
- if (!parent)
+ || (childFlag == -2 && parent->d_ptr->filtersDescendantEvents)) {
+ enabled = true;
+ ancestorFlags |= flag;
+ } else {
+ ancestorFlags &= ~flag;
+ }
+ } else {
+ // Top-level root items don't have any ancestors, so there are no
+ // ancestor flags either.
ancestorFlags = 0;
+ }
} else {
// Don't set or propagate the ancestor flag if it's already correct.
if (((ancestorFlags & flag) && enabled) || (!(ancestorFlags & flag) && !enabled))
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index 70125b9..1287672 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -201,6 +201,8 @@ void QOutlineMapper::endOutline()
const QVectorPath vp((qreal *)m_elements.data(), m_elements.size(), m_element_types.data());
QPainterPath path = vp.convertToPainterPath();
path = QTransform(m_m11, m_m12, m_m13, m_m21, m_m22, m_m23, m_dx, m_dy, m_m33).map(path);
+ if (!(m_outline.flags & QT_FT_OUTLINE_EVEN_ODD_FILL))
+ path.setFillRule(Qt::WindingFill);
uint old_txop = m_txop;
m_txop = QTransform::TxNone;
if (path.isEmpty())
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 0a64e4e..a13b494 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1541,6 +1541,7 @@ static QPainterPath mapProjective(const QTransform &transform, const QPainterPat
if (path.elementCount() > 0 && lastMoveTo != last)
lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false);
+ result.setFillRule(path.fillRule());
return result;
}
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index c2c7876..f947ac1 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -752,7 +752,24 @@ static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent,
QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name.isEmpty() ? extensions.join(QLS(", ")) : name));
foreach (const QString &fileExtension, extensions) {
- QGtk::gtk_file_filter_add_pattern (gtkFilter, qPrintable(fileExtension));
+ // Note Gtk file dialogs are by default case sensitive
+ // and only supports basic glob syntax so we
+ // rewrite .xyz to .[xX][yY][zZ]
+ QString caseInsensitive;
+ for (int i = 0 ; i < fileExtension.length() ; ++i) {
+ QChar ch = fileExtension.at(i);
+ if (ch.isLetter()) {
+ caseInsensitive.append(
+ QLatin1Char('[') +
+ ch.toLower() +
+ ch.toUpper() +
+ QLatin1Char(']'));
+ } else {
+ caseInsensitive.append(ch);
+ }
+ }
+ QGtk::gtk_file_filter_add_pattern (gtkFilter, qPrintable(caseInsensitive));
+
}
if (filterMap)
filterMap->insert(gtkFilter, rawfilter);
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index ef3f0f8..789bb27 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -761,6 +761,22 @@ void tst_QGraphicsItem::flags()
QApplication::sendEvent(&scene, &event5);
QCOMPARE(item->pos(), QPointF(10, 10));
}
+ {
+ QGraphicsItem* clippingParent = new QGraphicsRectItem;
+ clippingParent->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
+
+ QGraphicsItem* nonClippingParent = new QGraphicsRectItem;
+ nonClippingParent->setFlag(QGraphicsItem::ItemClipsChildrenToShape, false);
+
+ QGraphicsItem* child = new QGraphicsRectItem(nonClippingParent);
+ QVERIFY(!child->isClipped());
+
+ child->setParentItem(clippingParent);
+ QVERIFY(child->isClipped());
+
+ child->setParentItem(nonClippingParent);
+ QVERIFY(!child->isClipped());
+ }
}
class ImhTester : public QGraphicsItem
diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h
index 8253541..f1e9d28 100644
--- a/tests/auto/qsqldatabase/tst_databases.h
+++ b/tests/auto/qsqldatabase/tst_databases.h
@@ -219,7 +219,7 @@ public:
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3307 );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "iceblink.nokia.troll.no" ); // MySQL 5.0.13 Windows
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql4-nokia.trolltech.com.au" ); // MySQL 4.1.22-2.el4 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql5-nokia.trolltech.com.au" ); // MySQL 5.0.45-7.el5 linux
@@ -518,6 +518,16 @@ public:
return QString();
}
+ static QString getPSQLVersion( const QSqlDatabase &db )
+ {
+ QSqlQuery q(db);
+ q.exec( "select version()" );
+ if(q.next())
+ return q.value( 0 ).toString();
+ else
+ return QString();
+ }
+
QStringList dbNames;
int counter;
};
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index 4cf8d56..fe4c86e 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -1054,6 +1054,7 @@ void tst_QSqlDatabase::recordMySQL()
int major = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt();
int minor = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 1, 1 ).toInt();
int revision = tst_Databases::getMySqlVersion( db ).section( QChar('.'), 2, 2 ).toInt();
+ int vernum = (major << 16) + (minor << 8) + revision;
#ifdef QT3_SUPPORT
/* The below is broken in mysql below 5.0.15
@@ -1061,7 +1062,7 @@ void tst_QSqlDatabase::recordMySQL()
specifically: Before MySQL 5.0.15, the pad value is space. Values are right-padded
with space on insert, and trailing spaces are removed on select.
*/
- if ( major >5 || ( major == 5 && minor > 0) || ( major == 5 && minor == 0 && revision >= 15) ) {
+ if( vernum >= ((5 << 16) + 15) ) {
bin10 = FieldDef("binary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abc ")));
varbin10 = FieldDef("varbinary(10)", QVariant::ByteArray, QByteArray(Q3CString("123abcv ")));
}
@@ -1591,6 +1592,11 @@ void tst_QSqlDatabase::bug_249059()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
+ QString version=tst_Databases::getPSQLVersion( db );
+ double ver=version.section(QChar::fromLatin1('.'),0,1).toDouble();
+ if (ver < 7.3)
+ QSKIP("Test requires PostgreSQL >= 7.3", SkipSingle);
+
QSqlQuery q(db);
QString tableName = qTableName("bug_249059");
QVERIFY_SQL(q, exec(QString("CREATE TABLE %1 (dt timestamp, t time)").arg(tableName)));
@@ -2025,8 +2031,6 @@ void tst_QSqlDatabase::mysql_multiselect()
CHECK_DATABASE(db);
QSqlQuery q(db);
- QVERIFY_SQL(q, exec("select version()"));
- QVERIFY_SQL(q, next());
QString version=tst_Databases::getMySqlVersion( db );
double ver=version.section(QChar::fromLatin1('.'),0,1).toDouble();
if (ver < 4.1)