Commit Graph

1402 Commits

Author SHA1 Message Date
Thorbjørn Lund Martsum
f0a8a4293a Extending the auto test for QHeaderView
This is a test that verifies correct behaviour of qheaderview.
It includes test of swapSections, moveSection, rowcount-change,
resizeSection, hideSection and position lookup.

Change-Id: Idc1fe8167f2d95dee5c5b1161cb633cbf9495d17
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-01 16:26:11 +01:00
Friedemann Kleint
b44e67e1ca Windows: Fix inclusion of <windows.h>
- Always use <qt_windows.h> as the last file to be included.
- Remove it from some headers, use Qt::HANDLE instead of HANDLE.
- Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE.
- Add NOMINMAX to qt_windows.h to avoid problems with the
  min/max macros.
- Remove <windows.h> from qplatformdefs.h (VS2005)

Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-02-01 11:06:19 +01:00
Thorbjørn Lund Martsum
9fa4e51dbb Adding a QHeaderView benchmark
This is a small QHeaderView benchmark.

It measures visualIndexAt, hideSection, showSecion, moveSection,
insert, remove and trunc rows.

Change-Id: Ibca6a2e130f4ab27d68f51e5e341a78579abd1bf
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-01 10:59:40 +01:00
Kai Koehne
d394ca7f27 QtDebug: Include file, line, function information
Record the file, line, and function where a qDebug, qWarning, qCritical
or qFatal call happens, and make this information available in a custom
message handler.

The patch uses the C preprocessor to replace qDebug, qWarning, ... with
a line that also records the current file, line, and function. Custom
message handlers can access this information via a new QMessageLogContext
argument.

Change-Id: I0a9b89c1d137e41775932d3b1a35da4ebf12d18d
Reviewed-by: David Faure <faure@kde.org>
2012-02-01 02:16:32 +01:00
Thorbjørn Lund Martsum
96f1fe8855 QHeaderView - preventing negative section sizes.
This patch removes the posibility to call resizeSection
with negative sizes.

Sections with negative sizes affect the other sections,
and it does not seem to have a useful, well-defined semantic.

The length can also become negative - and visualIndexAt
work strange.

Change-Id: I632beb160649fa10e2106314557b8c5a106aa3cf
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-01 02:16:08 +01:00
Stephen Kelly
a512e210ac Add the event loop quitlock feature to QtCore.
A feature of a ref-counted quit (managed by a quit-lock class)
is added to both QEventLoop and QCoreApplication.

This allows, for example, an event loop to quit() when there is
no more work for it to do.

quitOnLastWindowClosed is implemented in terms of the refcount in
QCoreApplication so that jobs can be completed before the
application quits.

Change-Id: I14c8f4e7ee12bbf81a6e5849290d4c8ff37fa110
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-31 23:22:15 +01:00
Simon Hausmann
298330bd43 Add support for cleanup functions for data-constructed QImages
A QImage can be constructed with a provided buffer, that has to be
kept alive for the live-time of the QImage and all its copies.
Frameworks like CoreGraphics or Cairo offer a similar method of
creating image objects and also offer the ability to provide a callback
function that is called when the image is destroyed.

This patch adds this functionality to QImage by extending the
QImage constructors that take a raw image buffer pointer.

Change-Id: Ia6342408c560ef49b498c9e4664b4602febb0fcd
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-31 16:21:17 +01:00
João Abecasis
2bf186a2e5 Allow function types to be registered without workarounds
Commit 4b8ceb41ae added the requirement
that pointed-to types need to be registered when registering pointer
types. Unfortunately, the implementation also affects function pointer
types.

This change whitelists 0, 1, 2 and 3 argument functions as not deriving
from QObject, forgoing the need to workaround details of the type
registration implementation when registering those function pointer
types.

Change-Id: I4d855e9d70a8179a6e31b84623ad5bf063e0d6d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-31 16:17:55 +01:00
Lars Knoll
3855233dab Remove many deprecated methods
Remove methods that have been marked as deprecated
before Qt 4.6. Keep others, but inline them
where possible and mark them as QT_DEPRECATED_SINCE(5, 0).

Change-Id: If881821ae095f054b31cc13464f19e2007c20ed7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-31 16:17:55 +01:00
Kai Koehne
ef63b7befd Mac: Fix compilation with -qtnamespace set
Change-Id: Id3b9f4e3edf2caeac32c8a44278cdf05a1fc70fb
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-31 16:17:55 +01:00
aavit
4fce5d1795 Moving tiff image format support and libtiff out of qtbase
The tiff plugin and bundled libtiff is moving to the qtimageformats
project on Gerrit.

Task-number: QTBUG-23887
Change-Id: I4c848232fdccddd7e7f54215f9eaa78dc4c3a53d
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-31 14:31:04 +01:00
Chris Adams
cf52c268b0 Add public role names setter to QStandardItemModel
This allows QStandardItemModel to be usable in QML without requiring
clients to subclass it.

Task-number: QTBUG-15067
Change-Id: I867fcd8137132affdf21f37a9fa293e855a09a13
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-31 12:00:31 +01:00
Lars Knoll
cf20c06756 QDirectPainter is gone in Qt5
Change-Id: I3ba8985c9c38be978198a4abd58775aa6f525968
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-01-31 11:58:03 +01:00
Xizhi Zhu
ba9302b8a9 Remove Symbian specific code from qtbase.
Change-Id: I27d37d914b71e1e43c94e2a975ffec49e1ecd456
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-31 07:08:31 +01:00
Anselmo L. S. Melo
8839a0a001 Fix QGuiApplication::topLevelWindows(), introducing allWindows()
As discussed on the development mailing list, the window list returned
by QGuiApplication::topLevellWindows() included all QWindows, even the
non top-level ones.
This commit introduces the new method allWindows(), which returns the list
of all QWindows, fixes the list returned by topLevelWindows() and also
introduces tests for both methods.

Change-Id: I761f0fcdec79f83949012c628655ed12cd18572c
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-31 07:05:09 +01:00
John Layt
0436281771 QValidator: Don't fallback to C Locale when validating input
QIntValidator and QDoubleValidator used to accept C formatted input if
the input wasn't valid in the default locale.  This change removes this,
only the default locale is now used.

Change-Id: I8b2d8f9f3849abe3fcb5c12083aae542a76eaf90
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-31 07:02:11 +01:00
Lars Knoll
0f48d1a523 Remove QIconEngineV2 and fold it into QIconEngine
Change-Id: Ife590b7639f4aadcfbd4d77ca170285b623c14ae
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-31 04:56:14 +01:00
Kai Koehne
0fdb881987 Windows: Fix autotests with -qtnamespace
Change-Id: If367429dafc283b3b2d57dab593060055f65659d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-31 04:56:06 +01:00
Mark Brand
6466314625 tst_qabstractitemmodel does not need QT += widgets
Change-Id: I6f615f849f77df19129efb82acaae387b17a787b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-31 04:55:47 +01:00
Kurt Korbatits
c8f88e6292 Changed qapplication unittest to work from installation directory
- Changed to use TESTDATA and installTestHelperApp()
- Changed to use QFINDTESTDATA instead of currentPath()

Change-Id: Ia24ebc758d5d0fdfcca951500766adefbcf9fe93
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:55:38 +01:00
Kurt Korbatits
4ca298f42b Changed qlibrary unittest to use applicationDirPath()
- Changed unittest to use QCoreApplication::applicationDirPath()
  instead of QDir::currentPath().

Change-Id: I398f7ea8b4426be85432d0eb3767ef6d59488d0a
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:55:35 +01:00
Jason McDonald
e03386945f Update contact address in license headers.
Change-Id: I35bf916087511f26bfeb49ceb3256d9a20fbc1c0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:54:56 +01:00
Kurt Korbatits
c0dd519f88 Fixed qstandardpaths unittest to check before using first()
- Added check to testLocateAll() to check count() before calling
  first().

Change-Id: I04e93c1f913972b26c517f2bbd08760f9898cc7a
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:24:04 +01:00
Kurt Korbatits
3f36f9b650 Changed qsplitter unittest to work from install directory
- Changed qsplitter unittest to use TESTDATA and QFINDTESTDATA

Change-Id: I5db0fbfb20e6bd0ec169e884f16c1ec819f4e449
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:23:31 +01:00
Kurt Korbatits
341161c26e Fixed qicon unittest to use QFINDTESTDATA
- Two cases of image.png not being found when run from install directory

Change-Id: I5f20b7a0ea0b120ce06c556b83bc20dd658a4f83
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:23:29 +01:00
Kurt Korbatits
a0cc33e35b Fixed qmovie unittest to use QFINDTESTDATA in jumpToFrame()
- jumpToFrame() updated to use QFINDTESTDATA

Change-Id: I1b5ff92722e389e714eb58b37996f3e933e95489
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-31 04:23:26 +01:00
John Layt
0e62fc73c9 QDateTime: Add validity checks
Check the validity of date/time before attempting to perform maths.

Change-Id: Ia6a2caf07c6c36f7d7fac713a77bc4eb456c6ed6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-31 04:18:37 +01:00
John Layt
08b5eb579f QDateTime: Add missing QDate Unit Tests
Change-Id: Idcc93cdc29739f0108b5629402b6b7a4b2c86657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-31 04:18:34 +01:00
John Layt
35b96c0d3d QDateTime: Deprecate setYMD()
Change-Id: I077332df554fb750666d51486c97724411276679
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-31 04:02:25 +01:00
Lars Knoll
21b5d0e2c3 Fix bugs when using a non 0 terminated QLatin1String
A few methods in QString still assumed that QLatin1String
is always 0 terminated. Change this to rely on the size
provided by QLatin1String instead.

Change-Id: I9145a46e52ed8811f3b4e3d72d8a81a12588760a
Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-30 23:27:35 +01:00
Shane Kearns
e889d61380 Fix tst_QSslCertificate::toText on windows
Open the comparison file as text mode, so that it does not differ from
the dumped certificate in CRLF vs LF line endings.

Change-Id: I54d6ea6e37044059e89e762435657ebf5fa6cb39
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-30 20:18:37 +01:00
Shane Kearns
911ab74161 Fix link error in QSslSocket auto test
This has been broken for months, but invisible because the code causing
the link error is unreachable (due to QSKIP). So the link error only
occurs in debug builds with -O0.

Change-Id: I6093a7803bedf37bfc8c2d9ff0b28b2309b57959
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-01-30 20:18:28 +01:00
Lars Knoll
a4ab8d0bbc Add a null pointer check to QJsonObject::toVariantMap
If the object is null, simply return an empty variant map.
Added another test case checking conversion from QJsonArray
to a QVariantList.

Change-Id: Ieccd163e76630f7db7f41255acd9d1baf66bb38d
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
2012-01-30 18:49:27 +01:00
Lars Knoll
34e8dd5d6f Add the missing test file and give it a proper name.
Change-Id: Icb9bc2aab99d52b5ffbd6153ce94d64a494330d8
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-30 18:48:28 +01:00
Kent Hansen
283140742a Remove type id/name conversion for QVariant::UserType
QVariant::UserType does not correspond to an actual type named
"UserType". This logic didn't make sense.

Change-Id: I369911e514f7902fc863cb05174011d6fc15c447
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-30 16:40:19 +01:00
Jeremy Lainé
e54dc7c2b5 Add support for DNS lookups using native APIs
The QDnsLookup class provides asynchronous APIs for performing
DNS lookups. For now, the following lookups are supported:
- A and AAAA
- CNAME as defined per RFC 1035
- MX as defined per RFC 1035
- NS as defined per RFC 1035
- PTR as defined per RFC 1035
- SRV as defined per RFC 2782
- TXT as defined per RFC 1035

Task-number: QTBUG-10481
Change-Id: I46c1741ec23615863eeca3a1231d5e3f8942495e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-30 16:39:46 +01:00
Stephen Kelly
be1867b6c4 Add the QAbstractItemModel::canDropMimeData method.
Can be used by views to indicate whether a drop is allowed (eg
adequete permissions in a filesystem model).

Change-Id: Iefedb5399e44c8edc5f5df1403c8d5c0da618612
Reviewed-by: Peter Penz <peter.penz19@gmail.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-30 16:24:57 +01:00
Thorbjørn Lund Martsum
125016ad24 QHeaderView - length returns wrong value fix
setSectionHidden called with (logindex, true) will
sometimes prevent a (correct) call to
resizeSection(logicalIndex, 0).
This seems a bit odd - however it does execute
d->doDelayedResizeSections().
Therefore the section is going to be hidden later.

However it is a problem that the length meanwhile is wrong.
(That is a value that is not the sum of the sections)

This is fixed by execute updates before returning the
length.

Task-number: QTBUG-14242

Change-Id: Ia1d2f6db3213792b250a6a37942b56554261cd3a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-30 06:29:42 +01:00
Jason McDonald
5635823e17 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I311e001373776812699d6efc045b5f742890c689
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 03:54:59 +01:00
Shane Kearns
d71ccb9c13 Fix BC break with QAbstractFileEngine "mount points"
File system cached metadata can't be trusted when custom file engines
are in use, because the custom file engine may want to override the
metadata. (e.g. present an archive file as a directory)

Therefore, check if a file engine should be instantiated for each
result in QDirIterator. This is a fast check if no custom file engines
are registered.
When pushing a directory (using QDirIterator::SubDirectories) the
file engine needs to be instantiated also.

Task-number: QTBUG-23688
Task-number: ou1cimx1#965023
Change-Id: I0114c8df6258535553783a2486131c4194926649
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
(cherry picked from 3864ad09d578210b52e5f58fca2ee8a1144f5be2)
2012-01-29 15:22:19 +01:00
Jędrzej Nowacki
d874c059d3 Introduce QTypeInfo::sizeOf.
In QMetaType "void" is a regular type, lack of c++ sizeof operator
force us to write a template specialization for the type.

Change-Id: I9a56e135223b416b8031836d29ef33ef3fb750e4
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-29 15:21:16 +01:00
Kent Hansen
36c057787f Get rid of checks for Qt3 types
These types don't exist anymore, so it's pointless to check for them.

Also remove the dead types from uic's type-to-header map.

Change-Id: I7f0af5c337859f3da1c103157a802bbe5372df9f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-29 14:34:12 +01:00
Olivier Goffart
889092504e Call connectNotify when connecting with function pointer
Some objects expect connectNotify to be called in order the signal to be
emitted.

Change-Id: Id0460d9c2aef8f9c3618a2b62b2119a790e06f30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-29 12:40:51 +01:00
David Faure
27d9fef14a QUrl: deprecate setEncodedUrl() and fromEncoded(), add url().
setEncodedUrl() isn't necessary anymore now that setUrl can handle
encoded (and partially encoded) urls.
url() is added for symmetry with setUrl().

Change-Id: I4e671482a5635a86797421ca50882db9cd60d852
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 13:08:50 +01:00
David Faure
e650dd3b6d QUrl: use partially-decoded data in toString and QUrl(QString)
This fixes round-trip bugs. People expect to be able to do
QUrl u(...); QString s = u.toString(); QUrl u2(s); and have u==u2.
This was not true for paths containing a '#', for instance, which would
be parsed back as a fragment. The solution is to make toString output
partially decoded data (more readable than toEncoded, but not decoded
to the point of changing the meaning, if parsing it back later as a
QUrl), and to make the QUrl constructor work with partially decoded data.

Change-Id: I013c01e8947d538435f3c20fc4ec57cd9ccbba6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-28 13:08:50 +01:00
Giuseppe D'Angelo
e1149349c1 QHash benchmark: improve Java's hash
Added a bit of documentation to the Java-like hashing function.

Change-Id: I3f44eee305d91b76f0f89cd1acf21f6430b9482b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-27 22:48:12 +01:00
Giuseppe D'Angelo
071561f0eb QHash benchmark: remove unused variables
Change-Id: Ib5abc171fb8fb70e2f73ac92ca22dc09146d8a55
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-27 22:48:12 +01:00
Pekka Vuorela
1166ad8603 QWidgets to use QGuiApplication focus object change notifications
Moving away from deprecated QInputPanel inputItem.

Small behavioral changes:
- On focus proxy widgets, disabling WA_InputMethodEnabled on
proxy will no longer disable input method for proxy target.
- setEnabled(false) on proxy widget will no longer disable
input method for target as a special case.

Change-Id: Ifb5b7144d29bd3aefdde7cf4a0bd396db06e67e2
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-27 13:28:03 +01:00
Pekka Vuorela
dd565d2d4c QGuiApplication::focusObject() to replace QInputPanel::inputItem()
* Deprecated QInputPanel::inputWindow() which is already
  just returning QGuiApplication::activeWindow()
* Deprecated QInputPanel::inputItem() and introduced
  QGuiApplication::focusObject(). Input methods can check
  input method support by Qt::ImEnabled query.

Change-Id: I70a9c1c3f79aadb75c839d0489a9428f7a221df5
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-27 13:27:54 +01:00
Anselmo L. S. Melo
76a5ce8acb Implement QWindow::close()
Implement the public slot QWindow::close() and add the correspondent test.

Change-Id: If3f07cce3b26640f06fc52d0e4dca875d9894b3d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-27 08:57:58 +01:00