Commit Graph

2772 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
e640ebacb9 Fix regression in QTextDocument::toHtml() with font pixel size
Introduced by 2e0003eda4. We were
missing a attributesEmitted=true which caused the output from
toHtml() to sometimes be invalid when using pixel sizes to
specify the font size.

Task-number: QTBUG-25778
Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
2012-09-12 16:05:12 +02:00
Caroline Chao
b88534c2d4 Test: Update QSKIP for tst_QGLThread on Mac
Task-number: QTBUG-22361
Change-Id: I6182a37dc38294011fd3b3934317f22c7297a4ca
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 11:01:25 +02:00
Caroline Chao
5704cbc462 Test: remove QSKIP from printsupport tests
Exclude printsupport tests from the build when QT_NO_PRINTER is
defined.

Change-Id: Iedae91666a599f4b77250abc8aac14c256fde34e
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-12 10:14:10 +02:00
Eskil Abrahamsen Blomfeldt
97b4c5a574 Stabilize qprinter test
The CreationDate entry in the two PDF files can potentially
be different depending on when the test is run. We ignore the
line for this entry when comparing the two results.

Task-number: QTBUG-27171
Change-Id: I8978678295217edd537edb0d2c25260813aa3d93
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-09-12 10:14:10 +02:00
João Abecasis
975ebdc4ab Don't manipulate immutable data
QArrayData can point to data it does not own (cf. fromRawData()), which
shouldn't be modified. Not even upon destruction, as this data can live
in Read-Only memory or be otherwise shared outside the QArrayData realm.

Change-Id: I8bdf3050a17802fb003b77d5f543fe31769a7710
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
2012-09-11 23:54:57 +02:00
Friedemann Kleint
f957370206 Close popups when switching applications on Windows.
Bring back code from 4.8 (Note that ALT-TAB is not received
as key event).

Task-number: QTBUG-27146
Change-Id: I6dd2e9c88fdc4c89d26dfaa8ab47deb2be451f25
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-09-11 12:09:47 +02:00
Pekka Vuorela
e06999bd62 Remove deprecated inputItem and inputWindow from QInputMethod
Interfaces introduced and deprecated during Qt5 development.

Change-Id: I804a02df8c4a03ed6558f4a86375f97d09513d5c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Eskil Abrahamsen Blomfeldt
014ae2ad04 Avoid duplicate setPen() in PDF when reusing QPrinter
The simplePen property was not reset when reusing the QPrinter,
thus we would output two identical setPen() commands in the PDF
making the autotest that compares the results fail.

Task-number: QTBUG-27171
Change-Id: I601042ec59e45ef72a56f230f6112a91a259b4a5
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Oswald Buddenhagen
0e78e50802 port qmake to qt creator's qmake language evaluator
this is a monster commit which does the following things:
- import the evaluator as-is from qt creator into qmake/library/
  - integrate it into qmake's makefiles
  - overwrite proitems.h with actual special types
- remove the parts of Option which are redundant with QMakeGlobals
- make QMakeProperty a singleton owned by Option::globals. the dynamic
  handling so far made no sense.
- make QMakeProject a subclass of QMakeEvaluator, with relatively few
  extensions

the changes to existing qmake code outside project.* and option.* are
minor. implementing the changes gradually would mean changing a lot of
code which will be just replaced in the next commit, so i'm not wasting
my time on it.

Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-09-11 00:13:01 +02:00
Sergio Ahumada
faaa866961 test: Remove QSKIP from tst_uic::stdOut()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-26730
Change-Id: Ife1b5bd0ffa20c433070a1875dde8b6a226c331a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-10 23:58:46 +02:00
Sergio Ahumada
6c3ee80589 test: Remove QSKIP from tst_QLocale::windowsDefaultLocale()
This test actually passes on Windows, so removing the QSKIP

Task-number: QTBUG-24543
Change-Id: Ic2666665f2882392aec92a665f51d6c5dd3355f8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 19:20:52 +02:00
Simon Hausmann
0c0c04b405 Fix semantics of the src dir in the include search paths with MinGW
This issue originates from https://bugs.webkit.org/show_bug.cgi?id=95736

Suppose we have
    main.cpp
    somedirectory/someheader.h -- which has #include "anotherheader.h"
    anotherheader.h

With unix generator, the directory where main.cpp is located is included,
unless no_include_pwd is set. Hence the look-up of anotherheader.h from
within someheader.h will work.

With MSVC this works because MSVC looks "in the directories of any
previously opened include files in the reverse order in which they were
opened." (from http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx)

Unfortunately the build breaks with MinGW, because it lacks support for
including the source directory in the include search path just like the
unix generator does.

This patch adds the same functionality to the MinGW generator as well as
an auto-test.

Change-Id: Iea8bb06e34862c51b8fd4eca2ee26668e24a319a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-10 14:09:45 +02:00
Kevin Funk
e78e7d325b Fix build of tests/ on Windows CE
Remove some subprojects that have missing dependencies or use API that is
non-available on Windows CE.

Change-Id: Iad7118b95a691a433c3f798d56a6a069e5e41917
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-10 14:09:45 +02:00
Leonard Lee
b41bd2b08d Remove old troll test servers' references.
Replaced with qt-project.org test domain.
The connectToMultiIP auto test is still disabled due to lack of test infrastructure.

Task-number: QTBUG-23294

Change-Id: Icf01aabb0ae503291abdda4e8f773f8e0a08931a
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-10 09:37:59 +02:00
Marc Mutz
ecf7f0d954 Use QStringList::join(QChar) overload where applicable [QtDBus]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I807b0e88ac71a0cb367fb4170cca8f2cb0ad43f3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-09-10 00:27:13 +02:00
Sergio Ahumada
4d3a53305f test: QFtp tests require `private_tests' set
Also fixing some includes and re-enabling the test

Change-Id: I4a061e106c2e55db39b8000729737a93e3d7714a
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-09 08:51:05 +02:00
Marc Mutz
1f8d570d5f Use QStringList::join(QChar) overload where applicable [QtNetwork]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I5b75877ba192fa1357e67fee70dff7c0475991e8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 18:41:22 +02:00
Marc Mutz
781b642671 Use QStringList::join(QChar) overload where applicable [QtWidgets]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ia30048e0c40967dc86a4e4ad26ac02ab67519096
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-07 18:41:22 +02:00
Julien Brianceau
5b1bc864a9 QtNetwork: bypass proxy for local connections
According to Qt doc, "Network proxy is not used if the address used in
connectToHost(), bind() or listen() is equivalent to
QHostAddress::LocalHost or QHostAddress::LocalHostIPv6. This is not the
case in current implementation.

Change-Id: I6b8a40c1e8bd8aad9504d8f939b87eda6e93337c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-07 15:44:31 +02:00
Thiago Macieira
9c29beb9ea Add a way to benchmark sem_t on Unix too
It's closer to what we do with in QMutex than pthread_mutex_lock.

Change-Id: I86498a800b69b684bf096912e911bc5bca219727
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-07 15:39:31 +02:00
Caroline Chao
72ea9e1e94 Test: Replace QSKIP by XFAIL
For tst_QtConcurrentThreadEngine::threadCount

Change-Id: I14b904a26900a01d5d04245ad60d9752f5645e68
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 15:39:31 +02:00
Caroline Chao
f9b9a71c99 Test: Remove QSKIP for tst_QXmlSimpleReader::inputFromSocket
The test is now passing. Tested with intel compiler and vs2008.

Task-number: QTBUG-22285

Change-Id: I728919833d9bcbf71bef68c06baef92667ff074b
Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
2012-09-07 15:39:31 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
Friedemann Kleint
59774b5d64 Add example to test widget grab.
Compiles against Qt 4.8 and Qt 5.

Change-Id: Ic246aeb38171361a8338f38f9b92e5cf3b54b368
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 12:01:56 +02:00
Friedemann Kleint
20563c1334 Stabilize test of QSpinBox.
The test shows spurious failures in editingFinished() on some Mac
platforms (QTest::qWaitForWindowActive(testFocusWidget)).
This is apparently caused by the widget testFocusWidget (member
variable) interfering with the other tests widgets.
As it is used in one test only, instantiate it on the stack there.

Change-Id: I688cd21a2668d072660658302cf59197abe0b4d8
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-09-07 12:01:47 +02:00
Friedemann Kleint
75cd2dec71 Revert "Implement automatic mouse grabbing on mouse button press."
This reverts commit 6b5bbc531b.

Autograbbing mouse shouldn't be done in crossplatform code, as
X11 does this automatically. Windows needs platform specific
solution.

Task-number: QTBUG-26962
Task-number: QTBUG-27039
Task-number: QTBUG-23699

Change-Id: I911df92c4a34deb50b729f50681497046657948b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-09-07 12:01:38 +02:00
Mitch Curtis
9039031479 Fix QDateEdit displaying day as a number for short and long day formats
When 2 (February) is entered as the month for (e.g.) 31/Jan/2000 (which
is following the format: "dd/MMM/yyyy"), the day is corrected to 29 but
displayed as its numerical value instead of its short (or long) name.

Task-number: QTBUG-27036 QTBUG-19091
Change-Id: I558ee13b224707d22b26c2ec2c045f96118bd5a1
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:51 +02:00
Mitch Curtis
2b562b7564 Fix 3 digit day being displayed by QDateEdit.
When a QDateEdit has its display format set to "yyyy/MM/dd", its day
set to 31 and its month set to 2, it will display 291 as the day until
the cursor is moved or the focus changed. This is because
QDateTimeParser::parse calls sectionSize() for the day section, which
will sometimes return an incorrect size. There are also other display
formats affected by this bug (e.g. long day names).

For example, (in the context of sectionSize()) when text is
"2000/01/31" and displayText() is "2000/2/31", there is a difference
between displayText() and text - text is the previous value and
displayText() is the new value. The size difference is always due to
leading zeroes.

This patch makes QDateTimeParser keep track of the quantity of zeroes
added to each section and then factors this value into the result of
sectionSize() if there is a size difference between text and
displayText().

Task-number: QTBUG-26847
Change-Id: I3823cc41167ec920f742cb6a20d39fc5f433c915
Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
Reviewed-by: aavit <qt_aavit@ovi.com>
2012-09-05 21:06:39 +02:00
Sergio Ahumada
56d5c909af Use true and false in preference to TRUE and FALSE
The TRUE and FALSE macros are obsolete and should be replaced with
true and false (all lower case) respectively.

Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:05 +02:00
Sergio Ahumada
10ed50002c test: Check for null string comparison
Do not compare a QString to QString(). Instead use the .isEmpty() method.

Change-Id: I8bb5e64563bf173abe7288bb9e35375bee1fe445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-05 03:03:02 +02:00
Milian Wolff
0102f34f1e Optimize QTextLayout/QTextEngine usage outside of QTextDocument.
When QTextLayout is used in a QTextDocument, many code paths use
special caches and thus greatly outperform the raw QTextLayout version
that operates directly on a QString.

This patch brings some of these optimizations also to the raw version.
We now also use a QFormatCollection in such cases and enable the
functionality of QTextEngine::indexAdditionalFormats() and
QTextEngine::resolveAdditionalFormats(). Thanks to that, we can greatly
speed up QTextEngine::format(), which now uses an amort O(1) hash table
lookup instead of a O(N) linear search.

The added benchmark shows a gain in the order of one magnitude:

./tst_bench_QText formattedLayout:long-many

before applying the patch:
378.19 msecs per iteration (total: 37,820, iterations: 100)
after applying the patch:
25.80 msecs per iteration (total: 2,580, iterations: 100)

Note: This change is source-incompatible for applications using the private
QTextEngine API.

Task-number: QTBUG-8389
Change-Id: Ifcf7a8902a394428979ea06a6d955f886ee739c7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-05 03:02:59 +02:00
Rafael Roquetto
3d4fc578bd Auto test for 'qmake -project' use case.
Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-09-04 10:30:33 +02:00
Stephen Kelly
5a1fa8860c Generate includes for Qt containers used as auto-metatypes.
Otherwise the containers might be forward declared in the moc file,
and when the moc file is compiled in a standalone translation unit,
the full definition of it would not be available. This results in
odd compile errors, so instead generate the includes if required.

Change-Id: Ie01c5a5d45314daad0b00dec03b3e1e18cdbae64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-03 20:05:04 +02:00
Marc Mutz
cb8424b381 Use QStringList::join(QChar) overload where applicable [QtSql]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ie395d82d17710683968d006d22de313ef49dc6e5
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-03 19:35:25 +02:00
Marc Mutz
68e04c3ac1 QStringList::join: add an overload taking a single QChar
This overload avoids the needless heap allocation that the traditional
overload incurs due to the implicit QChar -> QString conversion
involved there.

In order to share the implementation between the two overloads,
QStringList_join now takes the separator as a (Char*,int) tuple
instead of as a QString.

Change-Id: I92961f13a3f19099de2a6e2df9f4789a12fc83a0
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 13:41:55 +02:00
Stephen Kelly
dcf4d152b5 Change SChar to metatype id 40.
This fills the gap left by QWidgetStar, making the sequence
between FirstCoreType and LastCoreType contiguous, which some
benchmarks assume to be true anyway.

Change-Id: I2d5d202b6246a9065fdf77f325a4a04279dbe4b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-03 11:05:49 +02:00
Volker Krause
8c1cb66712 Fix moc generating invalid code for slots with reference types as argument.
We can't have T& declared/registered as a metatype (wont compile), but
using it as type for a slot argument is possible. With the recent
introduction of metatype auto-registration we have to make sure that moc
doesn't attempt to auto-register those. Simple types are handled correctly
already, this fixes containers and smart pointers.

Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-02 23:41:42 +02:00
J-P Nurmi
60783291ff auto tests: updated for new QStyle pure virtuals
QStyle::standardIconImplementation() & layoutSpacingImplementation()
are removed, and standardIcon() & layoutSpacing() made pure virtual.

Change-Id: If8ab6cfef0b639b7973be22dd630ba3e6f39a225
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>
2012-08-31 18:56:35 +02:00
Sergio Ahumada
531b96f42e test: Mark tst_QFile::writeLargeDataBlock() unstable failure as XFAIL
The test has one unstable failure on Windows, so mark this with QEXPECT_FAIL

Task-number: QTBUG-26906
Change-Id: I2f6c63ddefecacd224d93f83e6951e961a02a051
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-08-31 18:56:35 +02:00
Jeremy Lainé
28881c0c91 Make QGraphicsView respect scrollbar policies
When calculating the maximum height / width which a QGraphicsView can display,
make sure we only take the scrollbars' dimensions into account if their policy
is set to Qt::ScrollBarAsNeeded:

- if the policy is set to Qt::ScrollBarAlwaysOff, the scrollbar will not be
  displayed at all

- if the policy is set to Qt::ScrollBarAlwaysOn, the scrollbar's dimensions
have already been substracted from the available space by
QAbstractScrollArea::maximumViewportSize()

Task-number: QTBUG-14711
Change-Id: If5d24b41dbe7b089abca2bf61ccbd370d4de79a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-31 16:29:43 +02:00
Friedemann Kleint
1e34d3525f Fix updating of drag icons.
Try to find a target widget that accepts drops; ignore the event
if none can be found. Split the handleDrag*() functions
to reduce indentation.

Add an autotest.

Task-number: QTBUG-22987
Change-Id: I516ac5f0c002caaf83c52ac16f821246e565230f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-31 16:10:25 +02:00
João Abecasis
ed4939eaac Improve performance of QArrayData::Grow autotest
Doing element-wise insertions for the full range of the test made
testing under valgrind extremely slow. When a reallocation is detected
we now resize() the container close to capacity(), while verifying this
doesn't unnecessarily re-allocate either.

Change-Id: Idf7015cf390e366fe444e7ca14c904a2d54ff48b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 13:51:22 +02:00
Mark Brand
c194b7f345 QSqlQueryModel: fix nested beginResetModel/endResetModel
Follow-up to 83c9ebbd66.

Consider the case where calls to the reset methods on the same object
are nested as in the following sequence:

  1. beginResetModel()
  2. beginResetModel()
  3. endResetModel()
  4. endResetModel()

In such cases, only the outermost calls, i.e., 1) and 4), should emit
signals.

After 83c9ebbd66, 1) and 3) emitted the
signals, which is wrong. This is corrected by keeping track of the
nesting level.

Such sequences can come about when a base class calls the begin/end
methods between the calls made by the subclass.
QSqlTableModel::select() is an example of this.

Test included.

Change-Id: Ia62b45cb1abaab00a32bb8357de4a958bcff83e5
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-30 13:51:22 +02:00
Titta Heikkala
1cebd906af Ensure that printer orientation is preserved
After setting the printer name the initialization is no longer done for
a printer with a name. Instead doReinit() method is called to preserve
the orientation (set with setOrientation() method before calling
setPrinterName()). Before the orientation was changed back to default
when setPrinterName() method was called ignoring the orientation set.

Updated also the autotest because the case:
taskQTBUG4497_reusePrinterOnDifferentFiles() is no longer expected to
fail on Windows.

Task-number: QTBUG-26008
Change-Id: Ia6bc9ae14d79a646e61bfc97652f9f5af90738b3
Reviewed-by: Andy Shaw
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-30 08:54:59 +02:00
Kevin Funk
7cea395d1f Make tests/auto/corelib compile on Windows CE
Change-Id: I71987d40ae69d95f645c4c7d26d50add4c799327
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-30 06:22:34 +02:00
Marc Mutz
6276427438 QString::append: add (const QChar*, int len) overload
Both insert and replace have this overload, so one reason to add it
to append(), too, is consistency. But I can also make good use of
this overload in the the new QStringList::join(QChar) overload, so
it's actually useful in its own right.

Change-Id: Iccd48f9cb84831399e4db7e3e78eba25c0ced30d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-30 02:28:30 +02:00
Thierry Bastian
1e97dbaf6c Fixed the QTreeView expansion/collpasing when animated
If you had a QTreeView with expandable items, if you tried to expand and while
the animation was still running you'd try to collpase the node,
the display would be completely broken: the items below that items would
not be visible any more except for a fraction of a second when expanding
or collapsing it again.
The problem is in the fact that when starting an animation the QTreeView
stores the state before animating. And it does that even if an animation
is already running. So the stateBeforeAnimation becomes AnimatingState and
when the animation finishes, AnimatingState is the state that is restored
breaking the painting.
Unit test is included.

Change-Id: I015212c1ed8962e6df705655099a5660f195caf3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-08-29 20:40:17 +02:00
Samuel Rødal
c1e5f600ab Made QImage::fill(uint pixel) for RGB888 accept QRgb values.
Previously QImage::fill() for Format_RGB888 expected a BGR value
instead of the RGB order defined by QRgb, making it counter intuitive to
use related to the 32-bit formats.

Fixed the QPixelLayout data for RGB888 and changed the byte order of
quint24 based on what the optimized image conversion routines expect.

Change-Id: I72926debbc6f5b5cb10b8aa0b2a2a916a04db946
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-08-29 16:53:00 +02:00
Andy Shaw
49c251e054 Ensure child items are updated even if the parent item has no content
When a parent item had its visiblity toggled, then the child item would
not update if the parent item had ItemHasNoContents and
ItemClipsChildrenToShape set. This is a common use case in declarative as
the root item has ItemHasNoContents set.

Task-number: QTBUG-26846

Change-Id: Id6592ebc4ba2caa4331a4a71f7247e40993131b6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-29 16:53:00 +02:00
Brendan Long
860f95946b Add support for explicit TLS 1.1 and 1.2
Add SslProtocol enums TlsV1_1 and TlsV1_2 and use the appropriate OpenSSL
methods when they're selected (TLSv1_1_client_method, TLSv1_2_client_method,
TLSv1_1_server_method and TLSv1_2_server_method). This allows us to
explicitly use TLS 1.1 or 1.2.

Task-number: QTBUG-26866
Change-Id: I159da548546fa746c20e9e96bc0e5b785e4e761b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-08-29 14:22:54 +02:00