Commit Graph

4623 Commits

Author SHA1 Message Date
Kent Hansen
cbe21c59a0 Minuscule moc cleanup: Don't declare i in function scope
This is not C.
Furthermore, the function-level i was already shadowed in several
places by "for (int i = 0; ..." blocks later in the function.

Change-Id: Ic1777f78d9838bc2921d68337be05de454bbeabe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:27:55 +01:00
Morten Johan Sorvig
d00db53a12 Don't force CFG_ENDIAN to "auto" on Mac.
We no longer support universal ppc/x86 builds.

Change-Id: I8c4a1d087d02da1ad80d91a7a04147b37e81d74f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-20 09:42:47 +01:00
Morten Johan Sorvig
5af7e089f7 Don't use -rpath-link when building on Mac.
The logic here was wrong: test if the
target linker supports -rpath-link, and then set
it for both host and target via mkspecs/qmodule.pri.

Change-Id: Ie4da7ed2e06e784f9edb65a27290913ab838a8c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-20 09:42:04 +01:00
Jonathan Liu
7d8f5777be Fix compilation with MinGW-w64
This fixes a "cast from 'void*' to 'int' loses precision" error and adds
a missing argument to qWarning.

Change-Id: I38544c4e317a3f6d1ecf26ebb3e35c66b1878d24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 09:37:24 +01:00
Bradley T. Hughes
3cb078a23c Rename Q_PROCESSOR_POWERPC to Q_PROCESSOR_POWER
IBM's POWER and the PowerPC architecture have been merged into a single
ISA, the Power ISA (see http://www.power.org). Use this unified name in
Qt.

Change-Id: Ia41492b0031d890843e43c5f7ecd1e60c65bb75b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 09:36:51 +01:00
Holger Hans Peter Freyther
52072a8c8a qwidget_p.h: Remove DontSetCompositionMode from the internal flags
This flag was used by QWS to set or not set the composition mode
when filling the background. E.g. this was used by 'transparent'
windows to set the alpha bits. QPA didn't have this enabled in 4.8,
the code paths are gone in Qt5 and it is the responsibility of the
QPlatformBackingStore to initialize the alpha bits properly.

Change-Id: I4011d842b718d6a40b19922b5f75c597e63079c8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Holger Hans Peter Freyther
3ad9896361 qpa: Verify that the platform returns a WId that is not WId(0)
This is motivated by visiting a customer that re-implemented the
::winId method and returned WId(0) that resulted in a crash. Currently
there is only a comment inside the implementation of the ::winId
default implementation. Add a note to the API documentation, add
a Q_ASSERT to check if our assumption holds true.

Change-Id: I8607a4efc4f561f7849c976cd2454f6fbcb20eaa
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Richard Moore
ad1a013878 Remove dead method.
Fix Qt 5 TODO

Change-Id: I9a12cc07ebc7c039bbeb53922b0539f177b226f8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Kurt Korbatits
c66bb51a75 Changed qabstractnetworkcache unittest to use TESTDATA
- Changed qabstractnetworkcache to install testdata

Change-Id: I8f2ae6103214755ee7898dbc0ee50c0e4d7d45ab
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-20 09:36:51 +01:00
Toby Tomkins
853e9ac787 Modify helper functions to remove embedded QSKIP call and return status.
The helper functions contained QSKIP macros which do not also skip their
parent function. These QSKIP function were removed and replaced with a
return success value.

Change-Id: I533f57842fc95beaeb1fcde5235678e9807db056
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 08:06:19 +01:00
Toby Tomkins
2465143f24 Set tst_qtoolbutton triggered function skipped.
This autotest seems to be caught in an event loop preventing further
correct signalling. Mark test function skipped with QSKIP.

Task-number: QTBUG-24374

Change-Id: Ic943a33b71fa87d0873278cb7b7b134c22602be3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 08:06:14 +01:00
Jason McDonald
7fbe7fd7b5 Make QLocale autotest pass for shadow builds.
For shadow builds where "make install" had not been run, the
tst_QLocale::emptyCtor test function would fail to find its helper
application because QFINDTESTDATA was not searching for it in the build
directory due to the test not instantiating QCoreApplication.

This commit fixes the test by instantiating a QCoreApplication using the
QTEST_MAIN macro, which also allows some special case code for Windows
CE to be removed.

Change-Id: Ic81d4699da2538c24b36b3d6bd52c4a02ad417f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 08:06:04 +01:00
Jason McDonald
eb52d78e90 testlib: Report one test result per benchmark test.
Prior to this commit, a benchmark test could report 0..n passes and 0..m
fails or skips, where n is the number of accumulation iterations used to
collect benchmark data and m is the number of times the test function
was invoked.  Depending on the type of benchmark measurer being used,
this could result in a very large volume of test output and inconsistent
pass, fail and skip counts between test runs.

This commit changes the behaviour so that each benchmark test reports
one pass, fail or skip, regardless of the number of iterations used to
collect benchmark data.

This commit also prevents benchmark data being reported in the test
output if the benchmark test failed or skipped, as any benchmark data is
of dubious value in such cases.

The latter change in behaviour requires a minor modification to the
badxml selftest, which now tests quoting of literal strings in xml test
output for both passing and failing benchmarks.

Finally, this commit also adds a new selftest specifically for verifying
correct behaviour for benchmarks that fail or skip.

Task-number: QTBUG-24313
Change-Id: I3426dc659a7511b62fd183a031c7235bc753f497
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 08:05:58 +01:00
Kurt Korbatits
4cb09aea6a Fixed qobject unittest to work from installation directory
- Made test depend on subprogram to make sure it was there when
  test ran.
- install signalbug subprogram

Change-Id: Ie0a19e52d131adcd17c97b263389aecffb81520e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-20 03:27:02 +01:00
Jason McDonald
88c903f6a3 testlib: Add selftests for XPASS and XFAIL involving QCOMPARE.
Change-Id: I4f897b411aaa51ff453208eda50e12665489074b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 03:27:02 +01:00
Jason McDonald
f64f428b81 testlib: make XPASS output slightly less confusing.
Prior to this commit, when an unexpected pass occurred the test output
showed the message "XPASS : tst_foo::function() 'expr' returned FALSE",
where the problem was actually that the expression evaluated to true
when it was expected to be false.

This commit changes the output to make it clear that the expression
evaluated to true unexpectedly.

Task-number: QTBUG-22118
Change-Id: Id22c178073d3b75789675ca37a8ef019029b1f91
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 03:27:02 +01:00
Andrew den Exter
02140e973b Remove unnecessary image height adjustments from layout.
cb8445f032 removes an implied +1 from
document line height so we need to remove the compensating -1 from
image ascent/descent for image heights to be correct..

Change-Id: I310c06bcf1ce2eefef42c2828faa0eb435ad71cf
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-02-20 01:57:38 +01:00
Bradley T. Hughes
2e18c16e59 Speed up tst_QWaitCondition
Reduce the thread and iteration counts to make this test execute faster.
This change reduces the runtime to 14 seconds (from 5 minutes, 38
seconds).

Change-Id: Id5ea056cfd33022da5a06809f0598a5cdb02b27b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 00:21:00 +01:00
David Faure
b164911b7f Import QMimeType / QMimeDatabase into QtCore.
History of the development before the import:
ssh://codereview.qt-project.org/playground/mimetypes.git

Mimetype definitions come from shared-mime-info where available (UNIX systems),
loaded using a mmap'ed binary cache generated by update-mime-database.
As a fallback if no cache is found, we parse the raw XML files otherwise.

This makes the MIME type support fast and with very low memory usage on UNIX,
and it makes it easy to use on Windows (no dependency on shared-mime-info,
Qt even includes a freedesktop.xml file to use if none are found on the system).

Change-Id: I27b05008216ff936dc463bd80d3893422bfb940e
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-18 22:19:43 +01:00
Oswald Buddenhagen
87fcbd82fc make configure ignore $CC and $CXX
this was inconsistent with how qmake itself works, and was actually
wreaking havoc.

Change-Id: I5aa83cc88ffe7141cc0c31b03b76c48274f1ebdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-18 22:19:43 +01:00
Gunnar Sletta
2e4d8f67a8 Introduced QWindow::isExposed().
The visible property along with show/hideEvent tracks the
windows visibility from the application perspective and is
really a request. The exposeEvent() along with the isExposed()
accessor is used to notify the application of the actual
state of the window in the windowing system.

Change-Id: I7f5b7ed74a168e34aaa21ce0ae9042ddfb0bf6d8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-18 20:45:23 +01:00
Thorbjørn Lund Martsum
466107107a Adding hasHeightForWidth as a virtual Widget funcion
Just implements what the note states (and removes the private function)

Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-02-18 18:40:15 +01:00
Andrew Christian
908a080006 Added error reporting to QJsonParser
Change-Id: Ib2390c0faf1ed7ada3fc185abce83740ad112929
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-18 18:08:06 +01:00
Marc Mutz
f63b23afda QEasingCurve: return QVector for cubic spline representation
QEasingCurve internally holds the spline data in a
QVector<QPointF>. For the return from cubicBezierSpline(),
the vector is transformed into a QList<QPointF>.

This involves copying, and into an inefficient (for QPointF
payloads) container at that, so deprecate cubicBezierSpline()
in favour of a new toCubicSpline() returning the QVector
directly.

Change-Id: Ie4827fe7c6e289ad97a0b09772e47298779c76ca
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-18 18:07:23 +01:00
Richard Moore
1703558330 Trivial doc fix
Change-Id: I9b63e0b63f225b245eec68ea4211cb0f2ccf9bb5
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-18 13:13:22 +01:00
Bradley T. Hughes
7e2afb9168 Document Q_PROCESSOR_* macros
All known processors and their variants/revisions are documented. I
added Q_PROCESSOR_MIPS_V based on the MIPS64 online documentation, which
documents MIPS64 as a superset of MIPS IV and MIPS V.

Change-Id: Ie2796d4f03499283aa2c96d60f5e37bd74a36ab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-02-18 02:32:46 +01:00
Friedemann Kleint
e0d9fade03 Fix qclipboard autotest on Windows.
Emit changed signal only if the clipboard is not owned,
in which case QClipboard does it.

Task-number: QTBUG-24184
Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-18 00:00:21 +01:00
Shane Kearns
844b096d67 Fix error handling in QHostInfo windows backend
If the DNS server returns a non authoritative host not found response,
then windows returns WSATRY_AGAIN error code.
This is now reported as HostNotFound and not UnknownError

Change-Id: I212985acd4e85ff4b2bdb6c57ec403405a7695fb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-17 20:23:25 +01:00
Friedemann Kleint
400c865f29 Windows: Fix QWindow-test.
- Save & Restore style and geometry when switching to
  full screen and back since it is not a real state on
  Windows.
- Obey the positioning policy in setGeometry.

Task-number: QTBUG-24185

Change-Id: I18dea4fd372e0b2e46273a7a27e0c6f4f4bde771
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 20:09:58 +01:00
Rick Stockton
3ca194eb12 qnamespace.qdoc: Add doco for new values of Qt::MouseButton
QtTBUG-22642 added about 25 new values for the Qt::MouseButton Enum.
This change adds documentation for the new values. Note that the
special value 'Qt::AllButtons' is documented at the top (next to
the other special value, 'Qt::NoButton'.) The new internal value
'Qt::MaxMouseButton' is listed as a \omitvalue.

Task Number: QTBUG-22642

Change-Id: Iaec623754156fff8a2c73e357fef82e1fe36354b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 19:52:30 +01:00
Stephen Kelly
1b08a48588 Only define QT_NAMESPACE if it is used.
Fixes non-namespaced builds.

Change-Id: I0ec3c29f58042313dfa864f15c2b2d47914cdedb
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-17 16:42:28 +01:00
David Faure
7e970eb58c Ensure that Qt public headers compile with strict flags
Those from
http://wiki.qt-project.org/Coding_Conventions#Conventions_for_public_header_files
(unfortunatey -Wold-style-cast cannot be used due to the glibc macro bswap_16)
and many Qt defines that disable casts.

Change-Id: I97ac707a101df9819e8c031fa75a31b30e20247f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 16:42:28 +01:00
Rafael Roquetto
77172b25fe QProcess documentation typo fix and improvement.
The word 'momentaneously' does not exist.

Change-Id: I3d2201d5b7b3a01af5989bb1c3fcd55110d5482c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Till Adam <till@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-17 16:42:28 +01:00
Simon A. Eugster
45053fffc4 Mention QT_NO_STL in the QString documentation
Defining QT_NO_STL disables STL functions (toStdString() etc.) too.

Change-Id: Id5c8e12d933af6af63ee7f80fa2d5d7577cd689a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 16:42:28 +01:00
David Faure
e5bcb4844d No need to stat with QFile::exists before QFile::open, for reading.
Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jeremy Katz <jeremy.katz@nokia.com>
2012-02-17 16:42:28 +01:00
Shane Kearns
aee4cbf22a Remove unnecessary locking from QNetworkProxy constructor
QGlobalNetworkProxy (a singleton) had two phase construction, with
the second phase being called from QNetworkProxy's constructor.
This isn't necessary, and has been reported as causing deadlocks.

Although constructing socket engine handlers has side effects
(they add themselves to a list on construction and remove themselves
on destruction), this appears to be safe. The socket engine handlers
are only used while holding the list mutex, and any socket engines
created don't have any reference to the factory that created them.

With the new version, it is possible that two instances of
QHttpSocketEngineHandler and QSocks5SocketEngineHandler exist
temporarily if a Q_GLOBAL_STATIC initialisation race occurs.
This appears safe, because the loser of the race deletes its
handlers, which remove themselves from the global list as above.

Task-number: QTBUG-13088
Change-Id: I8cf520da717d8ab7d862ab89c6de13aea6d60ac3
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:04:22 +01:00
Friedemann Kleint
d5a65cb526 Fix warnings about missing file.
Change-Id: I8644d2b80bab9c18f666d742da389e84bf3f124c
Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com>
2012-02-17 15:04:19 +01:00
Shane Kearns
b4a538ea1c Fix handling of urls containing username/password in QNetworkAccessManager
QNetworkAccessManager was ignoring the supplied credentials, although
webkit seems to support these urls at a higher level.

Following the behaviour of browsers:
We use supplied credentials if authentication is required.
We add supplied credentials to the authentication cache.
We emit authenticationRequired signal if the credentials were wrong.
We do not use previously cached credentials for that url

Synchronous http requests fail, if the credentials were wrong.

Task-number: QTBUG-18107
Change-Id: If46e8eab1511ba8a0f4bbe0d4efaabc4df0b8ab4
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:04:07 +01:00
Shane Kearns
d425a0dad3 Fix incorrect use of QObject::disconnect in synchronous http request
In certain circumstances, this could cause the request to time out
(and repeatedly send bad authentication credentials to the server)
instead of failing with AuthenticationRequiredError.

Change-Id: Iff66b32f1d7268f21fd77b6620aae4b5d49d857f
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-17 15:03:53 +01:00
Shane Kearns
6f7bd6532d Update documentation to show NTLMv2 is supported
This feature was implemented in 4.8, but documentation was not
updated at the time.

Task-number: QTBUG-18181
Change-Id: I657d7ab7aaf43b73b7bf8fd1cb76086522cf5c2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:03:18 +01:00
Marc Mutz
a68ada633f QSize/QSizeF: add const versions of scale()/transpose()
Non-mutating functions can (potentially) be constexpr.
On top of that, they often make for more readable code.

Change-Id: I3547327cf5a7162737353a864a1025d0d02ccc2f
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-17 14:39:14 +01:00
Miikka Heikkinen
f8e2753323 Make 'nmake check' succeed for widgets tests
Marked a bunch of tests insignificant, and skipped one crashing test
case in QApplication test, as that couldn't be made to pass simply by
marking the test insignificant.

Once the underlying issues are fixed, the tests need to be re-enabled.

Task-number: QTBUG-24203
Change-Id: I9aea4fa207d307793445efdcaead72219fbf6c4f
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 14:08:19 +01:00
Friedemann Kleint
70ac149a16 Fix another typo in the evdev keyboard plugin.
Amend 3296b7327b

Change-Id: Ide58a6b8cbd980eda6ff91948c8f4fb45a30e527
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 14:00:26 +01:00
Friedemann Kleint
93af98f72a Widgets: Remove obsolete QGuiPlatformPlugin.
It has been superseeded by QPlatformTheme.

Task-number: QTBUG-24204
Change-Id: I8c4131c7bfd8201e747984d772ed8042610192b8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-17 13:47:53 +01:00
Miikka Heikkinen
3efb0d50e5 Disable 'check' target generation for network autotests for Windows.
A number of network autotests are unstable in Windows, so don't
generate check target for them as is done for mac.

Once the tests are acceptably stable, this needs to be reverted.

Change-Id: I18262e28ce40eba541aecf3cfb651bff34698ead
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 11:48:08 +01:00
Miikka Heikkinen
a61f754c92 Fix "check" target when load(testcase) is used in .pro file.
The "check" target always depended on debug-check on projects that
explicitly loaded the testcase.prf, even if Qt was configured with
-release parameter. This obviously caused build failure. Changed the
testcase.prf to check which configuration is preferred using
CONFIG(debug, debug|release) like is done with similar cases in other
.prf files.

Task-number: QTBUG-24332
Change-Id: Ib5140b106e99efe51932bdd5a48914786de23230
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 11:44:29 +01:00
Friedemann Kleint
10d3ed8ca9 Qt 5 plugin system: Fix handling of namespaced plugin classes.
- Add 'using namespace' to moc code as was the case in 4.8.

Change-Id: I26cba9ad74bf05eecc5205714c32c3176695e3b4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
3bd29d1f0a Clean up default arch setting on Mac OS X
Remove config.tests/mac/defaultarch.test, but do the same type of
default arch detection, only using the qmake binary instead of compiling
an empty file. Qt 5 will only support 10.6 and up, which means we
only support i386 and x86_64 now.

Change-Id: I24949ac803b965c523b1ee45cf769e266dcde134
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-17 11:44:29 +01:00
Shane Kearns
304fc533bd Fortune client example - list all IP addresses
The first IP address on the machine might not be a usable one.
Changed the QLineEdit to a QComboBox, and populated it with
all IP addresses of the machine, along with the machine names
if they are configured.

Task-number: QTBUG-13121
Change-Id: I7c443f5ce6efb0d0b525c5abad1671d3dcbba33c
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-02-17 11:44:29 +01:00
Samuel Rødal
f89d02e003 Fixed API in QWindow: visible() -> isVisible().
Change-Id: I14706abb8441c153f738563cb1a46205fdb2dae6
QWindow::visible() did not follow the API guidelines.
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-17 11:44:29 +01:00