Commit Graph

15326 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
505579ebe4 Remove a Borland-related inclusion
There are no calls to qSort in the file any more.

Change-Id: Ifd65b543941ab90d6a1ed4e318d925bdbf3f454e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-23 21:20:47 +02:00
Andrew Knight
373e44df12 QFileSystemModel: Fix build when QT_NO_FILESYSTEMWATCHER is defined
This class already has some guards for QT_NO_FILESYSTEMWATCHER; implement
the rest.

Change-Id: I97072c9cd1debb726f9d10ff49ff0c01bbb9bc6e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-23 19:38:12 +02:00
Thiago Macieira
e43174755c Fix warnings about conversion from const char* to QString.
Change-Id: I6d3dca0688a94eb34b55efc841a75e4ebd3a2bd7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-23 19:38:12 +02:00
Thiago Macieira
c81d0586b5 De-inline virtuals of some non-exported private classes in QtGui
This is to work around a bug in GCC 4.7's link-time optimiser. Without
it, linking QtOpenGL and QtPrintSupport fails because the compiler
generates the code for the virtuals, including the virtual table, but
not the methods.

Change-Id: Idcecd51c32e6228e0eefe67f1bd630ea1f5d5da7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-09-23 19:38:12 +02:00
Thiago Macieira
58b08ba40b Fix conversion from 8-bit to QString without proper encoding
Found by ICC.

Change-Id: Icd89e7df828afdb2acf2c46e00698ef04d5d94c9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: John Layt <jlayt@kde.org>
2013-09-23 19:38:12 +02:00
Bernd Weimer
645f9d959f Fixed build issue on BlackBerry
BlackBerry build was missing QTzTimeZonePrivate implementation.

Change-Id: Ieaf6148a67c66f330e846c93f829ca17a4494359
Reviewed-by: Mehdi Fekari <mfekari@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com>
2013-09-23 17:49:56 +02:00
Jan Arve Saether
bb9cc387f0 Fix a c&p bug in the IA2 bridge when returning the row description
Unfortunately we returned the column description when the AT client
asked for the row description....

Change-Id: I46bc0edb4fd0f7cc6d98d7d6e0d8ca6f77553a26
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-23 16:08:34 +02:00
Martin Smith
f5b3224cb5 qdoc: \externalpage links are fixed
The problem was they were being incorrectly written to
and read from the index files.

Task-number: QTBUG-33510
Change-Id: Ib0b34265cd22fff5ed88ae2fd5d5d7ea58b3761d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-23 12:36:55 +02:00
Richard Moe Gustavsen
2d00d3951d qios: always auto rotate as specified in Info.plist
Before this patch, we would only rotate if no autoRotationMask was set.
This was a temporary way to lock orientation from code until a better
API for this was in place.
But this causes problems for applications that both wants to auto rotate
but at the same time sets a mask to get QScreen::orientation
updates. So remove this heuristic before application code starts to
depend on it.

Change-Id: Idb54abd471b33afd866322738f4860c57bc9dcf7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2013-09-23 09:20:03 +02:00
Morten Johan Sørvig
68b42cd595 Port QMacCocoaViewContainer to Qt 5.
Includes example.

Change-Id: Ifdda5c535d0ec41694712405d921b2c32cb8dfc8
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-23 07:18:27 +02:00
Morten Johan Sørvig
f370f77e48 Port QMacNativeWidget to Qt 5
Also adds examples/widgets/mac subdir for Mac specific examples,
starting with one for this feature.

Change-Id: I4cc7d84ce3d7562259d6206faa5d6996c2392a3e
Reviewed-by: Liang Qi <liang.qi@digia.com>
2013-09-23 07:18:24 +02:00
Marc Mutz
05cd06cff3 tst_QReadWriteLock: replace a volatile bool with an atomic int
Fixes the obvious race between the test of 'release' in the thread
and the setting of 'release' in the test function.

Change-Id: I92df52d7b18e8154f17229a3dbd4a0e58f4a3b5b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-23 02:47:49 +02:00
Marc Mutz
c0251f3041 tst_QMutex: fix a race
The code uses a QSignalSpy to check whether the thread started,
but the signal emission (and subsequent appending to the spy) and
the check for spy.count() before the final thr.wait() are not
synchronized:

The signal emission happens-after the thr.start() and -before the
final thr.wait(). Likewise, the spy.count() happens-after thr.start()
and -before thr.wait(), but neither one happens-before the other.
Thus, there is a data race.

The wait(200) between thr.start() and mutex.unlock() doesn't help,
either, because we check only that it doesn't return true, iow, we
check that it timed out. But it will happily do that if the thread
has not yet started executing, so there's no happens-before relation
to be had via that avenue, either.

I first fixed by moving the spy.count() check to after thr.wait().
In that case:
  signal emission happens-before thread finishing
  happens-before thr.wait() returning
  happens-before spy.count()
so no race.

Arguably, that makes the check rather useless, so I decided to remove
it completely.

Change-Id: I6bb47c4114961ee6e9251cfebeb4b7794ba674a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-23 02:47:49 +02:00
John Layt
4f563cf093 QDateTime - Remove some benchmark tests
Remove benchmark tests that are no longer required as they are simple
overloads of other methods.

Change-Id: I610211543d17c077f482fa2145ac3da7d0767282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:14:10 +02:00
John Layt
55f5b29d79 QDateTime - Add QTimeZone support
Add support to QDateTime for time zones using the new QTimeZone class.

[ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone
spec to be used with QTimeZone to define times in a specific
time zone.

Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:14:03 +02:00
John Layt
8af776d414 QTimeZone - Add Windows backend
Add backend implementation for Windows times zones.

Change-Id: I30946f6672488c3f1d1d05754e9479aa62cce46f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:58 +02:00
John Layt
7ed7d66b5a QTimeZone - Add Mac backend
Add Mac backend support

Change-Id: Iafa2dbd925e18431f571e3eac62983015f8bc977
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-23 01:13:49 +02:00
John Layt
8dfaf91038 QTimeZone - Add TZ File Backend
Add a backend for TZ Files.

If available uses ICU for the display names and  translations, otherwise
the abbreviation is used.

Change-Id: I58c777462810b1a76ea7bd95886836b70b8a3db5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:24 +02:00
John Layt
9c2cbee2b1 QTimeZone - Add ICU support
Add ICU backend for QTimeZone

Change-Id: I92e53a848477e366591102064b093e936f0b49d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:19 +02:00
John Layt
48e2c3ac33 QTimeZone - Define new class and api
Implement the new QTimeZone class based on the Olsen Time Zone ID's.

This is the base implementation and does not include the Platform
backends which are implemented separately.

This change does include a default UTC backed to be used if no Platform
backend is available, i.e. if QT_NO_SYSTEMLOCALE is set and ICU is not
configured.  This backend also provides a default set of time zones in
the standard "UTC+00:00" offset format that are guaranteed to always
exist regardless of the Platform backend.

This change includes conversion functions between the Olsen ID's and
Windows ID's using a conversion table based on Unicode CLDR data.
This is implemented for all platforms for scenarios such as a Linux
program needing to communicate with a Windows Exchange Server using
the Windows ID.

The CLDR conversion table is included under the UNICODE license, see
http://unicode.org/copyright.html for details.

[ChangeLog][QtCore][QTimeZone] Added new QTimeZone class to support
time tone calculations using the host platform time zone database
and the Olsen time zone ID's.

Change-Id: Ibb417d08cf2663a0979d2be855d2c6ad6ad01509
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 22:21:15 +02:00
Marc Mutz
ab55f9f39b Q_STATIC_ASSERT: use __COUNTER__ instead of __LINE__ if the compiler supports it
When using __LINE__ to construct unique names, use of Q_STATIC_ASSERT
is limited to one instance per line of code. On compilers that support
__COUNTER__ (GCC and MSVC, probably others), we can get around that
limitation by using that one to always get a new unique number, so
use it.

Change-Id: I89bcfaa32376b7a665f03e4275e89b13fa3e650d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-22 10:32:42 +02:00
Sean Harmer
1b34df6ea6 Long live QOpenGLTexture!
Task-number: QTBUG-33274
Change-Id: I9259d947d11f8ba330a2cd7f5620d8f1af0a804b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-09-22 08:56:47 +02:00
Thorbjørn Lund Martsum
42d681f9cf Add widget replace function to QLayout
Sometimes it is nice to be able to replace a widget in a layout.

Change-Id: I23a6a65e417e94d53bc48639503db1a142bc3f10
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2013-09-21 23:17:55 +02:00
Marc Mutz
e327ba191d QTest: microoptimisation
Change-Id: Ifd053870c270a2c0a0a33c8201e40aaa9a9f9041
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-09-21 18:39:13 +02:00
Marc Mutz
6611f04879 QFutureInterface: wrap a pair of {release,reserve}Thread() calls with RAII
Rationale: a wait on a condition-variable is usually a cancellation point.
On Posix, and probably in C++ at some point, a thread cancellation is
done by (a kind of) exception unwinding the stack. To ensure that
we call reserveThread() in all cases, wrap the function pair in a RAII
class. Even if we currently don't seem to support exceptions in QtCore,
this is low-hanging fruit, and no worse than what we had before.

Change-Id: Ifb0f428ea50f9ac12be14e620615f46e00d3dd91
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2013-09-21 18:39:13 +02:00
Sergio Ahumada
4cebef621b Merge "Merge branch 'stable' into dev" into refs/staging/dev 2013-09-21 18:39:13 +02:00
Jędrzej Nowacki
8969f57b6a Improve qdoc performance.
Valgrind blamed CppCodeMarker::addMarkUp as slow, the patch improves
situation by ~12%

Use of QStringLiterals instead of const char* reduce amount of
allocations on startup.

Change-Id: I8737e02785506bba7e23868ab3952eab09d543d2
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-09-21 18:39:13 +02:00
David Edmundson
cab86ec3ed Replace hardcoded shortcuts for X11 in QLineEdit with StandardKeys
Added Ctrl+E to the X11 shortcuts for "move to end of line"
Added new StandardKey DeleteCompleteLine bound to Ctrl+U

Updated QLineEdit to use these standard keys

Change-Id: I24e5dd3b4fed9f6c15f0d1a00be682734e2485a4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-21 18:39:13 +02:00
David Edmundson
3edc1a4b91 Fix last standard keyboard shortcut
Binary search only counted up to < N-1 items, which does not
include the last value

Change-Id: I40e620db3f834fce8776119d7533c157a4a02492
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2013-09-21 18:39:13 +02:00
Sergio Ahumada
a5d34b34fb Merge branch 'stable' into dev
Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
2013-09-21 17:33:15 +02:00
Frederik Gladhorn
b751fcf32a Fix some doc errors.
Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-21 17:04:41 +02:00
Robin Burchell
5957f245c6 Mark most of the contents of QtAlgorithms as deprecated.
This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ic31c052e7f35c576250bf11826ca82e371142c82
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2013-09-21 13:59:01 +02:00
Giuseppe D'Angelo
9bb99d8130 Remove qFind usage from QCoreApplication
This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I1a067a4262d5442fb118089b859cad4dc1748c40
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2013-09-21 13:58:47 +02:00
Samuel Gaist
ac0bacc8af Port of Qt 4's Windows session management
This patch aims to implement the session management for Windows.
Based on the Qt 4 QApplication windows specific code

Task-number: QTBUG-28228
Task-number: QTBUG-33032
Change-Id: I7059298ad9661aebd51e77a03f55a7a04f461479
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-09-21 07:45:44 +02:00
Morten Johan Sørvig
2b65bba77d Add Mac type conversion functions to QtCore
New API:
    static QString QString::fromCFString(CFStringRef string);
    CFStringRef QString::toCFString() const;
    static QString QString::fromNSString(const NSString *string);
    NSString *QString::toNSString() const;

    static QUrl QUrl::fromCFURL(CFURLRef url);
    CFURLRef QUrl::toCFURL() const;
    static QUrl QUrl::fromNSURL(const NSURL *url);
    NSURL * QUrl::toNSURL() const;

Add Q_OS_MAC-protected function declarations to header
files, add implementation to _mm files.

CF and NS types are forward-declared in the header
files to avoid including the CoreFoundation and Foundation
headers. This prevents accidental use of native types
in application code. Add helper macros for forward-
declaration to qglobal.h

Add cf_returns_retained/ns_returns_autoreleased attributes
to toCFString() and toNSURL(). These attributes assists
the clang static analyzer. Add Q_DECL_ helper macros
to qcompilerdetection.h.

Add test functions (in _mac.mm files) to the QString
and QUrl tests. Split out the test class declarations
into a separate headers files.

Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:41 +02:00
Morten Johan Sørvig
dd7bfffa77 Add QMenu -> NSMenu conversion functions.
Add QMenu::toNSMenu() and QMenuBar()::toNSMenu().
Add QMenu::setAsDockMenu and qt_mac_set_doc_menu(QMenu *menu)

These are all API wrappers around implementation
in the Cocoa platform plugin.

Change-Id: I927ed4fb5dc42cc577a41a80b531a4a2f7b8812c
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:33 +02:00
Jake Petroules
f9365b0acc Use the correct identifier for the OS X operating system.
This is consistent with other areas of Qt:
qmake, Qt.platform.os (QML), qbs.targetOS (QBS), and #define Q_OS_OSX.

Change-Id: Ibf98e6ba3556a14187dadae1b0235e9c907c9001
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2013-09-21 05:09:16 +02:00
Sergio Ahumada
642ebccaad Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-09-21 02:59:14 +02:00
Marc Mutz
129a8ce389 qatomic_cxx11: fix fetchAndAdd*()
In qatomic_cxx11, the 'Type' is std::atomic<T>, whose fetch_add method,
used in fetchAndAdd*(), already does the right thing for T* with sizeof(T) > 1.
The code, however, applied 'AddScale' to the 'valueToAdd', thus becoming
incompatible with normal pointer arithmetics.

This is very apparent when one goes to the length of actually testing
qatomic_cxx11 with tst_QAtomicPointer (which is non-trivial, since the
-c++11 configure option currently doesn't have an effect on tests/auto).

To fix, remove the AddScale factor.

Change-Id: I7507203af3b7df31d8322b31a6a1a33ca847d224
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-09-21 01:25:19 +02:00
Marc Mutz
9efa71ac0a QMutex: fix race on 'owner' in the recursive case
The read from 'owner' for comparison with 'self' in QRecursiveMutexPrivate::lock()
is not synchronized with the write to 'owner' in the same function further down,
and neither operation is atomic.

Fix by making 'owner' an atomic pointer.

Change-Id: I186b88575589da0dce5827a1e17ceb4ce599ed02
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-21 01:25:19 +02:00
Marc Mutz
84033f550f QAnimationGroup: avoid undefined behavior
The existing code performed a downcast from QObject* to QAbstractAnimation*
at a time when the former QAbstractAnimation only is a QObject anymore.
The comment indicates that this was understood at the time of writing (or
else a little later), but it drew the wrong conclusions.

Statically downcasting a type whose dynamic type is (no longer) of the
target type is undefined behavior.

This change fixes the code to (implicitly) cast _up_ to QObject and
compare at that level.

Says Clang:
src/corelib/animation/qanimationgroup.cpp:278:33: runtime error:
 downcast of address 0x000002966ab0 which does not point to an object of type 'QAbstractAnimation'
 0x000002966ab0: note: object is of type 'QObject'
 00 00 00 00  80 d7 e6 d7 88 2b 00 00  70 7b 96 02 00 00 00 00  61 00 6e 00 6e 00 6f 00  21 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'QObject'

Change-Id: I51d6277020d0ff32cd7b80a8cddcf2cda1a626a6
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-21 01:25:19 +02:00
Tor Arne Vestbø
09205d5734 qmake: Expose ARGC to qmake functions to be able to check argument count
ARGS already exists, but is a flattened list of the arguments, so both
foo(bar, baz) and foo(bar baz) will give count(ARGS, 2), making it
unreliable for validating arguments to qmake functions.

Change-Id: I0bcc16614c64000169431327da48fd1a26708e67
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-21 01:25:19 +02:00
Tor Arne Vestbø
8aefa4dc46 qmake: Don't create OBJECTS_DIR and friends for TEMPLATE = subdirs
A bunch of empty and never-to-be-used directories makes the build tree
noisy and harder to navigate.

Change-Id: Iebef91c82d58a8d6a0047fb5439d50eb6806f557
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-21 01:25:19 +02:00
Tor Arne Vestbø
e582d742cc Sanitize QMAKE_EXTRA_COMPILERS paths in makefiles
There was a mismatch of how we sanitized paths for dependencies of the
target and how those dependencies were sanitized (or not sanitized),
resulting in the target depending on 'some/path/foo.o' while the
extra compiler target was named 'some/path//foo.o', with an extra
slash. This confused 'make' enough to decide that it didn't know
how to build the dependencies for the target.

Change-Id: I181b86c291286cbbbb1f7b4c3b929a5f1dc163a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-21 01:25:19 +02:00
Tor Arne Vestbø
15e9c3301c Strengthen check for combined QMAKE_EXTRA_COMPILER with variable output
The pattern ${QMAKE_ needs to be at the beginning of the line, or not
start with a $ (which would make it a regular qmake variable).

Also, it's fine that the variable is of the QMAKE_VAR_foo type, as
these variables are resolved at generator time, but are constant
and do not depend on the inputs. This means we have to replace
extra variables in the output.

Change-Id: I21ad24ae770f2137e2d5d92a20ee54e2f3f4ca06
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2013-09-21 01:25:19 +02:00
Tor Arne Vestbø
9c6a4c1a37 iOS: Compare similar types when setting up QPlatformScreen
[NSArray count] returns an NSUInteger (unsigned long).

Change-Id: I3b1c6720e9503ed181f01a7e737de07a277f7bde
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-09-21 01:25:19 +02:00
Stephen Kelly
d8bc9903f5 docs: QT_STATICPLUGIN is needed when building a plugin, not application.
Change-Id: Ifcdf2df6adad7511730af3f24d4d4c82aa78e61f
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-09-21 01:25:19 +02:00
Laszlo Agocs
88fb127331 eglfs: Unify the native resource getters
Similarly to how it's done in xcb. And add support for eglwindow since
the WId will soon once again cease to be an EGLNativeWindowType.

Change-Id: I0e3b86a21179439821550c9423f0e747ccae5897
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
2013-09-21 01:25:19 +02:00
Giuseppe D'Angelo
73637b7d1a Remove qBinaryFind usages from bootstrapped files
This is done per the mailing list discussion at
http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I492b49553bc889892f5ca0c47aa13c75e11518e2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2013-09-20 23:45:35 +02:00
Bernd Weimer
6a12da7fb3 Added support for cover windows on BlackBerry platform
On the BlackBerry platform when an application is minimized an
alternate cover window is shown. This patch allows Qt to render
into those windows.
A new window type "Qt::CoverWindow" has been introduced.

Change-Id: If5e321f5cb00f6d3ed7a5dc0af425655d7a9253a
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2013-09-20 23:45:06 +02:00