We usually do not have a console, so print out the messages
to the log as well, so that it's easier to run single tests
for debugging.
Change-Id: I31908977aac25a6f6716f8245206b01026234aa9
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Commit 310031188c (Fix moc stumbling over gcc __attribute__
extensions, 2012-10-01) applied similar logic for GNU style
attributes.
Change-Id: I550eaefd703b4e974e6ffae7716f02074c8a8823
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Allows us to have scoped variables such as eg FOO[arch=armv7].
We could quote all variables, but Xcode doesn't, and we try to stay
close to the native behavior.
Change-Id: Ia6634a33e42031fe7e69c4f680803fa347e5de4a
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
qt_message, in the regular case, calls qt_message_print, which invokes the
default message handler (qDefaultMessageHandler), which uses
qMessageFormatString to construct a string, and then platform-dependent methods
to print this out. This means that qMessageFormatString's newline is the one
that separates debug messages.
Unfortunately, in the emergency case, we don't have this luxury of doing
formatting: so just make sure to add a newline so output is readable.
Change-Id: I8f7bbceb9347b6312748f0f426feebaf04f6a226
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This simplifies the code a bit and ensures that it is respecting what
the relevant function expects the size to be as.
Change-Id: Iec88fab84c27a33d6f1a9e9413ea6beb0a39c68d
Reviewed-by: John Layt <jlayt@kde.org>
There are no calls to qSort in the file any more.
Change-Id: I5534271a75065998d5a98147a0d19850318c940c
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
There are no calls to qSort in the file any more.
Change-Id: Ifd65b543941ab90d6a1ed4e318d925bdbf3f454e
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This class already has some guards for QT_NO_FILESYSTEMWATCHER; implement
the rest.
Change-Id: I97072c9cd1debb726f9d10ff49ff0c01bbb9bc6e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
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>
Found by ICC.
Change-Id: Icd89e7df828afdb2acf2c46e00698ef04d5d94c9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: John Layt <jlayt@kde.org>
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>
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>
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>
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>
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>
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>
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>
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>
Add backend implementation for Windows times zones.
Change-Id: I30946f6672488c3f1d1d05754e9479aa62cce46f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>